Skip to content
Snippets Groups Projects
Commit 84f9321c authored by Matthijs van der Wild's avatar Matthijs van der Wild
Browse files

Added check that antenna exists in solution file

parent a897148b
No related branches found
No related tags found
1 merge request!182Added check that antenna exists in solution file
Pipeline #70337 passed
...@@ -144,10 +144,13 @@ def main(flagFiles = None, pipeline = 'LINC', run_type = 'calibrator', filtered_ ...@@ -144,10 +144,13 @@ def main(flagFiles = None, pipeline = 'LINC', run_type = 'calibrator', filtered_
for antenna in antennas: for antenna in antennas:
json_output['metrics'][pipeline]['stations'].append({'station' : antenna, 'removed' : 'no'}) json_output['metrics'][pipeline]['stations'].append({'station' : antenna, 'removed' : 'no'})
for antenna in antennas: for antenna in antennas:
index = [i for (i, item) in enumerate(station_statistics) if item['station'] == antenna][0] try:
if 'percentage_flagged' not in json_output['metrics'][pipeline]['stations'][index].keys(): index = [i for (i, item) in enumerate(station_statistics) if item['station'] == antenna][0]
json_output['metrics'][pipeline]['stations'][index]['percentage_flagged'] = {} if 'percentage_flagged' not in json_output['metrics'][pipeline]['stations'][index].keys():
json_output['metrics'][pipeline]['stations'][index]['percentage_flagged'][state] = flagged_fraction_antenna[antenna] * 100 json_output['metrics'][pipeline]['stations'][index]['percentage_flagged'] = {}
json_output['metrics'][pipeline]['stations'][index]['percentage_flagged'][state] = flagged_fraction_antenna[antenna] * 100
except:
json_output['metrics'][pipeline]['stations'].append( {'station' : antenna, 'removed' : 'yes'})
f.close() f.close()
## printing results human readable ## printing results human readable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment