Skip to content

Commit

Permalink
Add ARTS mode IAB or TAB for SC4 observations
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa Moss authored and Vanessa Moss committed Jun 11, 2019
1 parent 1f8b715 commit e123e5a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
28 changes: 20 additions & 8 deletions atdb_parsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main():
# Parse the relevant arguments
parser = ArgumentParser(formatter_class=RawTextHelpFormatter)
parser.add_argument('-f', '--filename',
default='test/fixtures/test_20190607_offset.csv',
default='input/drift_20190607.csv',
help='Specify the input file location (default: %(default)s)')
parser.add_argument('-m', '--mode',
default='imaging',
Expand All @@ -41,7 +41,7 @@ def main():
default='ATDB',
help='Specify which ARTS cluster mode, either standard/ATDB (default: %(default)s)')
parser.add_argument('-u', '--upload',
default=False,
default=True,
action='store_true',
help='Specify whether to automatically upload to wcudata1 (default: %(default)s)')
parser.add_argument('-p', '--parset_only',
Expand All @@ -52,6 +52,10 @@ def main():
default=False,
action='store_true',
help='Specify whether to send a verification/test observation for specified mode (default: %(default)s)')
parser.add_argument('-a', '--artsmode',
default='TAB',
help='Specify which mode to record for ARTS SC4, either incoherent IAB or tied-array TAB (default: %(default)s)')


# Parse the arguments above
args = parser.parse_args()
Expand Down Expand Up @@ -110,6 +114,9 @@ def main():
#parsetonly = ''
obs.parsetonly = ''

# Consider also ARTS mode
obs.artsmode = args.artsmode

# Verification observation
if args.verification:
out,outname = make_verification(obs,args.mode)
Expand Down Expand Up @@ -438,26 +445,31 @@ def main():
nbeams = [1,7,7,6,6,6,7]
currdate_dt = obs.sdate
truename = obs.src
truera = obs.ra
truedec = obs.dec

for ii in range(0,len(refbeams)):

obs.refbeam = refbeams[ii]
n_drift = nbeams[ii]
obs.ra = truera
obs.dec = truedec

ha,duration = calc_drift((obs.ra,obs.dec),currdate_dt,n_drift)
#print(obs.ra,obs.dec)
ha,duration = calc_drift((truera,truedec),currdate_dt,n_drift)
print(ra2dec(ha),duration)

# Deal with ref beam
beamname = 'B0%.2d' % obs.refbeam
ra_new1,dec_new1 = calc_pos_compound(obs.ra,obs.dec,beamname)
offset = '%+.2d' % ((obs.dec - dec_new1)*60.)

# Change the variables
obs.ratype='field_ha'
obs.ra = ra2dec(ha) # Note: it intentionally goes to ra!
obs.duration = duration
obs.sdate = currdate_dt
obs.edate = currdate_dt + timedelta(seconds=int(duration))

# Deal with ref beam
beamname = 'B0%.2d' % obs.refbeam
ra_new1,dec_new1 = calc_pos_compound(obs.ra,obs.dec,beamname)
offset = '%+.2d' % ((obs.dec - dec_new1)*60.)
obs.src = truename+'drift'+offset

# Write to the outfile
Expand Down
3 changes: 2 additions & 1 deletion modules/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self):
self.sbeam = None
self.ebeam = None
self.pulsar = None
self.artsmode = None

# SC1 specific parameters
self.sband = None
Expand Down Expand Up @@ -110,7 +111,7 @@ def writesource_imaging(obs):
def writesource_sc4(obs):

# Write to file (not plus=)
obs.out.write("""atdb_service --field_name={obs.src} --{obs.ratype}={obs.ra:.6f} --field_dec={obs.dec:.6f} --field_beam={obs.refbeam} --starttime='{obs.sdate}' --duration={obs.duration} --pattern={obs.weightpatt} --integration_factor={obs.intfac} --observing_mode={obs.obsmode} --telescopes={obs.telescopes} --central_frequency={obs.centfreq} --data_dir=/data2/output/ --irods_coll=arts_main/arts_sc4 --science_mode=TAB --operation=specification --atdb_host=prod --process_triggers {obs.parsetonly}{obs.extra}{obs.hadec}\n\n""".format(**locals()))
obs.out.write("""atdb_service --field_name={obs.src} --{obs.ratype}={obs.ra:.6f} --field_dec={obs.dec:.6f} --field_beam={obs.refbeam} --starttime='{obs.sdate}' --duration={obs.duration} --pattern={obs.weightpatt} --integration_factor={obs.intfac} --observing_mode={obs.obsmode} --telescopes={obs.telescopes} --central_frequency={obs.centfreq} --data_dir=/data2/output/ --irods_coll=arts_main/arts_sc4 --science_mode={obs.artsmode} --operation=specification --atdb_host=prod --process_triggers {obs.parsetonly}{obs.extra}{obs.hadec}\n\n""".format(**locals()))
obs.out.flush()


Expand Down

0 comments on commit e123e5a

Please sign in to comment.