diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/zdab-cat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/zdab-cat.c b/src/zdab-cat.c index 88024d4..c9e50f2 100644 --- a/src/zdab-cat.c +++ b/src/zdab-cat.c @@ -49,6 +49,7 @@ void usage(void) fprintf(stderr," -o output file (default: stdout)\n"); fprintf(stderr," --skip-second-event only fit the first event after a MAST bank\n"); fprintf(stderr," -v verbose\n"); + fprintf(stderr," --gtid only fit a single GTID\n"); fprintf(stderr," -h display this help message\n"); exit(1); } @@ -77,12 +78,16 @@ int main(int argc, char **argv) int nmcgn = 0; static HDF5MCGN hdf5_mcgn[MAX_NEVENTS]; int verbose = 0; + int32_t gtid = -1; for (i = 1; i < argc; i++) { if (strlen(argv[i]) >= 2 && !strncmp(argv[i], "--", 2)) { if (!strcmp(argv[i]+2,"skip-second-event")) { skip_second_event = 1; continue; + } else if (!strcmp(argv[i]+2,"gtid")) { + gtid = atoi(argv[++i]); + continue; } } else if (argv[i][0] == '-') { switch (argv[i][1]) { @@ -283,6 +288,8 @@ skip_mc: while (1) { unpack_ev(b.data, &bev); + if (gtid > 0 && bev.gtr_id != gtid) goto skip_event; + if (bev.run != last_run) { fprintf(stderr, "loading DQXX file for run %010i\n", bev.run); @@ -339,6 +346,8 @@ skip_mc: nevents++; } +skip_event: + /* Note the origin link for the first EV bank points back to the * structural link location in the MAST bank. These links are super * confusing! */ |