diff --git a/SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py b/SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py index f8e2869a8dba9181d30cc682f8e9eaecebc23a9c..321d195c5d07befcb5a552e379868cf8aa098865 100755 --- a/SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py +++ b/SAS/TMSS/backend/services/scheduling/test/t_dynamic_scheduling.py @@ -965,8 +965,8 @@ class TestSkyConstraints(unittest.TestCase): self.scheduling_unit_blueprint.scheduling_constraints_doc['sky'] = {'transit_offset': {'from': -7201, 'to': -7199}} self.scheduling_unit_blueprint.specifications_doc['tasks']['Observation']['specifications_doc']['antenna_set'] = 'LBA_INNER' self.scheduling_unit_blueprint.specifications_doc['tasks']['Observation']['specifications_doc']['SAPs'] = \ - [{'name': 'CygA', 'target': 'CygA', 'subbands': [0, 1], 'digital_pointing': {'angle1': 5.233660650313663, 'angle2': 0.7109404782526458, 'direction_type': 'J2000'}}, - {'name': 'CasA', 'target': 'CasA', 'subbands': [2, 3], 'digital_pointing': {'angle1': 6.233660650313663, 'angle2': 0.6109404782526458, 'direction_type': 'J2000'}}] + [{'name': 'CygA', 'subbands': [0, 1], 'digital_pointing': {'angle1': 5.233660650313663, 'angle2': 0.7109404782526458, 'direction_type': 'J2000', 'target': 'CygA', }}, + {'name': 'CasA', 'subbands': [2, 3], 'digital_pointing': {'angle1': 6.233660650313663, 'angle2': 0.6109404782526458, 'direction_type': 'J2000', 'target': 'CasA',}}] self.scheduling_unit_blueprint.save() timestamp = datetime(2020, 1, 1, 12, 0, 0) returned_value = tc1.can_run_anywhere_within_timewindow_with_sky_constraints(self.scheduling_unit_blueprint, timestamp, timestamp + timedelta(seconds=self.obs_duration)) diff --git a/SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py b/SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py index cdc9bed5b68036ee2a12395766d7a70b8b0f7f90..a4d69679d087c524d6b071918912ae50f9480e48 100644 --- a/SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py +++ b/SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py @@ -210,8 +210,8 @@ class TMSSPGListener(PostgresListener): task_blueprint = subtask.task_blueprint task_id = subtask.task_blueprint.id task_cached_properties = {'status': task_blueprint.status, - 'start_time': task_blueprint.start_time, - 'stop_time': task_blueprint.stop_time } + 'scheduled_on_sky_start_time': task_blueprint.scheduled_on_sky_start_time, + 'scheduled_on_sky_stop_time': task_blueprint.scheduled_on_sky_stop_time} if task_id not in self._task_cache or self._task_cache[task_id][1] != task_cached_properties: # send generic updated event @@ -230,8 +230,8 @@ class TMSSPGListener(PostgresListener): scheduling_unit = task_blueprint.scheduling_unit_blueprint scheduling_unit_id = scheduling_unit.id scheduling_unit_cached_properties = {'status': scheduling_unit.status, - 'start_time': scheduling_unit.start_time, - 'stop_time': scheduling_unit.stop_time } + 'scheduled_on_sky_start_time': scheduling_unit.scheduled_on_sky_start_time, + 'scheduled_on_sky_stop_time': scheduling_unit.scheduled_on_sky_stop_time } if scheduling_unit_id not in self._scheduling_unit_cache or self._scheduling_unit_cache[scheduling_unit_id][1] != scheduling_unit_cached_properties: # send generic updated event diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py index 0fa41fe575bef9243bbf20111926bc5b1c40a017..808f0cc55c235c2faa9ee483e36fba393aebd5f1 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py @@ -93,6 +93,7 @@ def observation_correlated_feedback_to_feedback_doc(dp_feedback: dict) -> dict: "direction_type": dp_feedback['Pointing.directionType'], "angle1": float(dp_feedback['Pointing.angle1']), "angle2": float(dp_feedback['Pointing.angle2']), + "target": "Unknown" # todo } }, "samples": { @@ -138,6 +139,7 @@ def observation_beamformed_feedback_to_feedback_doc(dp_feedback: dict) -> dict: "direction_type": dp_feedback[beam_prefix + 'Pointing.directionType'], "angle1": float(dp_feedback[beam_prefix + 'Pointing.angle1']), "angle2": float(dp_feedback[beam_prefix + 'Pointing.angle2']), + "target": "Unknown" # todo }, "coherent": not beam_prefix.startswith("IncoherentStokesBeam") }, @@ -246,6 +248,7 @@ def pulsar_pipeline_analysis_feedback_to_feedback_doc(input_dp_feedback_doc: dic "direction_type": "J2000", "angle1": float(dp_feedback[beam_prefix + 'Pointing.angle1']), "angle2": float(dp_feedback[beam_prefix + 'Pointing.angle2']), + "target": input_dp_feedback_doc["target"]["pointing"]["target"] } if beam_prefix == "CoherentStokesBeam." else input_dp_feedback_doc["target"]["pointing"], "coherent": beam_prefix != "IncoherentStokesBeam." }, diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py index 6a4df77fcdbe180aba16e19e20ca36108b6a9db6..1bc70cc5e44ecbfca63943bf44d4ed6cccdc8737 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/parset.py @@ -343,7 +343,7 @@ def _convert_to_parset_dict_for_observationcontrol_schema(subtask: models.Subtas parset[beam_prefix+"directionType"] = digi_beam['pointing']['direction_type'] parset[beam_prefix+"angle1"] = digi_beam['pointing']['angle1'] parset[beam_prefix+"angle2"] = digi_beam['pointing']['angle2'] - parset[beam_prefix+"target"] = digi_beam['name'] + parset[beam_prefix+"target"] = digi_beam['pointing']['target'] parset[beam_prefix+"subbandList"] = digi_beam['subbands'] parset[beam_prefix+"nrTiedArrayBeams"] = 0 parset[beam_prefix+"nrTabRings"] = 0 diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py index 60663bcd372c676cdf0aa2edb5a253d3ed0480a9..6aa7bd92c9b5668d2a2f9520fc45678d2baf957a 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py @@ -373,11 +373,11 @@ def _get_subs_and_durations_from_project(project_pk: int, start: datetime, stop: subs = project_subs.filter(priority_queue=prio.value) for sub in subs: # Check time interval and go to the next iteration (SUB) if the check fails - if (start and sub.start_time < start) or (stop and sub.stop_time > stop): + if (start and sub.scheduled_on_sky_start_time < start) or (stop and sub.scheduled_on_sky_stop_time > stop): continue # Gathering info for reporting - sub_start_time = sub.start_time.isoformat() if sub.start_time else None - sub_stop_time = sub.stop_time.isoformat() if sub.stop_time else None + sub_start_time = sub.scheduled_on_sky_start_time.isoformat() if sub.scheduled_on_sky_start_time else None + sub_stop_time = sub.scheduled_on_sky_stop_time.isoformat() if sub.scheduled_on_sky_stop_time else None sub_duration = sub.duration.total_seconds() sub_observed_duration = sub.observed_duration.total_seconds() if sub.observed_duration else 0 # Info about the SUB to be returned diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py index f299db6d2fb0a7e8464777a3e71650281ee1bc30..fd30e6699297261f9de5a820c35333e998aa5d32 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py @@ -155,7 +155,7 @@ def create_sip_representation_for_subtask(subtask: Subtask): beamnumber=0, # TODO: where to get the beamnumber? identifier=get_siplib_identifier(sap.global_identifier, "SAP id=%s" % sap.id), measurementtype=sap.specifications_doc['measurement_type'].capitalize(), - targetname=sap.specifications_doc['target'], + targetname=sap.specifications_doc["pointing"]['target'], starttime=sap.specifications_doc['time']['start_time'], duration=isodate.duration_isoformat(datetime.timedelta(seconds=round(sap.specifications_doc['time']['duration']))), numberofprocessing=1, #TODO: check diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py index 9d508617388b4e8b8556cd97002a82f7545cbaf2..d54a94194f3e6b0c49a2728e14143eb976626ff2 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py @@ -735,12 +735,12 @@ class SchedulingUnitBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, NamedCo @cached_property def duration(self) -> datetime.timedelta: - '''return the overall duration of all tasks of this scheduling unit + '''return the overall on sky duration of all tasks of this scheduling unit ''' - if self.start_time is None or self.stop_time is None: + if self.scheduled_on_sky_start_time is None or self.scheduled_on_sky_stop_time is None: return self.relative_stop_time - self.relative_start_time else: - return self.stop_time - self.start_time # <- todo: do we ever want this? + return self.scheduled_on_sky_stop_time - self.scheduled_on_sky_start_time # <- todo: do we ever want this? @cached_property def relative_start_time(self) -> datetime.timedelta: @@ -763,52 +763,152 @@ class SchedulingUnitBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, NamedCo return datetime.timedelta(seconds=0) @cached_property - def start_time(self) -> datetime or None: - '''return the earliest start time of all tasks of this scheduling unit + def scheduled_on_sky_start_time(self) -> datetime or None: + '''return the earliest scheduled on sky start time of all tasks of this scheduling unit + ''' + tasks_with_start_time = list(filter(lambda x: x.scheduled_on_sky_start_time is not None, self.task_blueprints.all())) + if tasks_with_start_time: + return min(tasks_with_start_time, key=lambda x: x.scheduled_on_sky_start_time).scheduled_on_sky_start_time + else: + return None + + @cached_property + def scheduled_on_sky_stop_time(self) -> datetime or None: + '''return the latest scheduled on sky stop time of all tasks of this scheduling unit + ''' + tasks_with_stop_time = list(filter(lambda x: x.scheduled_on_sky_stop_time is not None, self.task_blueprints.all())) + if tasks_with_stop_time: + return max(tasks_with_stop_time, key=lambda x: x.scheduled_on_sky_stop_time).scheduled_on_sky_stop_time + else: + return None + + @cached_property + def scheduled_process_start_time(self) -> datetime or None: + '''return the earliest scheduled process start time of all tasks of this scheduling unit + ''' + tasks_with_start_time = list(filter(lambda x: x.scheduled_process_start_time is not None, self.task_blueprints.all())) + if tasks_with_start_time: + return min(tasks_with_start_time, key=lambda x: x.scheduled_process_start_time).scheduled_process_start_time + else: + return None + + @cached_property + def scheduled_process_stop_time(self) -> datetime or None: + '''return the latest scheduled process stop time of all tasks of this scheduling unit + ''' + tasks_with_stop_time = list(filter(lambda x: x.scheduled_process_stop_time is not None, self.task_blueprints.all())) + if tasks_with_stop_time: + return max(tasks_with_stop_time, key=lambda x: x.scheduled_process_stop_time).scheduled_process_stop_time + else: + return None + + @cached_property + def actual_on_sky_start_time(self) -> datetime or None: + '''return the earliest actual on sky start time of all tasks of this scheduling unit + ''' + tasks_with_start_time = list(filter(lambda x: x.actual_on_sky_start_time is not None, self.task_blueprints.all())) + if tasks_with_start_time: + return min(tasks_with_start_time, key=lambda x: x.actual_on_sky_start_time).actual_on_sky_start_time + else: + return None + + @cached_property + def actual_on_sky_stop_time(self) -> datetime or None: + '''return the latest actual on sky stop time of all tasks of this scheduling unit + ''' + tasks_with_stop_time = list(filter(lambda x: x.actual_on_sky_stop_time is not None, self.task_blueprints.all())) + if tasks_with_stop_time: + return max(tasks_with_stop_time, key=lambda x: x.actual_on_sky_stop_time).actual_on_sky_stop_time + else: + return None + + @cached_property + def actual_process_start_time(self) -> datetime or None: + '''return the earliest actual process start time of all tasks of this scheduling unit + ''' + tasks_with_start_time = list(filter(lambda x: x.actual_process_start_time is not None, self.task_blueprints.all())) + if tasks_with_start_time: + return min(tasks_with_start_time, key=lambda x: x.actual_process_start_time).actual_process_start_time + else: + return None + + @cached_property + def actual_process_stop_time(self) -> datetime or None: + '''return the latest actual process stop time of all tasks of this scheduling unit + ''' + tasks_with_stop_time = list(filter(lambda x: x.actual_process_stop_time is not None, self.task_blueprints.all())) + if tasks_with_stop_time: + return max(tasks_with_stop_time, key=lambda x: x.actual_process_stop_time).actual_process_stop_time + else: + return None + + @cached_property + def on_sky_start_time(self) -> datetime or None: + '''return the earliest on sky start time of all the observation tasks of this scheduling unit. + ''' + observation_tasks_with_start_time = list(filter(lambda x: (x.specifications_template.type.value == TaskType.Choices.OBSERVATION.value and x.on_sky_start_time is not None), self.task_blueprints.all())) + if observation_tasks_with_start_time: + return min(observation_tasks_with_start_time, key=lambda x: x.on_sky_start_time).on_sky_start_time + else: + return None + + @cached_property + def on_sky_stop_time(self) -> datetime or None: + '''return the latest on sky stop time of all the observation tasks of this scheduling unit. + ''' + observation_tasks_with_stop_time = list(filter(lambda x: (x.specifications_template.type.value == TaskType.Choices.OBSERVATION.value and x.on_sky_stop_time is not None), self.task_blueprints.all())) + if observation_tasks_with_stop_time: + return max(observation_tasks_with_stop_time, key=lambda x: x.on_sky_stop_time).on_sky_stop_time + else: + return None + + @cached_property + def process_start_time(self) -> datetime or None: + '''return the earliest process start time of all the tasks of this scheduling unit. ''' - tasks_with_start_time = list(filter(lambda x: x.start_time is not None, self.task_blueprints.all())) + tasks_with_start_time = list(filter(lambda x: x.process_start_time is not None, self.task_blueprints.all())) if tasks_with_start_time: - return min(tasks_with_start_time, key=lambda x: x.start_time).start_time + return min(tasks_with_start_time, key=lambda x: x.process_start_time).process_start_time else: return None @cached_property - def stop_time(self) -> datetime or None: - '''return the latest stop time of all tasks of this scheduling unit + def process_stop_time(self) -> datetime or None: + '''return the latest process stop time of all the tasks of this scheduling unit. ''' - tasks_with_stop_time = list(filter(lambda x: x.stop_time is not None, self.task_blueprints.all())) + tasks_with_stop_time = list(filter(lambda x: x.process_stop_time is not None, self.task_blueprints.all())) if tasks_with_stop_time: - return max(tasks_with_stop_time, key=lambda x: x.stop_time).stop_time + return max(tasks_with_stop_time, key=lambda x: x.process_stop_time).process_stop_time else: return None @property def observed_start_time(self) -> datetime or None: """ - return the earliest start time of all (observation) tasks of this scheduling unit with the status observed/finished + return the earliest on sky start time of all (observation) tasks of this scheduling unit with the status observed/finished """ observed_tasks = [] for task in self.task_blueprints.all(): if task.specifications_template.type.value == TaskType.Choices.OBSERVATION.value and \ - (task.status == "observed" or task.status == "finished") and task.start_time is not None: + (task.status == "observed" or task.status == "finished") and task.scheduled_on_sky_start_time is not None: observed_tasks.append(task) if observed_tasks: - return min(observed_tasks, key=lambda x: x.start_time).start_time + return min(observed_tasks, key=lambda x: x.scheduled_on_sky_start_time).scheduled_on_sky_start_time else: return None @property def observed_end_time(self) -> datetime or None: """ - return the latest stop time of all (observation) tasks of this scheduling unit with the status observed/finished + return the latest on sky stop time of all (observation) tasks of this scheduling unit with the status observed/finished """ observed_tasks = [] for task in self.task_blueprints.all(): if task.specifications_template.type.value == TaskType.Choices.OBSERVATION.value and\ - (task.status == "observed" or task.status == "finished") and task.stop_time is not None: + (task.status == "observed" or task.status == "finished") and task.scheduled_on_sky_stop_time is not None: observed_tasks.append(task) if observed_tasks: - return max(observed_tasks, key=lambda x: x.stop_time).stop_time + return max(observed_tasks, key=lambda x: x.scheduled_on_sky_stop_time).scheduled_on_sky_stop_time else: return None @@ -1269,10 +1369,10 @@ class TaskBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, RefreshFromDbInva def duration(self) -> datetime.timedelta: '''return the overall duration of this task ''' - if self.start_time is None or self.stop_time is None: + if self.scheduled_on_sky_start_time is None or self.scheduled_on_sky_stop_time is None: return self.relative_stop_time - self.relative_start_time else: - return self.stop_time - self.start_time + return self.scheduled_on_sky_stop_time - self.schedule_on_sky_start_time @cached_property def relative_start_time(self) -> datetime.timedelta: @@ -1316,8 +1416,8 @@ class TaskBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, RefreshFromDbInva return self.relative_start_time @cached_property - def start_time(self) -> datetime or None: - '''return the earliest start time of all subtasks of this task + def scheduled_on_sky_start_time(self) -> datetime or None: + '''return the earliest scheduled on sky start time of all subtasks of this task ''' subtasks_with_start_time = list(filter(lambda x: x.scheduled_on_sky_start_time is not None, self.subtasks.all())) if subtasks_with_start_time: @@ -1326,8 +1426,8 @@ class TaskBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, RefreshFromDbInva return None @cached_property - def stop_time(self) -> datetime or None: - '''return the latest stop time of all subtasks of this task + def scheduled_on_sky_stop_time(self) -> datetime or None: + '''return the latest scheduled on sky stop time of all subtasks of this task ''' subtasks_with_stop_time = list(filter(lambda x: x.scheduled_on_sky_stop_time is not None, self.subtasks.all())) if subtasks_with_stop_time: @@ -1335,6 +1435,106 @@ class TaskBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, RefreshFromDbInva else: return None + @cached_property + def scheduled_process_start_time(self) -> datetime or None: + '''return the earliest scheduled process start time of all subtasks of this task + ''' + subtasks_with_start_time = list(filter(lambda x: x.scheduled_process_start_time is not None, self.subtasks.all())) + if subtasks_with_start_time: + return min(subtasks_with_start_time, key=lambda x: x.scheduled_process_start_time).scheduled_process_start_time + else: + return None + + @cached_property + def scheduled_process_stop_time(self) -> datetime or None: + '''return the latest scheduled process stop time of all subtasks of this task + ''' + subtasks_with_stop_time = list(filter(lambda x: x.scheduled_process_stop_time is not None, self.subtasks.all())) + if subtasks_with_stop_time: + return max(subtasks_with_stop_time, key=lambda x: x.scheduled_process_stop_time).scheduled_process_stop_time + else: + return None + + @cached_property + def actual_on_sky_start_time(self) -> datetime or None: + '''return the earliest actual on sky start time of all subtasks of this task + ''' + subtasks_with_start_time = list(filter(lambda x: x.actual_on_sky_start_time is not None, self.subtasks.all())) + if subtasks_with_start_time: + return min(subtasks_with_start_time, key=lambda x: x.actual_on_sky_start_time).actual_on_sky_start_time + else: + return None + + @cached_property + def actual_on_sky_stop_time(self) -> datetime or None: + '''return the latest actual on sky stop time of all subtasks of this task + ''' + subtasks_with_stop_time = list(filter(lambda x: x.actual_on_sky_stop_time is not None, self.subtasks.all())) + if subtasks_with_stop_time: + return max(subtasks_with_stop_time, key=lambda x: x.actual_on_sky_stop_time).actual_on_sky_stop_time + else: + return None + + @cached_property + def actual_process_start_time(self) -> datetime or None: + '''return the earliest actual process start time of all subtasks of this task + ''' + subtasks_with_start_time = list(filter(lambda x: x.actual_process_start_time is not None, self.subtasks.all())) + if subtasks_with_start_time: + return min(subtasks_with_start_time, key=lambda x: x.actual_process_start_time).actual_process_start_time + else: + return None + + @cached_property + def actual_process_stop_time(self) -> datetime or None: + '''return the latest actual process stop time of all subtasks of this task + ''' + subtasks_with_stop_time = list(filter(lambda x: x.actual_process_stop_time is not None, self.subtasks.all())) + if subtasks_with_stop_time: + return max(subtasks_with_stop_time, key=lambda x: x.actual_process_stop_time).actual_process_stop_time + else: + return None + + @cached_property + def on_sky_start_time(self) -> datetime or None: + '''return the earliest on sky start time of all the observation subtasks of this task. + ''' + observation_control_subtasks = list(filter(lambda x: (x.specifications_template.name == 'observation control' and x.on_sky_start_time is not None), self.subtasks.all())) + if observation_control_subtasks: + return min(observation_control_subtasks, key=lambda x: x.on_sky_start_time).on_sky_start_time + else: + return None + + @cached_property + def on_sky_stop_time(self) -> datetime or None: + '''return the latest on sky stop time of all the observation subtasks of this task. + ''' + observation_control_subtasks = list(filter(lambda x: (x.specifications_template.name == 'observation control' and x.on_sky_stop_time is not None), self.subtasks.all())) + if observation_control_subtasks: + return max(observation_control_subtasks, key=lambda x: x.on_sky_stop_time).on_sky_stop_time + else: + return None + + @cached_property + def process_start_time(self) -> datetime or None: + '''return the earliest process start time of all the subtasks of this task. + ''' + subtasks_with_start_time = list(filter(lambda x: x.process_start_time is not None, self.subtasks.all())) + if subtasks_with_start_time: + return min(subtasks_with_start_time, key=lambda x: x.process_start_time).process_start_time + else: + return None + + @cached_property + def process_stop_time(self) -> datetime or None: + '''return the latest process stop time of all the subtasks of this task. + ''' + subtasks_with_stop_time = list(filter(lambda x: x.process_stop_time is not None, self.subtasks.all())) + if subtasks_with_stop_time: + return max(subtasks_with_stop_time, key=lambda x: x.process_stop_time).process_stop_time + else: + return None + @cached_property def is_obsolete(self) -> bool: '''is this task obsolete (because any of its subtasks are obsolete)''' diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/pointing-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/pointing-1.json index 95ccd3d9fc4acaf53d8fc49e7fd752ed176907f4..2c08c09b3698434b8e373d4baa9545d4849e256c 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/pointing-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/pointing-1.json @@ -37,11 +37,19 @@ ], "title": "Reference frame", "type": "string" + }, + "target": { + "default": "_target_name_", + "description": "Description of where this beam points at", + "minLength": 1, + "title": "Target", + "type": "string" } }, "required": [ "angle1", - "angle2" + "angle2", + "target" ], "type": "object" } diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/stations-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/stations-1.json index 04b8adfc92efeaa4cd7d2d19a5603167c78f457d..ea83e354530957933c3f42ee38bdbdf4dd53acca 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/stations-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template/stations-1.json @@ -39,17 +39,9 @@ }, "title": "Subband list", "type": "array" - }, - "target": { - "default": "_target_name_", - "description": "Description of where this beam points at", - "minLength": 1, - "title": "Target", - "type": "string" } }, "required": [ - "target", "name", "digital_pointing", "subbands" diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Beamforming_(Complex_Voltages)_Observation-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Beamforming_(Complex_Voltages)_Observation-1.json index b62427d2841e50c0f330ea56e856b9bd39295613..0c5454ac2fc6d5b680c4d45942a94c00bbe465ec 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Beamforming_(Complex_Voltages)_Observation-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Beamforming_(Complex_Voltages)_Observation-1.json @@ -82,7 +82,8 @@ "digital_pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "SAP0", "subbands": [ @@ -486,8 +487,7 @@ 448, 449, 450 - ], - "target": "B0329+54" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -911,7 +911,8 @@ "pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "relative": false } @@ -952,7 +953,8 @@ "tile_beam": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/HBA_single_beam_imaging-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/HBA_single_beam_imaging-1.json index ed256c4fa23d30b4999bd2509cc5864735217c06..934c2548121450208826f0dda6c611488a6ab1ca 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/HBA_single_beam_imaging-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/HBA_single_beam_imaging-1.json @@ -221,7 +221,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { @@ -238,7 +239,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { @@ -325,7 +327,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target", "subbands": [ @@ -897,7 +900,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/IM_LBA_Survey_Strategy_-_3_Beams-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/IM_LBA_Survey_Strategy_-_3_Beams-1.json index 17e85790ecd2dd5f4bec8469f654c1df95f909a1..fc962334e52588de1989d026f938009364398b81 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/IM_LBA_Survey_Strategy_-_3_Beams-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/IM_LBA_Survey_Strategy_-_3_Beams-1.json @@ -262,7 +262,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "target": { @@ -284,7 +285,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target1", "subbands": [ @@ -416,7 +418,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target2", "subbands": [ @@ -548,7 +551,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target3", "subbands": [ diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/LoTSS_Observing_strategy-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/LoTSS_Observing_strategy-1.json index 941290ca24c569715c8c35503790bef1eefe480b..e52893c20ec8d91811ddaf4cbaceb1f99ada0f0d 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/LoTSS_Observing_strategy-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/LoTSS_Observing_strategy-1.json @@ -253,7 +253,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "PXXX+YY" } }, "specifications_template": { @@ -270,7 +271,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "PXXX+YY" } }, "specifications_template": { @@ -407,7 +409,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "PXXX+YY" }, "name": "sap1", "target": "target1", @@ -661,7 +664,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "PXXX+YY" }, "name": "sap2", "target": "target2", @@ -994,7 +998,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "PXXX+YY" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Pulsar_timing-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Pulsar_timing-1.json index aa9b17e843d7458588f04f270c1bb2200032e6e7..68fae2c12fce302e097b55ea1c1f7a00ee95183d 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Pulsar_timing-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Pulsar_timing-1.json @@ -175,7 +175,8 @@ "digital_pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "B0329+54", "subbands": [ @@ -579,8 +580,7 @@ 448, 449, 450 - ], - "target": "B0329+54" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -1004,7 +1004,8 @@ "pointing": { "angle1": 0, "angle2": 0, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "relative": true } @@ -1058,7 +1059,8 @@ "tile_beam": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Responsive_Telescope_HBA_LoTSS-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Responsive_Telescope_HBA_LoTSS-1.json index 9f197f338474887ced57f1542c4ab4fec24dabf5..f6d8ca5fe91f4834fe9508b6c7b8d90a2d7e31a6 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Responsive_Telescope_HBA_LoTSS-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Responsive_Telescope_HBA_LoTSS-1.json @@ -6,909 +6,581 @@ "version": 1 }, "template": { - "parameters": [ - { - "name": "Scheduling Constraints", - "refs": [ - "#/scheduling_constraints_doc" - ] - }, - { - "name": "Target 1 Name", - "refs": [ - "#/tasks/Target Observation/specifications_doc/SAPs/0/name" - ] - }, - { - "name": "Target Pointing 1", - "refs": [ - "#/tasks/Target Observation/specifications_doc/SAPs/0/digital_pointing" - ] - }, - { - "name": "Target 2 Name", - "refs": [ - "#/tasks/Target Observation/specifications_doc/SAPs/1/name" - ] - }, - { - "name": "Target Pointing 2", - "refs": [ - "#/tasks/Target Observation/specifications_doc/SAPs/1/digital_pointing" - ] - }, - { - "name": "Tile Beam", - "refs": [ - "#/tasks/Target Observation/specifications_doc/tile_beam" - ] - }, - { - "name": "Target Duration", - "refs": [ - "#/tasks/Target Observation/specifications_doc/duration" - ] - }, - { - "name": "Calibrator Name", - "refs": [ - "#/tasks/Calibrator Observation/specifications_doc/name" - ] - }, - { - "name": "Calibrator Pointing", - "refs": [ - "#/tasks/Calibrator Observation/specifications_doc/pointing" - ] - } - ], - "scheduling_constraints_doc": { - "sky": { - "transit_offset": { - "from": -1440, - "to": 1440 - } - } + "description": "This observation strategy template defines a similar observation strategy as for LoTSS, but then with a single Calibrator at the end so that the Target Observation can start immediately once the trigger is submitted.", + "name": "Responsive Telescope HBA LoTSS", + "scheduling_unit_template": { + "name": "scheduling unit", + "version": 1 }, - "scheduling_constraints_template": {"name": "constraints"}, - "task_relations": [ - { - "consumer": "Calibrator Pipeline", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" - }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "correlator" - }, - "producer": "Calibrator Observation", - "selection_doc": {}, - "selection_template": "all", - "tags": [] - }, - { - "consumer": "Pipeline target1", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" - }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "correlator" - }, - "producer": "Target Observation", - "selection_doc": { - "sap": [ - "sap1" + "template": { + "parameters": [ + { + "name": "Scheduling Constraints", + "refs": [ + "#/scheduling_constraints_doc/time" ] }, - "selection_template": "SAP", - "tags": [] - }, - { - "consumer": "Pipeline target2", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" - }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "correlator" - }, - "producer": "Target Observation", - "selection_doc": { - "sap": [ - "sap2" + { + "name": "Target Name", + "refs": [ + "#/tasks/Target Observation/specifications_doc/SAPs/0/name" ] }, - "selection_template": "SAP", - "tags": [] - }, - { - "consumer": "Ingest", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Target Pointing", + "refs": [ + "#/tasks/Target Observation/specifications_doc/SAPs/0/digital_pointing" + ] }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Subbands", + "refs": [ + "#/tasks/Target Observation/specifications_doc/SAPs/0/subbands" + ] }, - "producer": "Calibrator Pipeline", - "selection_doc": {}, - "selection_template": "all", - "tags": [] - }, - { - "consumer": "Ingest", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Tile Beam", + "refs": [ + "#/tasks/Target Observation/specifications_doc/tile_beam" + ] }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Target Duration", + "refs": [ + "#/tasks/Target Observation/specifications_doc/duration" + ] }, - "producer": "Pipeline target1", - "selection_doc": {}, - "selection_template": "all", - "tags": [] - }, - { - "consumer": "Ingest", - "input": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Calibrator Name", + "refs": [ + "#/tasks/Calibrator Observation 2/specifications_doc/name" + ] }, - "output": { - "dataformat": "MeasurementSet", - "datatype": "visibilities", - "role": "any" + { + "name": "Calibrator Pointing", + "refs": [ + "#/tasks/Calibrator Observation 2/specifications_doc/pointing" + ] }, - "producer": "Pipeline target2", - "selection_doc": {}, - "selection_template": "all", - "tags": [] - } - ], - "task_scheduling_relations": [ - { - "first": "Calibrator Observation", - "placement": "after", - "second": "Target Observation", - "time_offset": 60 - } - ], - "tasks": { - "Calibrator Observation": { - "description": "Calibrator Observation", - "specifications_doc": { - "autoselect": false, - "duration": 600, - "name": "calibrator", - "pointing": { - "angle1": 0.6624317181687094, - "angle2": 1.5579526427549426, - "direction_type": "J2000" + { + "name": "Calibrator Duration", + "refs": [ + "#/tasks/Calibrator Observation 2/specifications_doc/duration" + ] + } + ], + "scheduling_constraints_doc": { + "sky": { + "transit_offset": { + "from": -86400, + "to": 86400 } }, - "specifications_template": { - "name": "calibrator observation" - }, - "tags": [] + "time": { + "between": [] + } }, - "Calibrator Pipeline": { - "description": "Preprocessing Pipeline for Calibrator Observation", - "specifications_doc": { - "average": { - "frequency_steps": 4, - "time_steps": 1 - }, - "demix": { - "frequency_steps": 64, - "ignore_target": false, - "sources": [], - "time_steps": 10 + "scheduling_constraints_template": "constraints", + "task_relations": [ + { + "consumer": "Calibrator Pipeline", + "input": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" }, - "flag": { - "autocorrelations": true, - "outerchannels": true, - "rfi_strategy": "HBAdefault" + "output": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "correlator" }, - "storagemanager": "dysco" + "producer": "Calibrator Observation", + "selection_doc": {}, + "selection_template": "all", + "tags": [] }, - "specifications_template": { - "name": "preprocessing pipeline" - }, - "tags": [] - }, - "Ingest": { - "description": "Ingest all preprocessed dataproducts", - "specifications_doc": {}, - "specifications_template": { - "name": "ingest" - }, - "tags": [] - }, - "Pipeline target1": { - "description": "Preprocessing Pipeline for Target Observation target1, SAP000", - "specifications_doc": { - "average": { - "frequency_steps": 4, - "time_steps": 1 + { + "consumer": "Target Pipeline", + "input": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" }, - "demix": { - "frequency_steps": 64, - "ignore_target": false, - "sources": [], - "time_steps": 10 + "output": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "correlator" }, - "flag": { - "autocorrelations": true, - "outerchannels": true, - "rfi_strategy": "HBAdefault" + "producer": "Target Observation", + "selection_doc": { + "sap": [ + "target1" + ] }, - "storagemanager": "dysco" + "selection_template": "SAP", + "tags": [] }, - "specifications_template": { - "name": "preprocessing pipeline" + { + "consumer": "Ingest", + "input": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" + }, + "output": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" + }, + "producer": "Calibrator Pipeline", + "selection_doc": {}, + "selection_template": "all", + "tags": [] }, - "tags": [] - }, - "Pipeline target2": { - "description": "Preprocessing Pipeline for Target Observation target2, SAP001", - "specifications_doc": { - "average": { - "frequency_steps": 4, - "time_steps": 1 + { + "consumer": "Ingest", + "input": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" }, - "demix": { - "frequency_steps": 64, - "ignore_target": false, - "sources": [], - "time_steps": 10 + "output": { + "dataformat": "MeasurementSet", + "datatype": "visibilities", + "role": "any" }, - "flag": { - "autocorrelations": true, - "outerchannels": true, - "rfi_strategy": "HBAdefault" + "producer": "Target Pipeline", + "selection_doc": {}, + "selection_template": "all", + "tags": [] + } + ], + "task_scheduling_relations": [ + { + "first": "Calibrator Observation", + "placement": "after", + "second": "Target Observation", + "time_offset": 60 + } + ], + "tasks": { + "Calibrator Observation": { + "description": "Calibrator Observation after Target Observation", + "specifications_doc": { + "autoselect": false, + "duration": 600, + "name": "calibrator", + "pointing": { + "angle1": 0.6624317181687094, + "angle2": 1.5579526427549426, + "direction_type": "J2000", + "target": "PXXX+YY" + } }, - "storagemanager": "dysco" - }, - "specifications_template": { - "name": "preprocessing pipeline" + "specifications_template": { + "name": "calibrator observation" + }, + "tags": [] }, - "tags": [] - }, - "Target Observation": { - "description": "Target Observation for UC1 HBA scheduling unit", - "specifications_doc": { - "QA": { - "file_conversion": { - "enabled": true, - "nr_of_subbands": -1, - "nr_of_timestamps": 256 + "Calibrator Pipeline": { + "description": "Preprocessing Pipeline for Calibrator Observation", + "specifications_doc": { + "average": { + "frequency_steps": 4, + "time_steps": 1 }, - "inspection_plots": "msplots", - "plots": { - "autocorrelation": true, - "crosscorrelation": true, - "enabled": true - } + "demix": { + "frequency_steps": 64, + "ignore_target": false, + "sources": {}, + "time_steps": 10 + }, + "flag": { + "autocorrelations": true, + "outerchannels": true, + "rfi_strategy": "HBAdefault" + }, + "storagemanager": "dysco" + }, + "specifications_template": { + "name": "preprocessing pipeline" }, - "SAPs": [ - { - "digital_pointing": { - "angle1": 0.6624317181687094, - "angle2": 1.5579526427549426, - "direction_type": "J2000" + "tags": [] + }, + "Ingest": { + "description": "Ingest all preprocessed dataproducts", + "specifications_doc": {}, + "specifications_template": { + "name": "ingest" + }, + "tags": [] + }, + "Target Observation": { + "description": "Target Observation", + "specifications_doc": { + "QA": { + "file_conversion": { + "enabled": true, + "nr_of_subbands": -1, + "nr_of_timestamps": 256 }, - "name": "sap1", - "target": "target1", - "subbands": [ - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 182, - 183, - 184, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 212, - 213, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 265, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273, - 275, - 276, - 277, - 278, - 279, - 280, - 281, - 282, - 283, - 284, - 285, - 286, - 287, - 288, - 289, - 290, - 291, - 292, - 293, - 294, - 295, - 296, - 297, - 298, - 299, - 300, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 328, - 330, - 331, - 332, - 333, - 334, - 335, - 336, - 337, - 338, - 339, - 340, - 341, - 342, - 343, - 344, - 345, - 346, - 347, - 349, - 364, - 372, - 380, - 388, - 396, - 404, - 413, - 421, - 430, - 438, - 447 - ] + "inspection_plots": "msplots", + "plots": { + "autocorrelation": true, + "crosscorrelation": true, + "enabled": true + } }, - { - "digital_pointing": { - "angle1": 0.6624317181687094, - "angle2": 1.5579526427549426, - "direction_type": "J2000" - }, - "name": "sap2", - "target": "target2", - "subbands": [ - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 182, - 183, - 184, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 212, - 213, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 265, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273, - 275, - 276, - 277, - 278, - 279, - 280, - 281, - 282, - 283, - 284, - 285, - 286, - 287, - 288, - 289, - 290, - 291, - 292, - 293, - 294, - 295, - 296, - 297, - 298, - 299, - 300, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 328, - 330, - 331, - 332, - 333, - 334, - 335, - 336, - 337, - 338, - 339, - 340, - 341, - 342, - 343, - 344, - 345, - 346, - 347, - 349, - 364, - 372, - 380, - 388, - 396, - 404, - 413, - 421, - 430, - 438, - 447 - ] + "SAPs": [ + { + "digital_pointing": { + "angle1": 0.6624317181687094, + "angle2": 1.5579526427549426, + "direction_type": "J2000", + "target": "PXXX+YY" + }, + "name": "target", + "subbands": [ + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 227, + 228, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274, + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 283, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347 + ] + } + ], + "antenna_set": "HBA_DUAL_INNER", + "correlator": { + "channels_per_subband": 64, + "integration_time": 1, + "storage_cluster": "CEP4" + }, + "duration": 7200, + "filter": "HBA_110_190", + "station_groups": [ + { + "max_nr_missing": 4, + "stations": [ + "CS001", + "CS002", + "CS003", + "CS004", + "CS005", + "CS006", + "CS007", + "CS011", + "CS013", + "CS017", + "CS021", + "CS024", + "CS026", + "CS028", + "CS030", + "CS031", + "CS032", + "CS101", + "CS103", + "CS201", + "CS301", + "CS302", + "CS401", + "CS501", + "RS106", + "RS205", + "RS208", + "RS210", + "RS305", + "RS306", + "RS307", + "RS310", + "RS406", + "RS407", + "RS409", + "RS503", + "RS508", + "RS509" + ] + } + ], + "tile_beam": { + "angle1": 0.6624317181687094, + "angle2": 1.5579526427549426, + "direction_type": "J2000", + "target": "PXXX+YY" } - ], - "antenna_set": "HBA_DUAL_INNER", - "correlator": { - "channels_per_subband": 64, - "integration_time": 1, - "storage_cluster": "CEP4" }, - "duration": 28800, - "filter": "HBA_110_190", - "station_groups": [ - { - "max_nr_missing": 4, - "stations": [ - "CS001", - "CS002", - "CS003", - "CS004", - "CS005", - "CS006", - "CS007", - "CS011", - "CS013", - "CS017", - "CS021", - "CS024", - "CS026", - "CS028", - "CS030", - "CS031", - "CS032", - "CS101", - "CS103", - "CS201", - "CS301", - "CS302", - "CS401", - "CS501", - "RS106", - "RS205", - "RS208", - "RS210", - "RS305", - "RS306", - "RS307", - "RS310", - "RS406", - "RS407", - "RS409", - "RS503", - "RS508", - "RS509" - ] + "specifications_template": { + "name": "target observation" + }, + "tags": [] + }, + "Target Pipeline": { + "description": "Preprocessing Pipeline for Target Observation", + "specifications_doc": { + "average": { + "frequency_steps": 4, + "time_steps": 1 }, - { - "max_nr_missing": 2, - "stations": [ - "DE601", - "DE602", - "DE603", - "DE604", - "DE605", - "DE609", - "FR606", - "SE607", - "UK608", - "PL610", - "PL611", - "PL612", - "IE613", - "LV614" - ] + "demix": { + "frequency_steps": 64, + "ignore_target": false, + "sources": {}, + "time_steps": 10 }, - { - "max_nr_missing": 1, - "stations": [ - "DE601", - "DE605" - ] - } - ], - "tile_beam": { - "angle1": 0.6624317181687094, - "angle2": 1.5579526427549426, - "direction_type": "J2000" - } - }, - "specifications_template": { - "name": "target observation" - }, - "tags": [] + "flag": { + "autocorrelations": true, + "outerchannels": true, + "rfi_strategy": "HBAdefault" + }, + "storagemanager": "dysco" + }, + "specifications_template": { + "name": "preprocessing pipeline" + }, + "tags": [] + } } - } + }, + "version": 1 }, "version": 1 -} +} \ No newline at end of file diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Beamformed_Observation_-_Pipeline_-_Ingest-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Beamformed_Observation_-_Pipeline_-_Ingest-1.json index 51d43487a61df42f15f4759995572c336bb185ba..d53b74058e780fce0b7be941b4b54cd40f8ca97e 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Beamformed_Observation_-_Pipeline_-_Ingest-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Beamformed_Observation_-_Pipeline_-_Ingest-1.json @@ -169,7 +169,8 @@ "digital_pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "B0329+54", "subbands": [ @@ -417,8 +418,7 @@ 241, 242, 243 - ], - "target": "B0329+54" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -686,7 +686,8 @@ "pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "relative": false } @@ -770,7 +771,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Observation_-_Pipeline_-_Ingest-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Observation_-_Pipeline_-_Ingest-1.json index da6f21773f8dbb344b6cb52432059f4ca47d97e2..b5944434f9319866a5e85b91d3783f49354ac701 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Observation_-_Pipeline_-_Ingest-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Short_Test_Observation_-_Pipeline_-_Ingest-1.json @@ -156,7 +156,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "Polaris", "subbands": [ @@ -404,8 +405,7 @@ 241, 242, 243 - ], - "target": "Polaris" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -432,7 +432,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Beamforming_Observation-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Beamforming_Observation-1.json index 407365017d8e4c3a333abbc6d3aba6bf36ec3445..076df3484822a3b3cc3aea1d07b69fd87e6e08c8 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Beamforming_Observation-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Beamforming_Observation-1.json @@ -64,7 +64,8 @@ "digital_pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "B0329+54", "subbands": [ @@ -312,8 +313,7 @@ 241, 242, 243 - ], - "target": "B0329+54" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -581,7 +581,8 @@ "pointing": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "relative": false } @@ -665,7 +666,8 @@ "tile_beam": { "angle1": 0.92934186635, "angle2": 0.952579228492, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Observation-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Observation-1.json index 53c568841b497a3869934c9153bfa2c9dee624f4..6e642e1661f287463fa5f34f99318b27352e67f7 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Observation-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/Simple_Observation-1.json @@ -71,7 +71,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "Polaris", "subbands": [ @@ -319,8 +320,7 @@ 241, 242, 243 - ], - "target": "Polaris" + ] } ], "antenna_set": "HBA_DUAL_INNER", @@ -347,7 +347,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/UC1_CTC+pipelines-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/UC1_CTC+pipelines-1.json index 07281c19862872a55ee4f507190ff87758ff25c6..80204cefd32db9c39033c8f69754db8af1513bb2 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/UC1_CTC+pipelines-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/scheduling_unit_observing_strategy_template/UC1_CTC+pipelines-1.json @@ -211,7 +211,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { @@ -228,7 +229,8 @@ "pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { @@ -365,7 +367,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target1", "subbands": [ @@ -619,7 +622,8 @@ "digital_pointing": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" }, "name": "target2", "subbands": [ @@ -952,7 +956,8 @@ "tile_beam": { "angle1": 0.6624317181687094, "angle2": 1.5579526427549426, - "direction_type": "J2000" + "direction_type": "J2000", + "target": "target1" } }, "specifications_template": { diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-1.json index 2b4596171b2338e0d748eeb720bd6fb95fadfaf1..fa47823f4df2cbb9d1848d5b3f8b157c1735d2c6 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-1.json +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template/observation/observation_control-1.json @@ -313,13 +313,6 @@ }, "title": "Subband list", "type": "array" - }, - "target": { - "default": "_target_name_", - "description": "Name of the target", - "minLength": 1, - "title": "Target", - "type": "string" } }, "required": [ diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/serializers/specification.py b/SAS/TMSS/backend/src/tmss/tmssapp/serializers/specification.py index 4967b7fca4bdbbe5794f827f5d3d784ea16fd91d..d08254939dcb3a0acc09173a8d376aeb3570726a 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/serializers/specification.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/serializers/specification.py @@ -249,7 +249,10 @@ class SchedulingUnitBlueprintSerializer(DynamicRelationalHyperlinkedModelSeriali model = models.SchedulingUnitBlueprint fields = '__all__' read_only_fields = ['interrupts_telescope'] - extra_fields = ['task_blueprints', 'duration', 'start_time', 'stop_time', 'status', 'observed_end_time', 'output_pinned'] + extra_fields = ['task_blueprints', 'duration', 'status', 'observed_end_time', 'output_pinned', + 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', + 'scheduled_on_sky_start_time', 'scheduled_on_sky_stop_time', 'scheduled_process_start_time', 'scheduled_process_stop_time', + 'actual_on_sky_start_time', 'actual_on_sky_stop_time', 'actual_process_start_time', 'actual_process_stop_time'] expandable_fields = { 'specifications_template': 'lofar.sas.tmss.tmss.tmssapp.serializers.SchedulingUnitTemplateSerializer', 'draft': 'lofar.sas.tmss.tmss.tmssapp.serializers.SchedulingUnitDraftSerializer', @@ -290,8 +293,10 @@ class TaskBlueprintSerializer(DynamicRelationalHyperlinkedModelSerializer): model = models.TaskBlueprint fields = '__all__' extra_fields = ['subtasks', 'produced_by', 'consumed_by', 'first_scheduling_relation', 'second_scheduling_relation', 'duration', - 'start_time', 'stop_time', 'relative_start_time', 'relative_stop_time', 'status', 'task_type', - 'obsolete_since'] + 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', + 'scheduled_on_sky_start_time', 'scheduled_on_sky_stop_time', 'scheduled_process_start_time', 'scheduled_process_stop_time', + 'actual_on_sky_start_time', 'actual_on_sky_stop_time', 'actual_process_start_time', 'actual_process_stop_time', + 'relative_start_time', 'relative_stop_time', 'status', 'task_type', 'obsolete_since'] expandable_fields = { 'draft': 'lofar.sas.tmss.tmss.tmssapp.serializers.TaskDraftSerializer', 'scheduling_unit_blueprint': 'lofar.sas.tmss.tmss.tmssapp.serializers.SchedulingUnitBlueprintSerializer', diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py index 2d230fd4e14c42f44bef0df1e8b0d98d8b922585..49dfeb026d3084b06810aed0f716de5511e8a81c 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py @@ -111,11 +111,13 @@ def _filter_subbands(obs_subbands: list, selection: dict) -> [int]: raise SubtaskCreationException('Did not get a valid subband selection: got %s' % selection["method"]) -def _add_pointings(pointing_a, pointing_b): +def _add_pointings(pointing_a, pointing_b, target=None): if pointing_a['direction_type'] != pointing_b['direction_type']: raise SubtaskCreationException( "Cannot add pointings because direction types differ pointing_a=%s; pointing_b=%s" % (pointing_a, pointing_b)) - pointing = {"direction_type": pointing_a['direction_type']} + if target is None: + target = pointing_a["target"] if pointing_a["target"] == pointing_b["target"] else "%s_+_%s" % (pointing_a["target"], pointing_b["target"]) + pointing = {"direction_type": pointing_a['direction_type'], "target": target} for angle in ['angle1', 'angle2']: pointing[angle] = pointing_a.get(angle, 0.0) + pointing_b.get(angle, 0.0) return pointing @@ -133,10 +135,16 @@ def _generate_tab_ring_pointings(pointing, tab_rings) -> [dict]: width=tab_rings['width'], center=(pointing['angle1'], pointing['angle2']), dirtype=pointing['direction_type']).coordinates() - relative_pointings = [{'angle1': angle1, 'angle2': angle2, 'direction_type': pointing['direction_type']} for angle1, angle2 in coordinates] # add ring coordinates to main pointing to get absolute TAB pointings and return them - tab_pointings = [_add_pointings(pointing, relative_pointing) for relative_pointing in relative_pointings] + tab_pointings = [] + tab_nr = 0 + for angle1, angle2 in coordinates: + target = "TAB %s around %s" % (tab_nr, pointing.get('target', "(%s,%s)" % (pointing['angle1'], pointing['angle2']))) + relative_pointing = {'angle1': angle1, 'angle2': angle2, 'direction_type': pointing['direction_type'], 'target': target} + tab_pointings.append(_add_pointings(pointing, relative_pointing, target=target)) + tab_nr += 1 + return tab_pointings @@ -434,17 +442,18 @@ def create_observation_subtask_specifications_from_observation_task_blueprint(ta for sap in target_task_spec.get("SAPs", []): subtask_spec['stations']['digital_pointings'].append( {"name": sap["name"], - "target": sap["target"], "pointing": {"direction_type": sap["digital_pointing"]["direction_type"], "angle1": sap["digital_pointing"]["angle1"], - "angle2": sap["digital_pointing"]["angle2"]}, + "angle2": sap["digital_pointing"]["angle2"], + "target": sap["digital_pointing"]["target"]}, "subbands": sap["subbands"] }) if "tile_beam" in target_task_spec: subtask_spec['stations']['analog_pointing'] = { "direction_type": target_task_spec["tile_beam"]["direction_type"], "angle1": target_task_spec["tile_beam"]["angle1"], - "angle2": target_task_spec["tile_beam"]["angle2"] } + "angle2": target_task_spec["tile_beam"]["angle2"], + "target": target_task_spec["tile_beam"]["target"]} @@ -464,7 +473,8 @@ def create_observation_subtask_specifications_from_observation_task_blueprint(ta subtask_spec['stations']['analog_pointing'] = { "direction_type": target_task_spec["tile_beam"]["direction_type"], "angle1": target_task_spec["tile_beam"]["angle1"], - "angle2": target_task_spec["tile_beam"]["angle2"]} + "angle2": target_task_spec["tile_beam"]["angle2"], + "target": target_task_spec["tile_beam"]["target"]} else: raise SubtaskCreationException("Cannot determine the pointing specification from task_blueprint " "id=%s in auto-select mode, because the related target observation " @@ -473,7 +483,8 @@ def create_observation_subtask_specifications_from_observation_task_blueprint(ta else: subtask_spec['stations']['analog_pointing'] = {"direction_type": calibrator_task_spec["pointing"]["direction_type"], "angle1": calibrator_task_spec["pointing"]["angle1"], - "angle2": calibrator_task_spec["pointing"]["angle2"]} + "angle2": calibrator_task_spec["pointing"]["angle2"], + "target": calibrator_task_spec["pointing"]["target"]} # for the calibrator, the subbands are the union of the subbands of the targetobs subbands = [] diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py b/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py index 39c94d4d7396d925f161542ee452ed7d7cf6d0e0..83659ccdce36ce1e110fa9f60c155aa3ce0d8f3b 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/viewsets/specification.py @@ -840,8 +840,18 @@ class ModelChoiceInFilter(filters.BaseInFilter, filters.ModelChoiceFilter): pass class SchedulingUnitBlueprintPropertyFilter(property_filters.PropertyFilterSet): - start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='start_time') - stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='stop_time') + on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='on_sky_start_time') + on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='on_sky_stop_time') + process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='process_start_time') + process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='process_stop_time') + scheduled_on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_on_sky_start_time') + scheduled_on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_on_sky_stop_time') + scheduled_process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_process_start_time') + scheduled_process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_process_stop_time') + actual_on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_on_sky_start_time') + actual_on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_on_sky_stop_time') + actual_process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_process_start_time') + actual_process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_process_stop_time') project = property_filters.PropertyCharFilter(field_name='project', lookup_expr='icontains') status = property_filters.PropertyMultipleChoiceFilter(field_name='status', choices=tuple((i.value, i.value) for i in models.SchedulingUnitBlueprint.Status), lookup_expr='iexact') priority_rank = filters.RangeFilter(field_name='priority_rank') @@ -1209,8 +1219,18 @@ class TaskBlueprintPropertyFilter(property_filters.PropertyFilterSet): relative_start_time_max = property_filters.PropertyDurationFilter(field_name='relative_start_time', lookup_expr='lte') relative_stop_time_min = property_filters.PropertyDurationFilter(field_name='relative_stop_time', lookup_expr='gte') relative_stop_time_max = property_filters.PropertyDurationFilter(field_name='relative_stop_time', lookup_expr='lte') - start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='start_time') - stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='stop_time') + on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='on_sky_start_time') + on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='on_sky_stop_time') + process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='process_start_time') + process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='process_stop_time') + scheduled_on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_on_sky_start_time') + scheduled_on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_on_sky_stop_time') + scheduled_process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_process_start_time') + scheduled_process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='scheduled_process_stop_time') + actual_on_sky_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_on_sky_start_time') + actual_on_sky_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_on_sky_stop_time') + actual_process_start_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_process_start_time') + actual_process_stop_time = property_filters.PropertyIsoDateTimeFromToRangeFilter(field_name='actual_process_stop_time') status = property_filters.PropertyMultipleChoiceFilter(field_name='status', choices=tuple((i.value, i.value) for i in models.TaskBlueprint.Status), lookup_expr='iexact') subtasks = filters.ModelMultipleChoiceFilter(field_name='subtasks', queryset=models.Subtask.objects.all()) subtasks_min = filters.NumberFilter(field_name='subtasks__id', lookup_expr='gte') diff --git a/SAS/TMSS/backend/test/t_adapter.py b/SAS/TMSS/backend/test/t_adapter.py index c8305051142f72e537a4694cf6d7223943b98682..0bdb68bde7ee6645e2948acdd7316182b5d368a7 100755 --- a/SAS/TMSS/backend/test/t_adapter.py +++ b/SAS/TMSS/backend/test/t_adapter.py @@ -191,7 +191,7 @@ class ObservationParsetAdapterTest(unittest.TestCase): "tabs": [ { "coherent": True, - "pointing": { "angle1": 1.0, "angle2": 2.0 } + "pointing": { "angle1": 1.0, "angle2": 2.0, "target": "target1" } }, { "coherent": False @@ -264,7 +264,7 @@ class SIPadapterTest(unittest.TestCase): specifications_doc['stations']['filter'] = "HBA_210_250" feedback_template = models.DataproductFeedbackTemplate.objects.get(name='feedback') # feedback_doc = get_default_json_object_for_schema(feedback_template.schema) # todo <- fix the default generator, for some reason it does not produce valid json here... - feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000'}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} + feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000', "target": "target1"}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} for dp in specifications_doc['stations']['digital_pointings']: dp['subbands'] = list(range(8)) # Create SubTask(output) @@ -310,7 +310,7 @@ class SIPadapterTest(unittest.TestCase): specifications_doc['stations']['filter'] = "HBA_210_250" feedback_template = models.DataproductFeedbackTemplate.objects.get(name='feedback') # feedback_doc = get_default_json_object_for_schema(feedback_template.schema) # todo <- fix the default generator, for some reason it does not produce valid json here... - feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000'}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} + feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000', "target": "target1"}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} for dp in specifications_doc['stations']['digital_pointings']: dp['subbands'] = list(range(8)) # Create SubTask(output) @@ -378,7 +378,7 @@ class SIPadapterTest(unittest.TestCase): specifications_doc['stations']['filter'] = "HBA_110_190" feedback_template = models.DataproductFeedbackTemplate.objects.get(name='feedback') # feedback_doc = get_default_json_object_for_schema(feedback_template.schema) # todo <- fix the default generator, for some reason it does not produce valid json here... - feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [152], 'central_frequencies': [33593750.0], 'channel_width': 3051.7578125, 'channels_per_subband': 64}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000'}, 'coherent': True}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, 'files': ['stokes/SAP0/CS003HBA1/L773569_SAP000_B005_S0_P000_bf.h5', 'stokes/SAP0/RS106HBA/L773569_SAP000_B046_S0_P000_bf.h5'], '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} + feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [152], 'central_frequencies': [33593750.0], 'channel_width': 3051.7578125, 'channels_per_subband': 64}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000', "target": "target1"}, 'coherent': True}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, 'files': ['stokes/SAP0/CS003HBA1/L773569_SAP000_B005_S0_P000_bf.h5', 'stokes/SAP0/RS106HBA/L773569_SAP000_B046_S0_P000_bf.h5'], '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} for dp in specifications_doc['stations']['digital_pointings']: dp['subbands'] = list(range(8)) # Create SubTask(output) diff --git a/SAS/TMSS/backend/test/t_feedback.py b/SAS/TMSS/backend/test/t_feedback.py index 8988b780c7417a3a9793a5bac0fc2207ee27da6f..ea02f7f95e1b88b5a4d1028700384ef6ee00cbd9 100755 --- a/SAS/TMSS/backend/test/t_feedback.py +++ b/SAS/TMSS/backend/test/t_feedback.py @@ -364,6 +364,9 @@ feedback_version=03.01.00 "samples": { "type": "float", "bits": 32, + }, + "target": { + 'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000', 'target': 'target1'} } } @@ -409,7 +412,7 @@ feedback_version=03.01.00 "bits": 32, }, "target": { - 'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000'} + 'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000', 'target': 'target1'} }, } diff --git a/SAS/TMSS/backend/test/t_scheduling.py b/SAS/TMSS/backend/test/t_scheduling.py index d44d0ea3804d1dd7ea5b342b27a20d7fdb5faee5..5eb4cf931e611665e9f6ce3e88cade3d38609e02 100755 --- a/SAS/TMSS/backend/test/t_scheduling.py +++ b/SAS/TMSS/backend/test/t_scheduling.py @@ -839,7 +839,7 @@ class SAPTest(unittest.TestCase): spec['stations']['digital_pointings'][0]['name'] = task_blueprint_data['specifications_doc']['SAPs'][0]['name'] spec['stations']['digital_pointings'][0]['subbands'] = [0] cluster_url = client.get_path_as_json_object('/cluster/1')['url'] - pointing = {"angle1": 7.6, "angle2": 5.4, "direction_type": "J2000"} + pointing = {"angle1": 7.6, "angle2": 5.4, "direction_type": "J2000", "target": "target1"} spec['stations']['digital_pointings'][0]['pointing'] = pointing subtask_data = test_data_creator.Subtask(specifications_template_url=subtask_template['url'], diff --git a/SAS/TMSS/backend/test/t_subtasks.py b/SAS/TMSS/backend/test/t_subtasks.py index 53d98a77b916deb19018831a5d3295c2fdf7a645..7f59d4fc4d911b06e9924b7d589b1d83bd541e15 100755 --- a/SAS/TMSS/backend/test/t_subtasks.py +++ b/SAS/TMSS/backend/test/t_subtasks.py @@ -231,12 +231,14 @@ class SubTasksCreationFromTaskBluePrint(unittest.TestCase): def test_create_subtasks_from_task_blueprint_translates_SAP_names(self): task_blueprint = create_task_blueprint_object_for_testing('target observation') - task_blueprint.specifications_doc['SAPs'] = [{'name': 'target1', 'target': 'target1', 'subbands': [], + task_blueprint.specifications_doc['SAPs'] = [{'name': 'target1', 'subbands': [], 'digital_pointing': {'angle1': 0.1, 'angle2': 0.1, - 'direction_type': 'J2000'}}, - {'name': 'target2', 'target': 'target2', 'subbands': [], + 'direction_type': 'J2000', + 'target': 'target1'}}, + {'name': 'target2', 'subbands': [], 'digital_pointing': {'angle1': 0.2, 'angle2': 0.2, - 'direction_type': 'J2000'}}] + 'direction_type': 'J2000', + 'target': 'target2'}}] subtask = create_observation_control_subtask_from_task_blueprint(task_blueprint) i = 0 for sap in task_blueprint.specifications_doc['SAPs']: @@ -345,12 +347,14 @@ class SubTasksCreationFromTaskBluePrintCalibrator(unittest.TestCase): target_task_blueprint = create_task_blueprint_object_for_testing() create_scheduling_relation_task_blueprint_for_testing(cal_task_blueprint, target_task_blueprint, placement='parallel') - target_task_blueprint.specifications_doc['SAPs'] = [{'name': 'target1', 'target': '', 'subbands': list(range(0, 150)), + target_task_blueprint.specifications_doc['SAPs'] = [{'name': 'target1', 'subbands': list(range(0, 150)), 'digital_pointing': {'angle1': 0.1, 'angle2': 0.1, - 'direction_type': 'J2000'}}, - {'name': 'target2', 'target': '', 'subbands': list(range(150, 300)), + 'direction_type': 'J2000', + 'target': 'target1'}}, + {'name': 'target2', 'subbands': list(range(150, 300)), 'digital_pointing': {'angle1': 0.2, 'angle2': 0.2, - 'direction_type': 'J2000'}}] + 'direction_type': 'J2000', + 'target': 'target2'}}] target_task_blueprint.save() with self.assertRaises(SubtaskCreationException) as cm: @@ -547,24 +551,24 @@ class SettingTest(unittest.TestCase): class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): - saps = [{"name": "target1", "target": "target1", "subbands": [349, 372], - "digital_pointing": {"angle1": 0.24, "angle2": 0.25, "direction_type": "J2000"}}, - {"name": "target2", "target": "target2", "subbands": [309, 302], - "digital_pointing": {"angle1": 0.42, "angle2": 0.52, "direction_type": "J2000"}} + saps = [{"name": "target1", "subbands": [349, 372], + "digital_pointing": {"angle1": 0.24, "angle2": 0.25, "direction_type": "J2000", "target": "target1"}}, + {"name": "target2", "subbands": [309, 302], + "digital_pointing": {"angle1": 0.42, "angle2": 0.52, "direction_type": "J2000", "target": "target2"}} ] beamformers = [{"name": "beamformer1", "coherent": {"settings": {"stokes": "I", "time_integration_factor": 8, "subbands_per_file": 244, "channels_per_subband": 8 }, "SAPs": [{"name": "target1", "tabs": [{"relative": True, - "pointing": {"direction_type": "J2000", "angle1": 0.1, "angle2": 0.1}}, - {"relative": False, "pointing": {"direction_type": "J2000", "angle1": 0.2, "angle2": 0.2}}], + "pointing": {"direction_type": "J2000", "angle1": 0.1, "angle2": 0.1, "target": "target1"}}, + {"relative": False, "pointing": {"direction_type": "J2000", "angle1": 0.2, "angle2": 0.2, "target": "target1"}}], "tab_rings": {"count": 8, "width": 0.02}, "subbands": {"method": "copy"}}, {"name": "target2", "tabs": [{"relative": True, - "pointing": {"direction_type": "J2000", "angle1": 0.1, "angle2": 0.1}}, - {"relative": False, "pointing": {"direction_type": "J2000", "angle1": 0.2, "angle2": 0.2}}], + "pointing": {"direction_type": "J2000", "angle1": 0.1, "angle2": 0.1, "target": "target2"}}, + {"relative": False, "pointing": {"direction_type": "J2000", "angle1": 0.2, "angle2": 0.2, "target": "target2"}}], "tab_rings": {"count": 7, "width": 0.03}, "subbands": {"list":[10,20,30], "method": "copy"} }]}, @@ -657,12 +661,14 @@ class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): def test_generate_tab_ring_pointings_returns_correct_pointings(self): - pointing = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000"} + pointing = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000", "target": "target1"} tab_rings = {"width": 1, "count": 1} # assert center pointing is returned tab_pointings = _generate_tab_ring_pointings(pointing, tab_rings) - self.assertIn(pointing, tab_pointings) + expected_pointing = pointing.copy() + expected_pointing.update({'target': 'TAB 0 around target1'}) + self.assertIn(expected_pointing, tab_pointings) # assert correct number of pointings is returned self.assertEqual(len(tab_pointings), 1+6) # center + 1 ring @@ -673,15 +679,16 @@ class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): # assert width is considered tab_rings.update({'width': 42}) tab_pointings = _generate_tab_ring_pointings(pointing, tab_rings) - pointing.update({'angle2': pointing['angle2']+tab_rings['width']}) + expected_pointing = pointing.copy() + pointing.update({'angle2': pointing['angle2']+tab_rings['width'], 'target': 'TAB 1 around target1'}) self.assertIn(pointing, tab_pointings) def test_add_pointings_adds_correctly(self): - pointing_a = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000"} - pointing_b = {"angle1": 0.88, "angle2": 0.66, "direction_type": "J2000"} + pointing_a = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000", "target": "target_a"} + pointing_b = {"angle1": 0.88, "angle2": 0.66, "direction_type": "J2000", "target": "target_b"} pointing_sum = _add_pointings(pointing_a, pointing_b) - self.assertEqual(pointing_sum, {"angle1": 0.99, "angle2": 0.88, "direction_type": "J2000"}) + self.assertEqual(pointing_sum, {"angle1": 0.99, "angle2": 0.88, "direction_type": "J2000", "target": "target_a_+_target_b"}) def test_filter_subbands_filters_correctly(self): subbands = [1,3,4,5,10,11,12,13,19,20] diff --git a/SAS/TMSS/backend/test/t_tmssapp_specification_REST_API.py b/SAS/TMSS/backend/test/t_tmssapp_specification_REST_API.py index 25c551a93e78f7b378dd53c666b088c9d06c04ce..423c148756a1c3a025b31c4fba1edce594ea1a91 100755 --- a/SAS/TMSS/backend/test/t_tmssapp_specification_REST_API.py +++ b/SAS/TMSS/backend/test/t_tmssapp_specification_REST_API.py @@ -1960,8 +1960,8 @@ class SchedulingUnitBlueprintTestCase(unittest.TestCase): subtask_2 = models.Subtask.objects.create(**Subtask_test_data(scheduled_on_sky_start_time=datetime(2050, 1, 5, 10, 0, 0), scheduled_on_sky_stop_time=datetime(2050, 1, 5, 14, 0, 0), task_blueprint=models.TaskBlueprint.objects.create(**TaskBlueprint_test_data()))) # assert - response_1 = GET_and_assert_equal_expected_code(self, BASE_URL + '/scheduling_unit_blueprint/?start_time_after=2050-01-01T9:00:00&stop_time_before=2050-01-01T15:00:00', 200) - response_2 = GET_and_assert_equal_expected_code(self, BASE_URL + '/scheduling_unit_blueprint/?start_time_after=2050-01-01T9:00:00&stop_time_before=2050-01-05T15:00:00', 200) + response_1 = GET_and_assert_equal_expected_code(self, BASE_URL + '/scheduling_unit_blueprint/?scheduled_on_sky_start_time_after=2050-01-01T9:00:00&scheduled_on_sky_stop_time_before=2050-01-01T15:00:00', 200) + response_2 = GET_and_assert_equal_expected_code(self, BASE_URL + '/scheduling_unit_blueprint/?scheduled_on_sky_start_time_after=2050-01-01T9:00:00&scheduled_on_sky_stop_time_before=2050-01-05T15:00:00', 200) self.assertEqual(response_1['count'], 1) self.assertEqual(response_2['count'], 2) diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js index a9bd822854a2a0899fa51477c09df4873bc2bea2..e24af0a09d3c76465b94d5fef8a7aadb3a704204 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/ViewTable.js @@ -1157,8 +1157,10 @@ function dateFilterFn(rows, id, filterValue) { function dateRangeFilterFn(rows, id, filterValue) { const filteredRows = _.filter(rows, function (row) { // If cell value is null or empty - if (!row.values[id]) { + if (filterValue.length>0 && !row.values[id]) { return false; + } else if (!row.values[id]) { + return true; } //Remove microsecond if value passed is UTC string in format "YYYY-MM-DDTHH:mm:ss.sssss" let rowValue = moment.utc(row.values[id].split('.')[0]); @@ -2107,7 +2109,7 @@ function Table(props) { ); // console.log('columns List', visibleColumns.map((d) => d.id)); const storedColOrder = UtilService.localStore({ type: 'get', key: tablename+'colOrder'}); - if (storedColOrder) { + if (!_.isEmpty(storedColOrder)) { setColumnOrder(storedColOrder) } else if (columnOrders && columnOrders.length) { diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js index 67c3ead44cf98cddac8ebeaad7289f94d46fc49f..06733143f938be78f8ce1357145dc194b6a7fbaa 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.js @@ -42,7 +42,10 @@ export class ProjectCreate extends Component { priority_rank: '', quota: [], // Mandatory Field in the back end, so an empty array is passed can_trigger: false, - auto_pin: false + auto_pin: false, + auto_ingest: false, + piggyback_allowed_tbb: false, + piggyback_allowed_aartfaac: false }, projectQuota: {}, // Resource Allocations validFields: {}, // For Validation @@ -408,7 +411,10 @@ export class ProjectCreate extends Component { priority_rank: 0, quota: [], archive_location: null, - archive_subdirectory:"" + archive_subdirectory:"", + auto_ingest: false, + piggyback_allowed_tbb: false, + piggyback_allowed_aartfaac: false }, projectQuota: projectQuota, validFields: {}, @@ -536,18 +542,18 @@ export class ProjectCreate extends Component { {this.state.errors.priority_rank ? this.state.errors.priority_rank : ""} </label> </div> - </div> - <div className="p-field p-grid"> + </div> + <div className="p-field p-grid"> <label htmlFor="ltaStorage" className="col-lg-2 col-md-2 col-sm-12">LTA Storage Location</label> - <div className="col-lg-3 col-md-3 col-sm-12" > - <Dropdown inputId="ltaStore" - optionValue="url" - tooltip="LTA Storage" tooltipOptions={this.tooltipOptions} - value={this.state.project.archive_location} - options={this.state.ltaStorage} - onChange={(e) => this.setProjectParams('archive_location', e.target.value)} - placeholder="Select LTA Storage" /> - </div> + <div className="col-lg-3 col-md-3 col-sm-12" > + <Dropdown inputId="ltaStore" + optionValue="url" + tooltip="LTA Storage" tooltipOptions={this.tooltipOptions} + value={this.state.project.archive_location} + options={this.state.ltaStorage} + onChange={(e) => this.setProjectParams('archive_location', e.target.value)} + placeholder="Select LTA Storage" /> + </div> <div className="col-lg-1 col-md-1 col-sm-12"></div> <label htmlFor="preventdeletionafteringest" className="col-lg-2 col-md-2 col-sm-12">Prevent Automatic Deletion After Ingest</label> <div className="col-lg-3 col-md-3 col-sm-12" data-testid="preventdeletionafteringest"> @@ -556,8 +562,34 @@ export class ProjectCreate extends Component { tooltipOptions={this.tooltipOptions} checked={this.state.project.auto_pin} onChange={e => this.setProjectParams('auto_pin', e.target.checked)}></Checkbox> </div> + </div> + <div className="p-field p-grid"> + <label htmlFor="ingestautomatically" className="col-lg-2 col-md-2 col-sm-12">Ingest Automatically</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="ingestautomatically"> + <Checkbox inputId="ingestautomatically" role="ingestautomatically" + tooltip="Ingest Automatically" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.auto_ingest} onChange={e => this.setProjectParams('auto_ingest', e.target.checked)}></Checkbox> + </div> + <div className="col-lg-1 col-md-1 col-sm-12"></div> + <label htmlFor="allowcommensaltbb" className="col-lg-2 col-md-2 col-sm-12">Allow commensal TBB</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="allowcommensaltbb"> + <Checkbox inputId="allowcommensaltbb" role="allowcommensaltbb" + tooltip="Allow commensal TBB" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.piggyback_allowed_tbb} onChange={e => this.setProjectParams('piggyback_allowed_tbb', e.target.checked)}></Checkbox> + </div> + </div> + <div className="p-field p-grid"> + <label htmlFor="allowcommensalaartfaac" className="col-lg-2 col-md-2 col-sm-12">Allow commensal AARTFAAC</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="allowcommensalaartfaac"> + <Checkbox inputId="allowcommensalaartfaac" role="allowcommensalaartfaac" + tooltip="Allow commensal AARTFAAC" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.piggyback_allowed_aartfaac} onChange={e => this.setProjectParams('piggyback_allowed_aartfaac', e.target.checked)}></Checkbox> </div> - {this.defaultResourcesEnabled && this.state.resourceList && + </div> + {this.defaultResourcesEnabled && this.state.resourceList && <div className="p-fluid"> <div className="p-field p-grid"> <div className="col-lg-2 col-md-2 col-sm-112"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.js index 4b10311e76bb2f15b000566ff023d607a2af8884..ceee1602f77a3721ad71cf748ba8210e3b39737b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.js @@ -612,6 +612,32 @@ export class ProjectEdit extends Component { checked={this.state.project.auto_pin} onChange={e => this.setProjectParams('auto_pin', e.target.checked)}></Checkbox> </div> </div> + <div className="p-field p-grid"> + <label htmlFor="ingestautomatically" className="col-lg-2 col-md-2 col-sm-12">Ingest Automatically</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="ingestautomatically"> + <Checkbox inputId="ingestautomatically" role="ingestautomatically" + tooltip="Ingest Automatically" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.auto_ingest} onChange={e => this.setProjectParams('auto_ingest', e.target.checked)}></Checkbox> + </div> + <div className="col-lg-1 col-md-1 col-sm-12"></div> + <label htmlFor="allowcommensaltbb" className="col-lg-2 col-md-2 col-sm-12">Allow commensal TBB</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="allowcommensaltbb"> + <Checkbox inputId="allowcommensaltbb" role="allowcommensaltbb" + tooltip="Allow commensal TBB" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.piggyback_allowed_tbb} onChange={e => this.setProjectParams('piggyback_allowed_tbb', e.target.checked)}></Checkbox> + </div> + </div> + <div className="p-field p-grid"> + <label htmlFor="allowcommensalaartfaac" className="col-lg-2 col-md-2 col-sm-12">Allow commensal AARTFAAC</label> + <div className="col-lg-3 col-md-3 col-sm-12" data-testid="allowcommensalaartfaac"> + <Checkbox inputId="allowcommensalaartfaac" role="allowcommensalaartfaac" + tooltip="Allow commensal AARTFAAC" + tooltipOptions={this.tooltipOptions} + checked={this.state.project.piggyback_allowed_aartfaac} onChange={e => this.setProjectParams('piggyback_allowed_aartfaac', e.target.checked)}></Checkbox> + </div> + </div> {this.state.resourceList && <div className="p-fluid"> <div className="p-field p-grid"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js index 275c586ae65c5e263bdd03714ae9d0df788f9b85..a8185adeeffc6f27bae50220aca1ffa6f6615f48 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js @@ -49,32 +49,36 @@ export class ProjectList extends Component { name: "Cycles", filter: "select" }, - LOFAR_Observing_Time: { + 'LOFAR Observing Time': { name: "Observing time (Hrs)", filter: "range" }, - LOFAR_Observing_Time_prio_A: { + 'LOFAR Observing Time prio A': { name: "Observing time prio A (Hrs)", filter: "range" }, - LOFAR_Observing_Time_prio_B: { + 'LOFAR Observing Time prio B': { name: "Observing time prio B (Hrs)", filter: "range" }, - CEP_Processing_Time: { + 'CEP Processing Time': { name: "Processing time (Hrs)", filter: "range" }, - LTA_Storage: { + 'LTA Storage': { name: "LTA storage (TB)", filter: "range" }, - Number_of_triggers: { + 'Number of triggers': { name: "Number of Triggers", filter: "range" } }], optionalcolumns: [{ + auto_ingest: { + name: "Ingest Automatically", + filter: "switch" + }, priority_rank: { name: "Project Priority", filter: "range" @@ -116,7 +120,7 @@ export class ProjectList extends Component { }], defaultSortColumn: [{ id: "Name / Project Code", desc: false }], columnOrder: ["Action", "Name / Project Code", "Status", "Category of Project", "Description", - "LTA Storage Location", "LTA Storage Path", "Project Priority", + "LTA Storage Location", "Ingest Automatically", "Project Priority", "Trigger Priority", "Category of Period", "Cycles", "Trigger Allowed", "Observing time (Hrs)", "Observing time prio A (Hrs)", "Observing time prio B (Hrs)", "Processing time (Hrs)", "LTA storage (TB)", "Number of Triggers", @@ -159,7 +163,7 @@ export class ProjectList extends Component { if (cycleId) { projects = await CycleService.getProjectsByCycle(cycleId); } else { - projects = await ProjectService.getProjectList(); + projects = await ProjectService.getProjectList(true); } const projectArchiveLocation = await ProjectService.getAllProjectQuotaArchiveLocation(); projects = await ProjectService.getUpdatedProjectQuota(projects); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js index bdbe7240fe2b5ac85e6bb22ea6f90d36b0da1318..4bdcef1c151f358cf0b6dbfc5edd1727607a892b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js @@ -324,6 +324,14 @@ export class ProjectView extends Component { <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Prevent Automatic Deletion After Ingest</label> <span className="col-lg-4 col-md-4 col-sm-12"><i className={this.state.project.auto_pin?'fa fa-check-circle':'fa fa-times-circle'}></i></span> + <label className="col-lg-2 col-md-2 col-sm-12">Ingest Automatically</label> + <span className="col-lg-4 col-md-4 col-sm-12"><i className={this.state.project.auto_ingest?'fa fa-check-circle':'fa fa-times-circle'}></i></span> + </div> + <div className="p-grid"> + <label className="col-lg-2 col-md-2 col-sm-12">Allow commensal TBB</label> + <span className="col-lg-4 col-md-4 col-sm-12"><i className={this.state.project.piggyback_allowed_tbb?'fa fa-check-circle':'fa fa-times-circle'}></i></span> + <label className="col-lg-2 col-md-2 col-sm-12">Allow commensal AARTFAAC</label> + <span className="col-lg-4 col-md-4 col-sm-12"><i className={this.state.project.piggyback_allowed_aartfaac?'fa fa-check-circle':'fa fa-times-circle'}></i></span> </div> <div className="p-fluid"> <div className="p-field p-grid"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js index 9d081a10cc2562ee31f8a6ef4ce7089bada529c5..11256e2133f779db96941a9d0b682d6617baa41e 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -45,13 +45,23 @@ class SchedulingUnitList extends Component{ scheduling_set: {name: "Scheduling Set",}, observation_strategy_template_name: {name: "Template Name"}, observation_strategy_template_description: {name: "Template Description"}, - start_time:{ - name:"Start Time", + on_sky_start_time:{ + name:"Observation Start Time", filter:"flatpickrDateRange", format:UIConstants.CALENDAR_DATETIME_FORMAT }, - stop_time:{ - name:"End Time", + on_sky_stop_time:{ + name:"Observation End Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_start_time:{ + name:"Process Start Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_stop_time:{ + name:"Process End Time", filter:"flatpickrDateRange", format:UIConstants.CALENDAR_DATETIME_FORMAT }, @@ -95,8 +105,10 @@ class SchedulingUnitList extends Component{ "Template ID", "Template Name", "Template Description", - "Start Time", - "End Time", + "Observation Start Time", + "Observation End Time", + "Process Start Time", + "Process End Time", "Duration (HH:mm:ss)", "Prevent Autodeletion", "Stations (CS/RS/IS)", @@ -152,8 +164,10 @@ class SchedulingUnitList extends Component{ "Stations (CS/RS/IS)":"filter-input-50", "Tasks content (O/P/I)":"filter-input-50", "Number of SAPs in the target observation":"filter-input-50", - "Start Time":"filter-input-150", - "End Time":"filter-input-150", + "Observation Start Time":"filter-input-150", + "Observation End Time":"filter-input-150", + "Process Start Time":"filter-input-150", + "Process End Time":"filter-input-150", "Created_At":"filter-input-150", "Updated_At":"filter-input-150", "Template ID":"filter-input-75", @@ -369,8 +383,8 @@ class SchedulingUnitList extends Component{ * Get server side filter column details form API */ async getFilterColumns(type) { - const columnOrderToBeRemove = ['Status', 'Workflow Status', 'Start Time', 'End Time']; - const columnDefinitionToBeRemove = ['status', 'workflowStatus', 'start_time', 'stop_time']; + const columnOrderToBeRemove = ['Status', 'Workflow Status', 'Observation Start Time', 'Observation End Time', 'Process Start Time', 'Process End Time' ]; + const columnDefinitionToBeRemove = ['status', 'workflowStatus', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time']; const suFilters = await ScheduleService.getSchedulingUnitFilterDefinition(type); this.columnMap = []; let tmpDefaulColumns = _.cloneDeep(this.state.defaultcolumns[0]); @@ -1142,21 +1156,37 @@ class SchedulingUnitList extends Component{ let filters = UtilService.localStore({ type: 'get', key: "scheduleunit_list_"+this.state.suType }); if(filters.length > 0 ) { for( const filter of filters) { - if (filter.id === 'Start Time') { + if (filter.id === 'Observation Start Time') { + const values = filter.value; + if (values[0]) { + this.filterQry += 'on_sky_start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + if (values[1]) { + this.filterQry += 'on_sky_start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + } else if (filter.id === 'Observation End Time') { + const values = filter.value; + if (values[0]) { + this.filterQry += 'on_sky_stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + if (values[1]) { + this.filterQry += 'on_sky_stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + } else if (filter.id === 'Process Start Time') { const values = filter.value; if (values[0]) { - this.filterQry += 'start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } if (values[1]) { - this.filterQry += 'start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } - } else if (filter.id === 'End Time') { + } else if (filter.id === 'Process End Time') { const values = filter.value; if (values[0]) { - this.filterQry += 'stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } if (values[1]) { - this.filterQry += 'stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } } else if ((filter.id === 'Scheduling Unit ID' || filter.id === 'Linked Draft ID') && filter.value != '') { let columnDetails = _.find(this.state.columnMap, {displayName:filter.id}); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js index 481f1ec388c9ff1c0552d197cdb9563d909eae7e..92760509bd87567bd3e3c6894ee7bb5bc74ef898 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js @@ -61,8 +61,10 @@ class ViewSchedulingUnit extends Component { "Control ID", "Name", "Description", - "Start Time", - "End Time", + "Observation Start Time", + "Observation End Time", + "Process Start Time", + "Process End Time", "Duration (HH:mm:ss)", "Relative Start Time (HH:mm:ss)", "Relative End Time (HH:mm:ss)", @@ -78,7 +80,10 @@ class ViewSchedulingUnit extends Component { "Updated at" ], defaultcolumns: [{ - status_logs: "Status Logs", + status_logs: { + name: "Status Logs", + filter: 'none' + }, status: { name: "Status", filter: "select" @@ -91,15 +96,25 @@ class ViewSchedulingUnit extends Component { subTaskID: 'Control ID', name: "Name", description: "Description", - start_time: { - name: "Start Time", - filter: "date", - format: UIConstants.CALENDAR_DATETIME_FORMAT + on_sky_start_time: { + name: "Observation Start Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, - stop_time: { - name: "End Time", - filter: "date", - format: UIConstants.CALENDAR_DATETIME_FORMAT + on_sky_stop_time: { + name: "Observation End Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_start_time: { + name: "Process Start Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_stop_time: { + name: "Process End Time", + filter:"flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT }, duration: { name: "Duration (HH:mm:ss)", @@ -140,6 +155,10 @@ class ViewSchedulingUnit extends Component { "Cancelled": "filter-input-50", "Duration (HH:mm:ss)": "filter-input-75", "Template ID": "filter-input-50", + "Observation Start Time":"filter-input-150", + "Observation End Time":"filter-input-150", + "Process Start Time":"filter-input-150", + "Process End Time":"filter-input-150", // "BluePrint / Task Draft link": "filter-input-100", "Relative Start Time (HH:mm:ss)": "filter-input-75", "Relative End Time (HH:mm:ss)": "filter-input-75", @@ -253,7 +272,7 @@ class ViewSchedulingUnit extends Component { this.setToggleBySorting(); let schedule_id = this.props.match.params.id; let schedule_type = this.props.match.params.type; - const permissionById = await AuthUtil.getUserPermissionByModuleId(schedule_type === 'blueprint'? 'scheduling_unit_blueprint': 'scheduling_unit_draft', schedule_id); + const permissionById = await AuthUtil.getUserPermissionByModuleId(schedule_type === 'blueprint'? 'scheduling_unit_blueprint': 'scheduling_unit_draft', schedule_id) this.setState({userPermission: permission, permissionById: permissionById, schedule_id: schedule_id}); if (schedule_type && schedule_id) { this.stations = await ScheduleService.getStationGroup(); @@ -376,8 +395,8 @@ class ViewSchedulingUnit extends Component { } async getFilterColumns(type) { - const columnOrderToRemove = type === 'blueprint' ?[] :['Status', 'Status Logs', 'Start Time', 'End Time', 'Control ID','#Dataproducts', 'Data Size', 'Data Size on Disk', 'Subtask Content']; - const columnDefinitionToRemove = type === 'blueprint' ?['scheduling_unit_draft']:['scheduling_unit_blueprint', 'status', 'status_logs', 'start_time', 'stop_time', 'subTaskID','noOfOutputProducts','size','dataSizeOnDisk','subtaskContent']; + const columnOrderToRemove = type === 'blueprint' ?[] :['Status', 'Status Logs', 'Observation Start Time', 'Observation End Time', 'Process Start Time', 'Process End Time', 'Control ID','#Dataproducts', 'Data Size', 'Data Size on Disk', 'Subtask Content']; + const columnDefinitionToRemove = type === 'blueprint' ?['scheduling_unit_draft']:['scheduling_unit_blueprint', 'status', 'status_logs', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'subTaskID','noOfOutputProducts','size','dataSizeOnDisk','subtaskContent']; let tmpDefaulColumns = _.cloneDeep(this.state.defaultcolumns[0]); let tmpOptionalColumns = _.cloneDeep(this.state.optionalcolumns[0]); tmpOptionalColumns.blueprint_draft = this.props.match.params.type==="draft"?"Linked Blueprint": "Linked Draft" @@ -479,7 +498,7 @@ class ViewSchedulingUnit extends Component { async getFormattedTaskDrafts(schedulingUnit) { let scheduletasklist = []; // Common keys for Task and Blueprint - let commonkeys = ['id', 'created_at', 'description', 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'start_time', 'stop_time', 'duration', 'status']; + let commonkeys = ['id', 'created_at', 'description', 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status']; for (const task of schedulingUnit.task_drafts) { let scheduletask = {}; scheduletask['tasktype'] = 'Draft'; @@ -1317,12 +1336,13 @@ class ViewSchedulingUnit extends Component { <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.created_at && moment(this.state.scheduleunit.updated_at, moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> + {this.props.match.params.type === 'blueprint' && <div className="p-grid"> - <label className="col-lg-2 col-md-2 col-sm-12">Start Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.start_time && moment(this.state.scheduleunit.start_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> - <label className="col-lg-2 col-md-2 col-sm-12">End Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.stop_time && moment(this.state.scheduleunit.stop_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> - </div> + <label className="col-lg-2 col-md-2 col-sm-12">Observation Start Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.on_sky_start_time && moment(this.state.scheduleunit.on_sky_start_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> + <label className="col-lg-2 col-md-2 col-sm-12">Observation End Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.on_sky_stop_time && moment(this.state.scheduleunit.on_sky_stop_time).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> + </div>} <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12" >Duration (HH:mm:ss)</label> <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc((this.state.scheduleunit.duration ? this.state.scheduleunit.duration : 0) * 1000).format(UIConstants.CALENDAR_TIME_FORMAT)}</span> @@ -1426,7 +1446,6 @@ class ViewSchedulingUnit extends Component { </span> </div> </div> - {this.state.isLoading ? <AppLoader /> : (this.state.schedulingUnitTasks.length > 0) ? <ViewTable data={this.state.schedulingUnitTasks} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Search/find.object.result.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Search/find.object.result.js index 8febeea0e6c417843b07a6758daccfa8ffa6e0dc..d703ec06dfec99efbe474f6f1357a9b2c7037183 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Search/find.object.result.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Search/find.object.result.js @@ -82,12 +82,8 @@ export class FindObjectResult extends Component{ <span className="find-obj-tree-view"> <a href={subtaskDetails.url} target='_blank' title=" View SubTask API"><i className="fa fa-link" /></a></span></>; subtask['icon'] = 'fas fa-tasks'; - let tasks = []; - for (const taskId of subtaskDetails.task_blueprints_ids) { - let taskMap = await this.findTask('blueprint', taskId); - tasks.push(taskMap[0]); - } - subtask['children'] = tasks; + let task = await this.findTask('blueprint', subtaskDetails.task_blueprint_id); + subtask['children'] = task; return [subtask]; } return ''; diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js index 092c08eee35c1f03eb78fdffbd0ce6a8439f0521..1e3ddf44003f34118847dd2ac10637c27b6b0e34 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js @@ -53,8 +53,10 @@ export class TaskList extends Component { "Control ID", "Name", "Description", - "Start Time", - "End Time", + "Observation Start Time", + "Observation End Time", + "Process Start Time", + "Process End Time", "Duration (HH:mm:ss)", "Relative Start Time (HH:mm:ss)", "Relative End Time (HH:mm:ss)", @@ -106,13 +108,23 @@ export class TaskList extends Component { description: { name:"Description" }, - start_time: { - name: "Start Time", + on_sky_start_time: { + name: "Observation Start Time", filter: "flatpickrDateRange", format: UIConstants.CALENDAR_DATETIME_FORMAT }, - stop_time: { - name: "End Time", + on_sky_stop_time: { + name: "Observation End Time", + filter: "flatpickrDateRange", + format: UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_start_time: { + name: "Process Start Time", + filter: "flatpickrDateRange", + format: UIConstants.CALENDAR_DATETIME_FORMAT + }, + process_stop_time: { + name: "Process End Time", filter: "flatpickrDateRange", format: UIConstants.CALENDAR_DATETIME_FORMAT }, @@ -182,8 +194,10 @@ export class TaskList extends Component { "Linked Draft ID": "filter-input-75", "Relative Start Time (HH:mm:ss)": "filter-input-75", "Relative End Time (HH:mm:ss)": "filter-input-75", - "Start Time": "filter-input-150", - "End Time": "filter-input-150", + "Observation Start Time": "filter-input-150", + "Observation End Time": "filter-input-150", + "Process Start Time": "filter-input-150", + "Process End Time": "filter-input-150", "Status": "filter-input-125", "#Dataproducts": "filter-input-75", "Data size": "filter-input-50", @@ -265,7 +279,7 @@ export class TaskList extends Component { getFormattedTaskDrafts(tasks) { let scheduletasklist = []; // Common keys for Task and Blueprint - let commonkeys = ['id', 'created_at', 'description', 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'start_time', 'stop_time', 'duration', 'status']; + let commonkeys = ['id', 'created_at', 'description', 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status']; for (const task of tasks) { let scheduletask = {}; scheduletask['tasktype'] = 'Draft'; @@ -615,8 +629,8 @@ export class TaskList extends Component { */ async getFilterColumns(type) { const taskFilters = await TaskService.getTaskFilterDefinition(type); - const columnOrderToRemove = this.state.taskType === 'Blueprint' ?[] :['Status', 'Status Logs', 'Start Time', 'End Time', 'Control ID','#Dataproducts', 'Data Size', 'Data Size on Disk', 'Subtask Content']; - const columnDefinitionToRemove = this.state.taskType === 'Blueprint' ?['scheduling_unit_draft']:['scheduling_unit_blueprint', 'status', 'status_logs', 'start_time', 'stop_time', 'subTaskID','noOfOutputProducts','size','dataSizeOnDisk','subtaskContent']; + const columnOrderToRemove = this.state.taskType === 'Blueprint' ?[] :['Status', 'Status Logs', 'Observation Start Time', 'Observation End Time', 'Process Start Time', 'Process End Time', 'Control ID','#Dataproducts', 'Data Size', 'Data Size on Disk', 'Subtask Content']; + const columnDefinitionToRemove = this.state.taskType === 'Blueprint' ?['scheduling_unit_draft']:['scheduling_unit_blueprint', 'status', 'status_logs', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time','subTaskID','noOfOutputProducts','size','dataSizeOnDisk','subtaskContent']; this.columnMap = []; let tmpDefaulColumns = _.cloneDeep(this.state.defaultcolumns[0]); let tmpOptionalColumns = _.cloneDeep(this.state.optionalcolumns[0]); @@ -784,21 +798,37 @@ export class TaskList extends Component { let filters = UtilService.localStore({ type: 'get', key: "su_task_list_"+this.state.taskType }); if(filters.length > 0 ) { for( const filter of filters) { - if (filter.id === 'Start Time') { + if (filter.id === 'Observation Start Time') { + const values = filter.value; + if (values[0]) { + this.filterQry += 'on_sky_start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + if (values[1]) { + this.filterQry += 'on_sky_start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + } else if (filter.id === 'Observation End Time') { + const values = filter.value; + if (values[0]) { + this.filterQry += 'on_sky_stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + if (values[1]) { + this.filterQry += 'on_sky_stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + } + } if (filter.id === 'Process Start Time') { const values = filter.value; if (values[0]) { - this.filterQry += 'start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_start_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } if (values[1]) { - this.filterQry += 'start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_start_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } - } else if (filter.id === 'End Time') { + } else if (filter.id === 'Process End Time') { const values = filter.value; if (values[0]) { - this.filterQry += 'stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_stop_time_after='+ moment(new Date(values[0])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } if (values[1]) { - this.filterQry += 'stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; + this.filterQry += 'process_stop_time_before='+moment(new Date(values[1])).format("YYYY-MM-DDTHH:mm:ss")+".000Z&"; } } else if (filter.id === 'Scheduling Unit Name') { if (this.state.taskType === 'Draft') { diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js index 56b5ef83b03f165958e39229099cbba352e53b6f..270dca3aa1069184e1863b249dbbeef58f045e96 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/summary.js @@ -58,7 +58,7 @@ export class TaskSummary extends Component { <label>Subtasks:</label> <ViewTable data={taskDetails.subtasks} - defaultcolumns={[{subtask_type: "Subtask Type", id: "Subtask ID", start_time:{name:"Start Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, stop_time:{name:"End Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, state_value: "Status"}]} + defaultcolumns={[{subtask_type: "Subtask Type", id: "Subtask ID", on_sky_start_time:{name:"Start Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, on_sky_stop_time:{name:"End Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, state_value: "Status"}]} optionalcolumns={[{actionpath: "actionpath"}]} columnclassname={[{"Subtask ID": "filter-input-50","Subtask Type":"filter-input-75", "Start Time": "filter-input-75", "End Time": "filter-input-75", "Status": "filter-input-75"}]} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js index 0190d3f5754533c374bc62055514ac8ec3e56957..47a04d5e6917b964d093ebda2efcfb996294f464 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js @@ -52,16 +52,26 @@ export class TaskView extends Component { filter:"select", tooltip: 'Select Subtask status' }, - start_time: { + on_sky_start_time: { name: "Start Time", filter: "flatpickrDateRange", format:UIConstants.CALENDAR_DATETIME_FORMAT, }, - stop_time: { + on_sky_stop_time: { name: "End Time", filter: "flatpickrDateRange", format:UIConstants.CALENDAR_DATETIME_FORMAT }, + process_start_time: { + name: "Process Start Time", + filter: "flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT, + }, + process_stop_time: { + name: "Process End Time", + filter: "flatpickrDateRange", + format:UIConstants.CALENDAR_DATETIME_FORMAT + }, duration:{ name:"Duration (HH:mm:ss)", filter: "durationMinMax", @@ -69,6 +79,7 @@ export class TaskView extends Component { }, parset: { name: "Link to Parset", + filter: 'none', tooltip: 'Enter few characters' } }], @@ -171,7 +182,7 @@ export class TaskView extends Component { TaskService.getTaskDetails(taskType, taskId, this.fetchSubtask) .then(async(task) => { if (task) { - taskType === 'blueprint' && this.getSubtaskDetails(task.subtasks); + taskType === 'blueprint' && await this.getSubtaskDetails(task.subtasks); const suId = taskType==='draft'?task.scheduling_unit_draft_id:task.scheduling_unit_blueprint_id; let loadTasks = false; const taskTemplate = await TaskService.getTaskTemplate(task.specifications_template_id); @@ -209,10 +220,12 @@ export class TaskView extends Component { subtaskRow['type'] = subtask.subtask_type; subtaskRow['id'] = subtask.id; subtaskRow['status'] = subtask.state_value; - subtaskRow['start_time']= subtask.start_time; - subtaskRow['stop_time']= subtask.stop_time; + subtaskRow['on_sky_start_time']= subtask.on_sky_start_time; + subtaskRow['on_sky_stop_time']= subtask.on_sky_stop_time; + subtaskRow['process_start_time']= subtask.process_start_time; + subtaskRow['process_stop_time']= subtask.process_stop_time; subtaskRow['duration']= moment.utc((subtask.duration || 0) * 1000).format(UIConstants.CALENDAR_TIME_FORMAT); - subtaskRow['parset']= `https://proxy.lofar.eu/inspect/${subtask.id}/rtcp-${subtask.id}.parset`; + subtaskRow['parset']= `Parset`; subtaskRow['links'] = ['Link to Parset']; subtaskRow['linksURL'] = { 'Link to Parset': `https://proxy.lofar.eu/inspect/${subtask.id}/rtcp-${subtask.id}.parset` @@ -472,17 +485,28 @@ export class TaskView extends Component { <label className="col-lg-2 col-md-2 col-sm-12">Updated At</label> <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc(this.state.task.updated_at).format(UIConstants.CALENDAR_DATETIME_FORMAT)}</span> </div> + {this.state.taskType === 'blueprint' && this.state.task.task_type === 'observation' && <div className="p-grid"> - <label className="col-lg-2 col-md-2 col-sm-12">Start Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.start_time?moment(this.state.task.start_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> - <label className="col-lg-2 col-md-2 col-sm-12">End Time</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.end_time?moment(this.state.task.end_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> - </div> + <label className="col-lg-2 col-md-2 col-sm-12">Observation Start Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.on_sky_start_time?moment(this.state.task.on_sky_start_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> + <label className="col-lg-2 col-md-2 col-sm-12">Observation End Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.on_sky_stop_time?moment(this.state.task.on_sky_stop_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> + </div>} + {this.state.taskType === 'blueprint' && + <div className="p-grid"> + <label className="col-lg-2 col-md-2 col-sm-12">Process Start Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.process_start_time?moment(this.state.task.process_start_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> + <label className="col-lg-2 col-md-2 col-sm-12">Process End Time</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.process_stop_time?moment(this.state.task.process_stop_time,moment.ISO_8601).format(UIConstants.CALENDAR_DATETIME_FORMAT):""}</span> + </div>} <div className="p-grid"> {/* <label className="col-lg-2 col-md-2 col-sm-12">Tags</label> <Chips className="col-lg-4 col-md-4 col-sm-12 chips-readonly" disabled value={this.state.task.tags}></Chips> */} - <label className="col-lg-2 col-md-2 col-sm-12">Status</label> - <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.status}</span> + {this.state.taskType === 'blueprint' && + <> + <label className="col-lg-2 col-md-2 col-sm-12">Status</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.task.status}</span> + </>} {this.state.schedulingUnit && <> <label className="col-lg-2 col-md-2 col-sm-12">Scheduling Unit</label> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/list.tabs.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/list.tabs.js index 2d86ba533db68ede29739b91719f2fffbfcf0d2e..05a68638e81ba9b5a61f4af4386421919cb279f1 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/list.tabs.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/list.tabs.js @@ -101,6 +101,7 @@ class TimelineListTabs extends Component { * @param {Array} filteredData - Array of SU table rows */ suListFilterCallback(filteredData) { + console.log("viewing SU list"); this.filteredSUB = filteredData; this.filteredTasks = null; this.props.suListFilterCallback(filteredData, this.filteredTasks, this.filteredReservs); @@ -112,6 +113,7 @@ class TimelineListTabs extends Component { * @param {Array} filteredData - Array of task table rows */ taskListFilterCallback(filteredData) { + console.log("viewing Task list"); this.filteredTasks = filteredData; this.props.suListFilterCallback(this.filteredSUB, filteredData, this.filteredReservs); } @@ -122,6 +124,7 @@ class TimelineListTabs extends Component { * @param {Array} filteredData - Array of reservation table rows */ reservListFilterCallback(filteredData) { + console.log("viewing Reserv list"); this.filteredReservs = filteredData; this.props.suListFilterCallback(this.filteredSUB, this.filteredTasks, filteredData); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js index 8e709b1c4bc94a5c394a8f25f8637585988c77a9..72822aff42d8294eaee630d059494ca43767a725 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -99,7 +99,8 @@ export class TimelineView extends Component { unschedulableBlueprint: {}, datasetStartTime: null, datasetEndTime:null, showDialog: false, - popPosition: {display: 'none'} + popPosition: {display: 'none'}, + isOnSkyView: this.timelineUIAttributes.isOnSkyView || false, // Flag to show on sky view in normal timeline view } this.STATUS_BEFORE_SCHEDULED = ['defining', 'defined', 'schedulable']; // Statuses before scheduled to get station_group this.allStationsGroup = []; @@ -258,6 +259,17 @@ export class TimelineView extends Component { this.loadSUsAheadAndTrail(null, datasetEndTime, null, endTime); } } + // Add dummy variables start_time and stop_time to minimize code changes and switch between different flavours + _.map(schedulingUnits.original, su => { + su.start_time = this.state.stationView || this.state.isOnSkyView?su.on_sky_start_time:(su.process_start_time || su.on_sky_start_time); + su.stop_time = this.state.stationView || this.state.isOnSkyView?su.on_sky_stop_time:(su.process_stop_time || su.on_sky_stop_time); + _.map(su.task_blueprints, taskBp => { + taskBp.start_time = this.state.stationView || this.state.isOnSkyView?taskBp.on_sky_start_time:(taskBp.process_start_time || taskBp.on_sky_start_time); + taskBp.stop_time = this.state.stationView || this.state.isOnSkyView?taskBp.on_sky_stop_time:(taskBp.process_stop_time || taskBp.on_sky_stop_time); + return taskBp; + }); + return su; + }); // Returning the data for the timeline only or the existing data. return schedulingUnits; } @@ -1004,7 +1016,7 @@ export class TimelineView extends Component { return stations; } - setStationView(e) { + async setStationView(e) { this.closeSummaryPanel(); let selectedGroups = this.state.selectedStationGroup; // Store selected view and station group. Remove for default values. Default is all station groups. @@ -1020,7 +1032,15 @@ export class TimelineView extends Component { delete this.timelineUIAttributes["stationView"]; } this.timelineCommonUtils.storeUIAttributes(this.timelineUIAttributes); - this.setState({ stationView: e.value, selectedStationGroup: selectedGroups }); + await this.setState({ stationView: e.value, selectedStationGroup: selectedGroups }); + this.dateRangeCallback(this.state.currentStartTime, this.state.currentEndTime, false); + } + + async setOnSkyView(value) { + await this.setState({isOnSkyView: value}); + this.timelineUIAttributes['isOnSkyView'] = value; + this.timelineCommonUtils.storeUIAttributes(this.timelineUIAttributes); + this.dateRangeCallback(this.state.currentStartTime, this.state.currentEndTime, false); } showOptionMenu(event) { @@ -1385,10 +1405,21 @@ export class TimelineView extends Component { } </div> <div className={`timeline-view-toolbar p-grid ${this.state.stationView && 'alignTimeLineHeader'}`}> - <div className="sub-header col-lg-2"> + <div className={`sub-header ${this.state.stationView?"col-lg-2":"col-lg-1"}`}> <label >Station View</label> <InputSwitch checked={this.state.stationView} onChange={(e) => { this.setStationView(e) }} /> </div> + {!this.state.stationView && + <div className="sub-header col-lg-1"> + {/* <label >On Sky View</label> + <InputSwitch checked={this.state.isOnSkyView} onChange={(e) => { this.setOnSkyView(e.value)}} /> */} + <Button className="p-button-rounded toggle-btn" + tooltip={this.state.isOnSkyView?"Turn off On-Sky View":"Turn on On-Sky View"} + style={{minWidth: "50px", backgroundColor: this.state.isOnSkyView?"#007AD9":"#cccccc", color: this.state.isOnSkyView?"#ffffff":"#7e8286"}} + label="On-Sky View" + onClick={e => this.setOnSkyView(!this.state.isOnSkyView)} /> + </div> + } {this.state.stationView && <> <div className="sub-header col-lg-2"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js index a8aca7e145674ffcb6bd3d5884c0ca4221700f08..a2ba1f2ed222b2acbd015e21d00f6b712b332473 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js @@ -24,6 +24,7 @@ import UIConstants from '../../utils/ui.constants'; import { TieredMenu } from 'primereact/tieredmenu'; import { InputSwitch } from 'primereact/inputswitch'; import { Dropdown } from 'primereact/dropdown'; +import { Button } from 'primereact/button'; import ReservationSummary from '../Reservation/reservation.summary'; import TimelineListTabs from './list.tabs'; import TimelineCommonUtils from './common.utils'; @@ -78,7 +79,8 @@ export class WeekTimelineView extends Component { datasetStartTime: null, datasetEndTime:null, showDialog: false, userrole: AuthStore.getState(), - popPosition: {display: 'none'} + popPosition: {display: 'none'}, + isOnSkyView: this.timelineUIAttributes.isOnSkyWeekView || false, // Flag to show on sky view in week view } this.STATUS_BEFORE_SCHEDULED = ['defining', 'defined', 'schedulable']; // Statuses before scheduled to get station_group this.reservations = []; @@ -204,6 +206,17 @@ export class WeekTimelineView extends Component { this.loadSUsAheadAndTrail(null, datasetEndTime, null, endTime); } } + // Add dummy variables start_time and stop_time to minimize code changes and switch between different flavours + _.map(schedulingUnits.original, su => { + su.start_time = this.state.stationView || this.state.isOnSkyView?su.on_sky_start_time:(su.process_start_time || su.on_sky_start_time); + su.stop_time = this.state.stationView || this.state.isOnSkyView?su.on_sky_stop_time:(su.process_stop_time || su.on_sky_stop_time); + _.map(su.task_blueprints, taskBp => { + taskBp.start_time = this.state.stationView || this.state.isOnSkyView?taskBp.on_sky_start_time:(taskBp.process_start_time || taskBp.on_sky_start_time); + taskBp.stop_time = this.state.stationView || this.state.isOnSkyView?taskBp.on_sky_stop_time:(taskBp.process_stop_time || taskBp.on_sky_stop_time); + return taskBp; + }); + return su; + }); // Returning the data for the timeline only or the existing data. return schedulingUnits; } @@ -375,7 +388,7 @@ export class WeekTimelineView extends Component { } else { const fetchDetails = !this.state.selectedItem || item.id !== this.state.selectedItem.id this.setState({ - selectedItem: item, isSUDetsVisible: true, + selectedItem: item, isSUDetsVisible: true, isReservDetsVisible: false, isSummaryLoading: fetchDetails, suTaskList: !fetchDetails ? this.state.suTaskList : [], canExtendSUList: false, canShrinkSUList: false @@ -825,6 +838,14 @@ export class WeekTimelineView extends Component { this.storeUIAttributes(); } + async setOnSkyView(value) { + await this.setState({isOnSkyView: value}); + this.timelineUIAttributes['isOnSkyWeekView'] = value; + let updatedItemGroupData = await this.dateRangeCallback(this.state.startTime, this.state.endTime, true); + this.timeline.updateTimeline(updatedItemGroupData); + this.storeUIAttributes(); + } + /** * Add Week Reservations during the visible timeline period * @param {Array} items @@ -1119,6 +1140,15 @@ export class WeekTimelineView extends Component { <InputSwitch checked={this.state.reservationEnabled} onChange={(e) => { this.showReservations(e) }} /> </div> + <div className="sub-header"> + {/* <label >On Sky View</label> + <InputSwitch checked={this.state.isOnSkyView} onChange={(e) => { this.setOnSkyView(e.value)}} /> */} + <Button className="p-button-rounded toggle-btn" + tooltip={this.state.isOnSkyView?"Turn off On-Sky View":"Turn on On-Sky View"} + style={{minWidth: "50px", backgroundColor: this.state.isOnSkyView?"#007AD9":"#cccccc", color: this.state.isOnSkyView?"#ffffff":"#7e8286"}} + label="On-Sky View" + onClick={e => this.setOnSkyView(!this.state.isOnSkyView)} /> + </div> {this.state.reservationEnabled && <div className="sub-header"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/services/project.service.js b/SAS/TMSS/frontend/tmss_webapp/src/services/project.service.js index f0f2c47ae7e0233a9df5c234a3858b8b15ffd406..bc49f1bb86b8d2d0c23cb3e330ea81edbf2f78f9 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/services/project.service.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/services/project.service.js @@ -254,9 +254,14 @@ const ProjectService = { return null; } }, - getProjectList: async function() { + /** + * Function returns project list with or without quota + * @param {Booleab} fetchQuota - flag to fetch quota or not + * @returns [] - array of project objects with/without quota populated. + */ + getProjectList: async function(fetchQuota) { try { - const response = await axios.get('/api/project/'); + const response = await axios.get(`/api/project/?${fetchQuota? 'expand=quota': ''}`); return response.data.results; } catch (error) { console.error('[project.services.getProjectList]',error); @@ -288,11 +293,9 @@ const ProjectService = { }) .then( async ()=>{ for(const project of projects){ - for(const id of project.quota_ids){ - await ProjectService.getProjectQuota(id).then(async quota =>{ + for(const quota of project.quota){ const resourceType = _.find(results.resourcetypes, ["name", quota.resource_type_id]); project[quota.resource_type_id] = resourceType?UnitConverter.getUIResourceUnit(resourceType.quantity_value, quota.value):quota.value; - }); } projects.map((pro,index) => { if(pro.name === project.name){ diff --git a/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js b/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js index 86aac18f01bbd538adffca0ba491a8602d17928e..cfbb58bc0f5479a8c2e315f1fff2a96c435c60dd 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/services/schedule.service.js @@ -17,6 +17,9 @@ const SU_FETCH_FIELDS = [ "id", "do_cancel", "start_time", "stop_time", + "process_start_time", "process_stop_time", + "on_sky_start_time", "on_sky_stop_time", + "scheduled_on_sky_start_time", "scheduled_on_sky_stop_time", "duration", "priority_rank", "updated_at", @@ -32,6 +35,9 @@ const SU_FETCH_FIELDS = [ "id", "task_blueprints.status", "task_blueprints.start_time", "task_blueprints.stop_time", + "task_blueprints.process_start_time", "task_blueprints.process_stop_time", + "task_blueprints.on_sky_start_time", "task_blueprints.on_sky_stop_time", + "task_blueprints.scheduled_on_sky_start_time", "task_blueprints.scheduled_on_sky_stop_time", "task_blueprints.task_type", "task_blueprints.do_cancel", "task_blueprints.duration", @@ -137,7 +143,7 @@ const ScheduleService = { let blueprints = []; try { let url = `/api/scheduling_unit_blueprint/?ordering=name&expand=${SU_EXPAND_FIELDS.join()}&fields=${SU_FETCH_FIELDS.join()}`; - url = `${url}&start_time_before=${endTime || ''}&stop_time_after=${startTime || ''}`; + url = `${url}&scheduled_on_sky_start_time_before=${endTime || ''}&scheduled_on_sky_stop_time_after=${startTime || ''}`; let initialResponse = await axios.get(url); const totalCount = initialResponse.data.count; const initialCount = initialResponse.data.results.length @@ -147,6 +153,11 @@ const ScheduleService = { let secondResponse = await axios.get(url); blueprints = blueprints.concat(secondResponse.data.results); } + _.map(blueprints, su => { + su.start_time = su.scheduled_on_sky_start_time; + su.stop_time = su.scheduled_on_sky_stop_time; + return su; + }); } catch(error) { console.error('[schedule.services.getExpandedSUList]',error); }