Skip to content
Snippets Groups Projects
Commit 2679220d authored by Vlad Kondratiev's avatar Vlad Kondratiev
Browse files

added --coherent and --incoherent options to enable Coherent and Incoherent...

added --coherent and --incoherent options to enable Coherent and Incoherent modes, respectively; added --nrings and --ringsize options for Coherent mode
parent 5c940d0d
Branches
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ strategy name (e.g. when --strategy-id is used), the version will be ignored", d ...@@ -69,7 +69,7 @@ strategy name (e.g. when --strategy-id is used), the version will be ignored", d
parser.add_argument("--save-strategy-as-json-file", help="Save the chosen strategy as a JSON file with a given name", default="", type=str) parser.add_argument("--save-strategy-as-json-file", help="Save the chosen strategy as a JSON file with a given name", default="", type=str)
parser.add_argument("--name", help="name of the scheduling unit [str, mandatory option]", parser.add_argument("--name", help="name of the scheduling unit [str, mandatory option]",
default="", type=str) default="", type=str)
parser.add_argument("--descr", help="description of the scheduling unit [str, default: ""]", parser.add_argument("--descr", help="description of the scheduling unit [str, default: \"\"]",
default="", type=str) default="", type=str)
parser.add_argument("--target", help="Target to observe (only for SAP0) [str, e.g. \"PSR B0329+54\"]", parser.add_argument("--target", help="Target to observe (only for SAP0) [str, e.g. \"PSR B0329+54\"]",
default="", type=str) default="", type=str)
...@@ -89,6 +89,14 @@ the coordinates, or use --pointing option", action="store_true") ...@@ -89,6 +89,14 @@ the coordinates, or use --pointing option", action="store_true")
default="", type=str) default="", type=str)
parser.add_argument("--fe", help="Enable Fly's Eye mode for BF pipeline 0, this will also exclude coherent/incoherent beams from BF pipeline 0", parser.add_argument("--fe", help="Enable Fly's Eye mode for BF pipeline 0, this will also exclude coherent/incoherent beams from BF pipeline 0",
action="store_true") action="store_true")
parser.add_argument("--coherent", help="Enable coherent mode for BF pipeline 0, single coherent TAB will be added to the specs which can further be modified with --nrings and --ringsize options. This will also exclude Fly's Eye mode from BF pipeline 0. If both --fe and --coherent options are used, then --fe takes the precedence",
action="store_true")
parser.add_argument("--incoherent", help="Enable incoherent mode for BF pipeline 0, single SAP will be added to the specs. The settings for coherent mode will stay intact. This will also exclude Fly's Eye mode from BF pipeline 0. If both --fe and --incoherent options are used, then --fe takes the precedence",
action="store_true")
parser.add_argument("--nrings", help="Number of tied-array rings for 'coherent' mode",
default=0, type=int)
parser.add_argument("--ringsize", help="Size of TA rings in radians, e.g. 0.0015634 [str]",
default='0.0', type=str)
parser.add_argument("--mode", help="Observing mode (I or IQUV or XXYY), only for BF pipeline 0 [str]", parser.add_argument("--mode", help="Observing mode (I or IQUV or XXYY), only for BF pipeline 0 [str]",
default="", type=str) default="", type=str)
parser.add_argument("--subband", help="Subbands to select, can be comma-separated, range is allowed with .. [str]", parser.add_argument("--subband", help="Subbands to select, can be comma-separated, range is allowed with .. [str]",
...@@ -220,6 +228,10 @@ the coordinates, or use --pointing option", action="store_true") ...@@ -220,6 +228,10 @@ the coordinates, or use --pointing option", action="store_true")
else: else:
subband_list = [int(config["subband"])] subband_list = [int(config["subband"])]
if args.coherent: config["coherent"] = True
if args.nrings != 0: config["nrings"] = args.nrings
if args.ringsize != "0.0": config["ringsize"] = args.ringsize
if args.incoherent: config["incoherent"] = True
if args.fe: config["fe"] = True if args.fe: config["fe"] = True
if args.mode != "": config["mode"] = args.mode if args.mode != "": config["mode"] = args.mode
if args.antennafield != "": config["antennafield"] = args.antennafield if args.antennafield != "": config["antennafield"] = args.antennafield
...@@ -382,18 +394,6 @@ the coordinates, or use --pointing option", action="store_true") ...@@ -382,18 +394,6 @@ the coordinates, or use --pointing option", action="store_true")
if "Observation" in spec_doc['tasks']: if "Observation" in spec_doc['tasks']:
spec_doc['tasks']['Observation']['specifications_doc']['duration'] = config["length"] spec_doc['tasks']['Observation']['specifications_doc']['duration'] = config["length"]
if "subband" in config and config["subband"] != "":
if "Observation" in spec_doc['tasks']:
spec_doc['tasks']['Observation']['specifications_doc']['station_configuration']['SAPs'][0]['subbands'] = subband_list
n_bf_pipelines = len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'])
for ii in range(n_bf_pipelines):
if "coherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]:
if len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['coherent']['SAPs']) > 0:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['coherent']['SAPs'][0]['subbands']['list'] = subband_list
if "incoherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]:
if len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['incoherent']['SAPs']) > 0:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['incoherent']['SAPs'][0]['subbands']['list'] = subband_list
if "stationlist" in config and config["stationlist"] != "": if "stationlist" in config and config["stationlist"] != "":
if "Observation" in spec_doc['tasks']: if "Observation" in spec_doc['tasks']:
spec_doc['tasks']['Observation']['specifications_doc']['station_configuration']['station_groups'] = station_groups spec_doc['tasks']['Observation']['specifications_doc']['station_configuration']['station_groups'] = station_groups
...@@ -401,6 +401,56 @@ the coordinates, or use --pointing option", action="store_true") ...@@ -401,6 +401,56 @@ the coordinates, or use --pointing option", action="store_true")
for ii in range(n_bf_pipelines): for ii in range(n_bf_pipelines):
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['station_groups'] = station_groups spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['station_groups'] = station_groups
# Enabling Coherent mode for BF pipeline 0
if "coherent" in config:
if "Observation" in spec_doc['tasks']:
# Coherent
# these values can further be modified via config file or command-line options
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent'] = \
{
"SAPs": [ { "name": "SAP0",
"tabs": [ { "duration": 0, "pointing": { "angle1": 0, "angle2": 0, "target": "OnTarget", "direction_type": "J2000" }, "relative": True, "allow_after_previous": True } ],
"subbands": { "list": [], "method": "copy" },
"tab_rings": { "count": 0, "width": 0.01 }
}
],
"settings": {
"stokes": "I",
"quantisation": {"bits": 8, "enabled": False, "scale_max": 5, "scale_min": -5},
"subbands_per_file": 488,
"channels_per_subband": 16,
"time_integration_factor": 6
}
}
# Fly's Eye
if "flys eye" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0] and \
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['flys eye']['enabled'] == True:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['flys eye']['enabled'] = False
# Enabling Incoherent mode for BF pipeline 0
if "incoherent" in config:
if "Observation" in spec_doc['tasks']:
# Incoherent
# these values can further be modified via config file or command-line options
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['incoherent'] = \
{
"SAPs": [ { "name": "SAP0",
"subbands": { "list": [], "method": "copy" }
}
],
"settings": {
"stokes": "I",
"quantisation": {"bits": 8, "enabled": False, "scale_max": 5, "scale_min": -5},
"subbands_per_file": 488,
"channels_per_subband": 16,
"time_integration_factor": 6
}
}
# Fly's Eye
if "flys eye" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0] and \
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['flys eye']['enabled'] == True:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['flys eye']['enabled'] = False
# Enabling FE for BF pipeline 0 # Enabling FE for BF pipeline 0
if "fe" in config: if "fe" in config:
if "Observation" in spec_doc['tasks']: if "Observation" in spec_doc['tasks']:
...@@ -430,6 +480,47 @@ the coordinates, or use --pointing option", action="store_true") ...@@ -430,6 +480,47 @@ the coordinates, or use --pointing option", action="store_true")
len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['incoherent']['SAPs']) > 0: len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['incoherent']['SAPs']) > 0:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['incoherent']['SAPs'] = [] spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['incoherent']['SAPs'] = []
if "subband" in config and config["subband"] != "":
if "Observation" in spec_doc['tasks']:
spec_doc['tasks']['Observation']['specifications_doc']['station_configuration']['SAPs'][0]['subbands'] = subband_list
n_bf_pipelines = len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'])
for ii in range(n_bf_pipelines):
if "coherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii] and \
"SAPs" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['coherent']:
if len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['coherent']['SAPs']) > 0:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['coherent']['SAPs'][0]['subbands']['list'] = subband_list
if "incoherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii] and \
"SAPs" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['incoherent']:
if len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['incoherent']['SAPs']) > 0:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][ii]['incoherent']['SAPs'][0]['subbands']['list'] = subband_list
# Modifying Number of TA rings and ringsize
if "nrings" in config:
if "Observation" in spec_doc['tasks']:
# Coherent
if "coherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0] and \
"SAPs" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent'] and \
len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs']) > 0:
if "tab_rings" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tab_rings"]["count"] = config["nrings"]
else:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tab_rings"] = { "count": config["nrings"], "width": 0.01 }
# excluding extra TABs from the SAP
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tabs"] = []
if "ringsize" in config:
if "Observation" in spec_doc['tasks']:
# Coherent
if "coherent" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0] and \
"SAPs" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent'] and \
len(spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs']) > 0:
if "tab_rings" in spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tab_rings"]["width"] = config["ringsize"]
else:
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tab_rings"] = { "count": 0, "width": config["ringsize"] }
# excluding extra TABs from the SAP
spec_doc['tasks']['Observation']['specifications_doc']['beamformer']['pipelines'][0]['coherent']['SAPs'][0]["tabs"] = []
# Mode - Stokes I / IQUV or XXYY # Mode - Stokes I / IQUV or XXYY
if "mode" in config and config["mode"] != "": if "mode" in config and config["mode"] != "":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment