Skip to content
Snippets Groups Projects
Commit ec8fff4f authored by Sander ter Veen's avatar Sander ter Veen
Browse files

Updated xmlgen to version 4.0.5, to include LV614.

parent 5530a6d8
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
# Last change by : $Author: renting $
# Change date : $Date: 2016-05-18 11:47:57 +0200 (wo, 18 mei 2016) $
VERSION = "4.0.3"
VERSION = "4.0.5"
import sys, getopt, time
from xml.sax.saxutils import escape as XMLescape
......@@ -49,13 +49,13 @@ WHICH_CS = ['IQUV', 'I', 'XXYY']
WEIGHTING_SCHEMES = ['uniform', 'superuniform', 'natural', 'briggs', 'briggsabs', 'radial']
IMAGING_PIPELINE_TYPES = ['MSSS', 'standard', 'none']
# MODES = ['Calobs','Calbeam','MultiObs']
PROCESSING = ['Preprocessing', 'Calibration', 'Pulsar', 'Imaging', 'LongBaseline', 'Prefactor', 'none']
PROCESSING = ['Preprocessing', 'Calibration', 'Pulsar', 'Imaging', 'LongBaseline', 'Prefactor', 'PreprocessingNoFlagging', 'none']
CALIBRATION_MODE = ['internal', 'external', 'none']
ALL_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,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613'
ALL_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,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613,LV614'
CORE_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'
SUPERTERP_STATIONS = 'CS002,CS003,CS004,CS005,CS006,CS007'
REMOTE_STATIONS = 'RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509'
INTERNATIONAL_STATIONS = 'DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613'
INTERNATIONAL_STATIONS = 'DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613,LV614'
NL_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'
DEFAULT_TASKS_PER_NODE = 11
DEFAULT_CORES_PER_TASK = 2
......@@ -395,7 +395,7 @@ def writeXMLObs(ofile, name, descr, topo, predecessor_topo, attrname, projname,
def writeXMLBeam(ofile, name, description, topo, beamtype, target, ra, dec, subbands, flyseye, tabrings, tabringsize,
tablist, dataproducts, status):
tablist, dataproducts, status, equinox="J2000"):
print(r"""<item index="0">
<lofar:measurement xsi:type="lofar:BFMeasurementType">
<name>%s</name>
......@@ -410,7 +410,7 @@ def writeXMLBeam(ofile, name, description, topo, beamtype, target, ra, dec, subb
<targetName>%s</targetName>
<ra>%s</ra>
<dec>%s</dec>
<equinox>J2000</equinox>
<equinox>%s</equinox>
<duration>0</duration>
<subbandsSpecification>
<subbands>%s</subbands>
......@@ -430,8 +430,8 @@ def writeXMLBeam(ofile, name, description, topo, beamtype, target, ra, dec, subb
</resultDataProducts>
</lofar:measurement>
</item>""" % (
name, description, topo, status, beamtype, target, ra, dec, subbands, writeBoolean(flyseye),
tabrings, tabringsize, tablist, dataproducts), file=ofile)
name, description, topo, status, beamtype, target, ra, dec, equinox, subbands,
writeBoolean(flyseye), tabrings, tabringsize, tablist, dataproducts), file=ofile)
def writeXMLObsEnd(ofile):
......@@ -1660,7 +1660,9 @@ def readBlock(lines, projectName, blockNr):
"globalTABrings": [],
"coherentStokesData": False,
"flysEye": False,
"numberOfBitsPerSample": 0}
"numberOfBitsPerSample": 0,
"equinox": "J2000"
}
for lineNr, cline in enumerate(lines):
if "=" in cline and not cline.startswith(('BBS', 'Demix', 'Pulsar')): # we skip beam and pipelines lines
......@@ -1825,6 +1827,8 @@ def readBlock(lines, projectName, blockNr):
raise GenException("the number of nodes parameter is not valid for BLOCK: %i" % blockNr)
elif key == "storagemanager":
s["storagemanager"] = value
elif key == "equinox":
s["equinox"] = value
else:
raise GenException("unknown key:'%s' in BLOCK: %i" % (key, blockNr))
return s ##settings
......@@ -2107,6 +2111,13 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
# raise GenException('Prefactor mode currently does not support an internal calibration beam.')
else:
tar_pipe_input_INST_topo = cal_pipe_calibrator_topology + '.inst.dps' # 1.CPC.inst.dps
elif processing == 'PreprocessingNoFlagging':
tar_pipe_predecessor = tar_obs_topology # 1.T
tar_pipe_input_INST_topo = '' # no input instrument models for these modes
cal_obs_pipe_default_template = "Preprocessing Pipeline"
cal_tar_pipe_default_template = "Preprocessing Pipeline"
cal_pipe_calibrator_description = "Preprocessing"
cal_pipe_target_description = "Preprocessing"
bfDataExtension = determineBfDataExtension(coherentStokesData, incoherentStokesData)
......@@ -2215,7 +2226,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData,
incoherentStokesData,
settings['cluster']),
status)
status,
settings['equinox'])
writeXMLObsEnd(ofile)
# target start and end time:
......@@ -2261,7 +2273,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task,
miscParameters)
elif processing == 'Preprocessing':
elif processing in ['Preprocessing', 'PreprocessingNoFlagging']:
calibratorDemix = settings['calibratorDemix']
for i in range(0, len(calibratorDemix)):
if len(calibratorDemix) > 1: # TODO a cludge right now, but want to refactor how to call the writeXML soon
......@@ -2429,7 +2441,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData,
incoherentStokesData,
settings['cluster']),
status)
status,
settings['equinox'])
# create the extra polarization beam?
if "create_extra_ncp_beam" in settings and settings["create_extra_ncp_beam"]:
......@@ -2450,7 +2463,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData,
incoherentStokesData,
settings['cluster']),
status) # FIXME missing parameters
status,
settings['equinox']) # FIXME missing parameters
# create a calibrator beam in the target observation?
if settings['create_target_cal_beam']:
......@@ -2478,7 +2492,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData,
incoherentStokesData,
settings['cluster']),
status)
status,
settings['equinox'])
writeXMLObsEnd(ofile)
......@@ -2515,7 +2530,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task,
miscParameters)
elif processing == 'Preprocessing':
elif processing in ['Preprocessing', 'PreprocessingNoFlagging']:
calibratorDemix = settings['calibratorDemix']
for i in range(0, len(calibratorDemix)):
if len(calibratorDemix) > 1: # TODO a cludge right now, but want to refactor how to call the writeXML soon
......@@ -2678,7 +2693,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData,
incoherentStokesData,
settings['cluster']),
status)
status,
settings['equinox'])
writeXMLObsEnd(ofile)
......@@ -2711,6 +2727,9 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
elif processing == 'Prefactor':
tar_pipe_default_template = "Calibration Pipeline Target"
tar_pipe_description = "Prefactor Target"
elif processing == 'PreprocessingNoFlagging':
tar_pipe_default_template = "PreprocessingNoFlagging Pipeline"
tar_pipe_description = "Preprocessing No Flagging"
if settings['writePackageTag']:
tar_pipe_name = settings['packageTag'] + "/" + targetBeams[beamNr][2] + "/" + str(repeatNr) + "." + \
......@@ -2742,7 +2761,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task,
miscParameters)
elif processing == 'Preprocessing':
elif processing in ['Preprocessing', 'PreprocessingNoFlagging']:
targetDemix = settings['targetDemix']
for i in range(0, len(targetDemix[beamNr])):
if len(targetDemix[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment