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

TMSS-190: (and TMSS-152) use/borrow QA spec from target if not given for calibrator obs

parent 76d477bc
No related branches found
No related tags found
1 merge request!252Resolve TMSS-190
...@@ -246,6 +246,15 @@ def create_qafile_subtask_from_observation_subtask(observation_subtask: Subtask) ...@@ -246,6 +246,15 @@ def create_qafile_subtask_from_observation_subtask(observation_subtask: Subtask)
SubtaskType.Choices.QA_FILES.value, observation_subtask.pk)) SubtaskType.Choices.QA_FILES.value, observation_subtask.pk))
obs_task_spec = observation_subtask.task_blueprint.specifications_doc obs_task_spec = observation_subtask.task_blueprint.specifications_doc
if "QA" not in obs_task_spec:
# use QA settings from target obs for calibrators which have no QA spec.
target_task_blueprint = get_related_target_observation_task_blueprint(observation_subtask.task_blueprint)
if target_task_blueprint is not None:
obs_task_spec = target_task_blueprint.specifications_doc
logger.info("Using QA settings for calibrator observation task_blueprint id=%s from target observation task_blueprint id=%s to create QA subtasks",
observation_subtask.task_blueprint.id, target_task_blueprint.id)
obs_task_qafile_spec = obs_task_spec.get("QA", {}).get("file_conversion", {}) obs_task_qafile_spec = obs_task_spec.get("QA", {}).get("file_conversion", {})
if not obs_task_qafile_spec.get("enabled", False): if not obs_task_qafile_spec.get("enabled", False):
...@@ -310,6 +319,15 @@ def create_qaplots_subtask_from_qafile_subtask(qafile_subtask: Subtask) -> Subta ...@@ -310,6 +319,15 @@ def create_qaplots_subtask_from_qafile_subtask(qafile_subtask: Subtask) -> Subta
qafile_subtask.specifications_template.type, SubtaskType.Choices.QA_FILES.value)) qafile_subtask.specifications_template.type, SubtaskType.Choices.QA_FILES.value))
obs_task_spec = qafile_subtask.task_blueprint.specifications_doc obs_task_spec = qafile_subtask.task_blueprint.specifications_doc
if "QA" not in obs_task_spec:
# use QA settings from target obs for calibrators which have no QA spec.
target_task_blueprint = get_related_target_observation_task_blueprint(qafile_subtask.task_blueprint)
if target_task_blueprint is not None:
obs_task_spec = target_task_blueprint.specifications_doc
logger.info("Using QA settings for calibrator observation task_blueprint id=%s from target observation task_blueprint id=%s to create QA subtasks",
qafile_subtask.task_blueprint.id, target_task_blueprint.id)
obs_task_qaplots_spec = obs_task_spec.get("QA", {}).get("plots", {}) obs_task_qaplots_spec = obs_task_spec.get("QA", {}).get("plots", {})
if not obs_task_qaplots_spec.get("enabled", False): if not obs_task_qaplots_spec.get("enabled", False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment