diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template/pipeline/pulsar_pipeline-8.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template/pipeline/pulsar_pipeline-8.json new file mode 100644 index 0000000000000000000000000000000000000000..1f7e67acf9417782c44561566f1d13033d5d3fc8 --- /dev/null +++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template/pipeline/pulsar_pipeline-8.json @@ -0,0 +1,325 @@ +{ + "description": "This schema defines the parameters for a pulsar pipeline.", + "name": "pulsar pipeline", + "purpose": "production", + "schema": { + "$id": "https://tmss.lofar.eu/api/schemas/tasktemplate/pulsar%20pipeline/7#", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "description": "This schema defines the parameters for a pulsar pipeline.", + "patternProperties": { + "^[$]schema$": {} + }, + "properties": { + "cluster_resources": { + "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pipeline/7#/definitions/cluster_resources", + "default": {} + }, + "dspsr": { + "additionalProperties": false, + "default": {}, + "properties": { + "digifil": { + "additionalProperties": false, + "default": {}, + "description": "Processes single pulses in CV data if single-pulse search is enabled", + "properties": { + "channels_per_part": { + "default": 512, + "description": "Number of frequency channels per part (multiple of subbands per part).", + "maximum": 512, + "minimum": 1, + "title": "Nr of Frequency Channels", + "type": "integer" + }, + "coherent_dedispersion": { + "default": true, + "title": "Coherent Dedispersion", + "type": "boolean" + }, + "dm": { + "default": -1, + "desciption": "Dispersion Measure (-1 for none)", + "minimum": -1, + "title": "DM", + "type": "number" + }, + "integration_time_factor": { + "default": 4, + "minimum": 1, + "title": "Integration time", + "type": "integer" + } + }, + "title": "Digifil", + "type": "object" + }, + "enabled": { + "default": true, + "title": "Enabled", + "type": "boolean" + }, + "filterbank": { + "additionalProperties": false, + "default": {}, + "properties": { + "channels_per_part": { + "default": 120, + "description": "Number of frequency channels per part (multiple of subbands per part).", + "maximum": 512, + "minimum": 1, + "title": "Nr of Frequency Channels", + "type": "integer" + }, + "coherent_dedispersion": { + "default": true, + "title": "Coherent Dedispersion", + "type": "boolean" + }, + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + } + }, + "title": "Create extra channels", + "type": "object" + }, + "optimise_period_dm": { + "default": true, + "title": "Optimise period & DM", + "type": "boolean" + }, + "rfi_excision": { + "default": true, + "description": "Excise/clean/remove detected RFI", + "title": "RFI excision", + "type": "boolean" + }, + "single_pulse_subintegration": { + "default": false, + "description": "Create single-pulse subintegrations with inter-channel dispersion delays removed.", + "title": "Single pulse subintegration", + "type": "boolean" + }, + "subintegration_length": { + "default": -1, + "minimum": -1, + "title": "Subintegration length", + "type": "integer" + }, + "number_of_bins": { + "minimum": 2, + "title": "Number of bins", + "type": "integer" + } + }, + "title": "DSPSR", + "type": "object", + "required": [ + "enabled" + ] + }, + "output": { + "additionalProperties": false, + "default": {}, + "properties": { + "dynamic_spectrum": { + "additionalProperties": false, + "default": {}, + "properties": { + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + }, + "time_average": { + "default": 0.5, + "description": "Time averaging, in seconds.", + "minimum": 0.01, + "title": "Time average", + "type": "number" + } + }, + "title": "Dynamic Spectrum", + "type": "object" + }, + "quantisation": { + "additionalProperties": false, + "default": {}, + "description": "Quantise output into 8-bit samples", + "properties": { + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + }, + "scale": { + "default": 5, + "description": "Conversion sigma to use when converting to 8-bit samples", + "minimum": 1, + "title": "Conversion sigma", + "type": "number" + } + }, + "title": "Quantisation", + "type": "object" + } + }, + "title": "Output", + "type": "object" + }, + "presto": { + "additionalProperties": false, + "default": {}, + "properties": { + "fold_profile": { + "default": true, + "description": "Fold the pulsar profile", + "title": "Fold", + "type": "boolean" + }, + "input": { + "additionalProperties": false, + "properties": { + "decode_sigma": { + "default": 3, + "description": "Sigma threshold for decoding", + "minimum": 1, + "title": "Decode sigma", + "type": "number" + }, + "nr_blocks": { + "default": 100, + "description": "Number of blocks to read at a time", + "minimum": 1, + "title": "Nr of blocks", + "type": "integer" + }, + "samples_per_block": { + "default": 8192, + "minimum": 16, + "title": "Block size (samples)", + "type": "integer" + } + }, + "title": "Input", + "type": "object" + }, + "prepdata": { + "additionalProperties": false, + "default": {}, + "properties": { + "dm": { + "default": -1, + "desciption": "Dispersion Measure (-1 for none)", + "minimum": -1, + "title": "DM", + "type": "number" + } + }, + "title": "prepdata", + "type": "object" + }, + "prepfold": { + "default": true, + "title": "Enable prepfold", + "type": "boolean" + }, + "rfifind": { + "additionalProperties": false, + "default": {}, + "properties": { + "blocks": { + "default": 16, + "minimum": 1, + "title": "blocks", + "type": "integer" + } + }, + "title": "rfifind", + "type": "object" + }, + "rrats": { + "additionalProperties": false, + "default": {}, + "properties": { + "dm_range": { + "default": 5, + "minimum": 0, + "title": "DM range", + "type": "number" + }, + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + } + }, + "title": "RRATs analysis", + "type": "object" + } + }, + "title": "PRESTO", + "type": "object" + }, + "pulsar": { + "additionalProperties": false, + "default": {}, + "properties": { + "name": { + "default": "", + "description": "Name of the pulsar to fold, if strategy=manual", + "title": "Name", + "type": "string" + }, + "strategy": { + "default": "manual", + "description": "How to look up the pulsar to fold", + "enum": [ + "manual", + "meta", + "sapfind", + "sapfind3", + "tabfind", + "tabfind+" + ], + "enum_titles": [ + "Pulsar name specified here", + "SAP target is pulsar name", + "Brightest known pulsar in SAP", + "Brightest 3 known pulsars in SAP", + "Brightest known pulsar in TAB", + "Brightest 3 known pulsars in TAB" + ], + "title": "Strategy", + "type": "string" + } + }, + "title": "Pulsar to fold", + "type": "object" + }, + "single_pulse_search": { + "default": false, + "description": "Instructs PRESTO to process single pulses, and enables Digifil for CV data", + "title": "Single-pulse search", + "type": "boolean" + }, + "software_version": { + "$ref": "https://tmss.lofar.eu/api/schemas/commonschematemplate/pipeline/9#/definitions/software_version", + "default": "lofar-pulp:tmss" + } + }, + "required": [ + "pulsar", + "presto", + "dspsr", + "output" + ], + "title": "pulsar pipeline", + "type": "object", + "version": 8 + }, + "state": "active", + "version": 8 +} diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py index 9ecc856c7ed99781a353e30a0389c702da838efc..58df0f355848a032f4ea2d8ec779b2c2efdd89b3 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py @@ -2390,7 +2390,9 @@ def _generate_subtask_specs_from_pulsar_pipeline_task_specs(pipeline_task_specs, "-U minX1 -t 1", # minimise memory usage, and use 1 thread "-s -K" if dspsr_specs["single_pulse_subintegration"] else "", "-F {channels_per_part}{dedispersion}".format(**filterbank_specs, dedispersion=":D" if filterbank_specs["coherent_dedispersion"] else "") if filterbank_specs["enabled"] else "", - ]) + ]).rstrip() + if "number_of_bins" in dspsr_specs: + subtask_specs["dspsr"]["dspsr_extra_opts"] += " -b %d" % (dspsr_specs["number_of_bins"],) # output output_specs = pipeline_task_specs["output"]