Commit f4048803 authored by Jorrit Schaap's avatar Jorrit Schaap

TMSS-145: added an example subtask with a correlator schema for demo

parent ebe5ad2a
......@@ -32,6 +32,7 @@ def populate_choices(apps, schema_editor):
def populate_lofar_json_schemas(apps, schema_editor):
_populate_correlator_schema()
_populate_subtask_with_correlator_schema_example()
_populate_obscontrol_schema()
_populate_stations_schema()
......@@ -158,6 +159,39 @@ def _populate_correlator_schema():
SubtaskTemplate.objects.create(**subtask_template_data)
def _populate_subtask_with_correlator_schema_example():
from datetime import datetime
specifications_doc = {
"duration": 60,
"calibrator": { "enabled": False,
"autoselect": False,
"pointing": {"direction_type": "J2000",
"angle1": 45,
"angle2": 20} },
"channels_per_subband": 64,
"integration_time": 1,
"storage_cluster": "CEP4" }
subtask_template = SubtaskTemplate.objects.get(name='correlator schema')
subtask_data = {"start_time": datetime.utcnow().isoformat(),
"stop_time": datetime.utcnow().isoformat(),
"state": SubtaskState.objects.all()[0],
"specifications_doc": specifications_doc,
"task_blueprint": None,
"specifications_template": subtask_template,
"tags": ["TMSS", "TESTING", "FAKE_DATA"],
"do_cancel": None,
"priority": 1,
"schedule_method": ScheduleMethod.objects.all()[0],
"cluster": None,
"scheduler_input_doc": ""}
Subtask.objects.create(**subtask_data)
def _populate_obscontrol_schema():
subtask_template_data = {"type": SubtaskType.objects.get(value='observation'),
"name": "obscontrol schema",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment