Skip to content

Commit

Permalink
Added minimum checks to see if maskfile matches the input raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
scottransom committed May 20, 2024
1 parent 9a7c972 commit a5286ef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mpiprepsubband.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ int main(int argc, char *argv[])
if (myid == 0) {
read_mask(cmd->maskfile, &obsmask);
printf("Read mask information from '%s'\n\n", cmd->maskfile);
if ((obsmask.numchan != idata.num_chan) ||
(fabs(obsmask.mjd - (idata.mjd_i + idata.mjd_f)) > 1e-9)) {
printf("WARNING!: maskfile has different number of channels or start MJD than raw data! Exiting.\n\n");
exit(1);
}
good_padvals = determine_padvals(cmd->maskfile, &obsmask, s.padvals);
}
broadcast_mask(&obsmask, myid);
Expand Down
5 changes: 5 additions & 0 deletions src/prepdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ int main(int argc, char *argv[])
if (cmd->maskfileP) {
read_mask(cmd->maskfile, &obsmask);
printf("Read mask information from '%s'\n\n", cmd->maskfile);
if ((obsmask.numchan != idata.num_chan) ||
(fabs(obsmask.mjd - (idata.mjd_i + idata.mjd_f)) > 1e-9)) {
printf("WARNING!: maskfile has different number of channels or start MJD than raw data! Exiting.\n\n");
exit(1);
}
good_padvals = determine_padvals(cmd->maskfile, &obsmask, s.padvals);
} else {
obsmask.numchan = obsmask.numint = 0;
Expand Down
10 changes: 10 additions & 0 deletions src/prepfold.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ int main(int argc, char *argv[])
if (cmd->maskfileP) {
read_mask(cmd->maskfile, &obsmask);
printf("Read mask information from '%s'\n\n", cmd->maskfile);
if ((obsmask.numchan != idata.num_chan) ||
(fabs(obsmask.mjd - (idata.mjd_i + idata.mjd_f)) > 1e-9)) {
printf("WARNING!: maskfile has different number of channels or start MJD than raw data! Exiting.\n\n");
exit(1);
}
good_padvals = determine_padvals(cmd->maskfile, &obsmask, s.padvals);
} else {
obsmask.numchan = obsmask.numint = 0;
Expand Down Expand Up @@ -328,6 +333,11 @@ int main(int argc, char *argv[])
if (cmd->maskfileP) {
read_mask(cmd->maskfile, &obsmask);
printf("Read mask information from '%s'\n\n", cmd->maskfile);
if ((obsmask.numchan != idata.num_chan) ||
(fabs(obsmask.mjd - (idata.mjd_i + idata.mjd_f)) > 1e-9)) {
printf("WARNING!: maskfile has different number of channels or start MJD than raw data! Exiting.\n\n");
exit(1);
}
good_padvals = determine_padvals(cmd->maskfile, &obsmask, s.padvals);
} else {
obsmask.numchan = obsmask.numint = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/prepsubband.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ int main(int argc, char *argv[])
if (cmd->maskfileP) {
read_mask(cmd->maskfile, &obsmask);
printf("Read mask information from '%s'\n\n", cmd->maskfile);
if ((obsmask.numchan != idata.num_chan) ||
(fabs(obsmask.mjd - (idata.mjd_i + idata.mjd_f)) > 1e-9)) {
printf("WARNING!: maskfile has different number of channels or start MJD than raw data! Exiting.\n\n");
exit(1);
}
good_padvals = determine_padvals(cmd->maskfile, &obsmask, s.padvals);
} else {
obsmask.numchan = obsmask.numint = 0;
Expand Down

0 comments on commit a5286ef

Please sign in to comment.