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

TMSS-142: added initial version of DUPPLO UC1 correlator schema to populate script

parent 2e5a7c3b
No related branches found
No related tags found
2 merge requests!98Resolve TMSS-142 and TMSS-141,!97Resolve TMSS-138
......@@ -15,8 +15,9 @@ class Migration(migrations.Migration):
"""
from .models.specification import Role, Datatype, Dataformat, CopyReason
from .models.scheduling import SubtaskState, SubtaskType, StationType, Algorithm, ScheduleMethod
import json
from lofar.sas.tmss.tmss.tmssapp.models.specification import Role, Datatype, Dataformat, CopyReason
from lofar.sas.tmss.tmss.tmssapp.models.scheduling import SubtaskState, SubtaskType, SubtaskTemplate, StationType, Algorithm, ScheduleMethod
def populate_choices(apps, schema_editor):
'''
......@@ -28,3 +29,125 @@ def populate_choices(apps, schema_editor):
SubtaskState, SubtaskType, StationType, Algorithm, ScheduleMethod]:
choice_class.objects.bulk_create([choice_class(value=x.value) for x in choice_class.Choices])
def populate_lofar_json_schemas(apps, schema_editor):
subtask_template_data = {"type": SubtaskType.objects.get(value='observation'),
"name": "correlator schema",
"description": 'first attempt at correlator schema',
"version": '0.1',
"schema": json.dumps(json.loads('''
{
"$id": "http://example.com/example.json",
"type": "object",
"$schema": "http://json-schema.org/draft-06/schema#",
"definitions": {
"pointing": {
"type": "object",
"additionalProperties": false,
"properties": {
"direction_type": {
"type": "string",
"title": "Reference frame",
"description": "",
"default": "J2000",
"enum": [
"J2000",
"SUN",
"MOON",
"MERCURY",
"VENUS",
"MARS",
"JUPITER",
"SATURN",
"URANUS",
"NEPTUNE",
"PLUTO"
]
},
"angle1": {
"type": "number",
"title": "Angle 1",
"description": "First angle (f.e. RA)",
"default": 0
},
"angle2": {
"type": "number",
"title": "Angle 2",
"description": "Second angle (f.e. DEC)",
"default": 0
}
}
}
},
"additionalProperties": false,
"properties": {
"duration": {
"type": "number",
"title": "Duration (seconds)",
"description": "Duration of this observation",
"default": 60,
"minimum": 1
},
"calibrator": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"title": "Calibrator",
"description": "Replace targets by calibrators",
"default": false
},
"autoselect": {
"type": "boolean",
"title": "Auto-select",
"description": "Auto-select calibrator based on elevation",
"default": false
},
"pointing": {
"title": "Digital pointing",
"$ref": "#/definitions/pointing"
}
}
},
"channels_per_subband": {
"type": "integer",
"title": "Channels/subband",
"description": "Number of frequency bands per subband",
"default": 64,
"minimum": 8,
"enum": [
8,
16,
32,
64,
128,
256,
512,
1024
]
},
"integration_time": {
"type": "number",
"title": "Integration time (seconds)",
"description": "Desired integration period",
"default": 1,
"minimum": 0.1
},
"storage_cluster": {
"type": "string",
"title": "Storage cluster",
"description": "Cluster to write output to",
"default": "CEP4",
"enum": [
"CEP4",
"DragNet"
]
}
}
}''')),
"realtime": True,
"queue": False,
"tags": []}
SubtaskTemplate.objects.create(**subtask_template_data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment