Skip to content
Snippets Groups Projects
Commit 20eeb570 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-604: fixed output dataproduct filtering

parent 59f76319
No related branches found
No related tags found
1 merge request!383Resolve TMSS-604 "Dataproduct specs"
......@@ -107,11 +107,7 @@ def _convert_correlator_settings_to_parset_dict(subtask: models.Subtask, spec: d
parset[beam_prefix+"Correlator.angle2"] = phase_center['pointing']['angle2']
# TODO: do not use SubtaskOutput.objects.filter but make subtask.subtask_outputs work
subtask_outputs = list(models.SubtaskOutput.objects.filter(subtask_id=subtask.id))
subtask_output_ids = [o.id for o in subtask_outputs]
dataproducts = list(models.Dataproduct.objects.filter(producer_id__in=subtask_output_ids).filter(dataformat=Dataformat.Choices.MEASUREMENTSET.value).filter(datatype=Datatype.Choices.VISIBILITIES))
dataproducts = list(subtask.output_dataproducts.filter(dataformat__value=Dataformat.Choices.MEASUREMENTSET.value).filter(datatype__value=Datatype.Choices.VISIBILITIES.value).order_by('filename'))
# marshall dataproducts, but only if they're supplied. in some use cases, we want a parset before the subtask is scheduled.
correlator_dataproducts = []
......@@ -138,12 +134,8 @@ def _convert_beamformer_settings_to_parset_dict(subtask: models.Subtask, spec: d
parset = {}
# TODO: do not use SubtaskOutput.objects.filter but make subtask.subtask_outputs work
subtask_outputs = list(models.SubtaskOutput.objects.filter(subtask_id=subtask.id))
subtask_output_ids = [o.id for o in subtask_outputs]
# TODO: don't assume ordering by filename is sufficient: we need to inspect the dataproduct properties to make sure saps and subbands are in the correct order
dataproducts = list(models.Dataproduct.objects.filter(producer_id__in=subtask_output_ids).filter(dataformat=Dataformat.Choices.MEASUREMENTSET.value).filter(datatype=Datatype.Choices.TIME_SERIES.value).order_by('filename'))
dataproducts = list(subtask.output_dataproducts.filter(dataformat__value=Dataformat.Choices.BEAMFORMED.value).filter(datatype__value=Datatype.Choices.TIME_SERIES.value).order_by('filename'))
# Lists of coherent and incoherent dataproducts that will be produced, in the order COBALT wants them
coherent_dataproducts = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment