diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py index 27dda83cd5f1cf37e61c44fd9efe5dfea9bb32f8..00ed6e2a27944488a317e540fa46c972b8b0f13e 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py @@ -145,7 +145,7 @@ def _convert_beamformer_settings_to_parset_dict(subtask: models.Subtask, spec: d beamformer_pipeline_parsets = [] # Process beamformer pipelines - for pipeline in spec['COBALT']['beamformer']['tab_pipelines']: + for pipeline_idx, pipeline in enumerate(spec['COBALT']['beamformer']['tab_pipelines']): pipeline_parset = {} pipeline_parset.update(_add_prefix(_stokes_settings_parset_subkeys(pipeline['coherent']), "CoherentStokes.")) pipeline_parset.update(_add_prefix(_stokes_settings_parset_subkeys(pipeline['incoherent']), "IncoherentStokes.")) @@ -176,12 +176,13 @@ def _convert_beamformer_settings_to_parset_dict(subtask: models.Subtask, spec: d for s in range(nr_stokes): for p in range(nr_parts): dataproduct = [dp for dp in dataproducts - if dp.specifications_doc["sap"] == sap['name'] + if dp.specifications_doc.get("sap") == sap['name'] + and "identifiers" in dp.specifications_doc and dp.specifications_doc["identifiers"]["pipeline_index"] == pipeline_idx - and dp.specifications_doc["identifiers"]["tab_index"] == field_idx + and dp.specifications_doc["identifiers"]["tab_index"] == tab_idx and dp.specifications_doc["identifiers"]["stokes_index"] == s and dp.specifications_doc["identifiers"]["part_index"] == p - and dp.specifications_doc["coherent"] == tab['coherent']] + and dp.specifications_doc.get("coherent") == tab['coherent']] if tab['coherent']: coherent_dataproducts.append(dataproduct[0] if dataproduct else null_dataproduct) else: