Skip to content

Added check that antenna exists in solution file

Matthijs van der Wild requested to merge fix_make_summary into master

Neal Jackson reported an issue that LINC calibrator fails at the summary. The error log says

Traceback (most recent call last):
  File "/share/nas/njj/LINC/scripts/make_summary.py", line 242, in <module>
    main(flagFiles = args.flagFiles, pipeline = args.pipeline, run_type = args.run_type, filtered_antennas = args.filtered_antennas, bad_antennas 
= args.bad_antennas, output_fname = args.output_fname, structure_file = args.structure_file, Ateam_separation_file = args.Ateam_separation_file, s
olutions = args.solutions, clip_sources = args.clip_sources, demix_sources = args.demix_sources, demix = args.demix, removed_bands = args.removed_
bands, min_unflagged = args.min_unflagged, refant = args.refant)
  File "/share/nas/njj/LINC/scripts/make_summary.py", line 150, in main
    index = [i for (i, item) in enumerate(station_statistics) if item['station'] == antenna][0]
IndexError: list index out of range
Closing remaining open files:/share/nas/njj/lofar-vlbi/processing/549769/tmpdir_LINC_calibrator/aipiq19k/stge08fbd75-6644-4a18-ab96-e0872ed45be2/c
al_solutions.h5...done

This suggests that data from the json files carrying flagging statistics contain antennas that aren't present in the final solution set. This issue is related to #43 (closed), but the summary script itself isn't clear what should be done in a situation like this.

This MR adds an exception to make_summary.py in case the antennas in the solution and flagging files don't match.

Merge request reports

Loading