Example #1
0
def ra_dec_from_lm(l_rad, m_rad, ra0_angle, dec0_angle):
    n_rad = sqrt(1.0 - l_rad * l_rad - m_rad * m_rad)
    ra_rad = float(ra0_angle) + arctan2(
        l_rad,
        cos(float(dec0_angle)) * n_rad - m_rad * sin(float(dec0_angle)))
    dec_rad = arcsin(m * cos(float(dec0_angle)) +
                     sin(float(dec0_angle)) * n_rad)
    return (momxml.Angle(rad=ra_rad), momxml.Angle(rad=dec_rad))
Example #2
0
 def mean_ra_rad(self):
     targets = [
         momxml.TargetSource(
             name, momxml.Angle(rad=float(ephem.hours(ra_str))),
             momxml.Angle(rad=float(ephem.degrees(dec_str))))
         for name, ra_str, dec_str in self.target_list
     ]
     return angle(
         array([exp(1j * float(target.ra_angle))
                for target in targets]).mean())
Example #3
0
def single_observation(start_search_0ut):
    start_search_date = momxml.ephem.Date(start_search_0ut + ' 14:00:00')
    target = momxml.TargetSource(name='3C196',
                                 ra_angle=momxml.Angle(shms=('+', 8, 13,
                                                             36.0678)),
                                 dec_angle=momxml.Angle(sdms=('+', 48, 13,
                                                              2.581)))

    auxiliary = momxml.TargetSource(name='3C196-32A',
                                    ra_angle=momxml.Angle(shms=('+', 8, 22,
                                                                36.91)),
                                    dec_angle=momxml.Angle(sdms=('+', 51, 12,
                                                                 29.5)))

    transit_date = momxml.next_date_with_lofar_lst(target.ra_angle.as_rad(),
                                                   start_search_date)

    target.name = '3C196-%4d-%02d-%02d' % start_search_date.tuple()[0:3]

    antenna_set = 'HBA_DUAL_INNER'
    band = 'HBA_LOW'
    stations = momxml.station_list('all')
    int_s = 2.0  # 2.0
    chan = 64
    target_subbands = '62..393'  # 380 subbands 115 -- 189 MHz
    subbands_main = '70..394'
    subbands_aux = '70..232'

    target_duration_s = 6 * 3600
    sys.stderr.write('MAIN: ' + str(target) + '\n')
    sys.stderr.write(' AUX: ' + str(auxiliary) + '\n')

    current_date = transit_date - 0.5 * target_duration_s * ephem.second

    backend = momxml.BackendProcessing(channels_per_subband=chan,
                                       integration_time_seconds=int_s)

    return momxml.Observation(beam_list=[
        momxml.Beam(target, subbands_main, storage_cluster='CEP4'),
        momxml.Beam(auxiliary, subbands_aux, storage_cluster='CEP4')
    ],
                              antenna_set=antenna_set,
                              frequency_range=band,
                              start_date=ephem.Date(current_date).tuple(),
                              duration_seconds=target_duration_s,
                              stations=stations,
                              clock_mhz=200,
                              backend=backend,
                              bit_mode=8,
                              initial_status='approved')
Example #4
0
    def obs_list(self, central_date):
        observations = []
        duration_s = self.sequence_duration_s()
        start_date = ephem.Date(central_date) - 0.5 * duration_s * ephem.second
        current_date = ephem.Date(start_date)
        end_date = current_date + duration_s * ephem.second
        cal_source = momxml.SourceCatalogue().cal_source(
            current_date + (0.5 * duration_s) * ephem.second, 'HBA')

        obs_name = self.name
        targets = [
            momxml.TargetSource(
                beam_name, momxml.Angle(rad=float(ephem.hours(ra_str))),
                momxml.Angle(rad=float(ephem.degrees(dec_str))))
            for beam_name, ra_str, dec_str in self.target_list
        ]

        observations.append(
            self.make_obs(None, [cal_source], current_date, self.cal_s))
        current_date += (self.cal_s + self.gap_s) * ephem.second
        observations.append(
            self.make_obs(obs_name, targets, current_date, self.pointing_s))
        return observations
Example #5
0
    return (momxml.Angle(rad=ra_rad), momxml.Angle(rad=dec_rad))


def rotate_lm_CCW(l_rad, m_rad, ccw_angle):
    cs = cos(float(ccw_angle))
    ss = sin(float(ccw_angle))

    l_new =  l_rad*cs + m_rad*ss
    m_new = -l_rad*ss + m_rad*cs
    return l_new, m_new
                

start_search_date = momxml.ephem.Date(momxml.next_sunset(sys.argv[1]))

target       = momxml.TargetSource(name      = '3C196',
                                   ra_angle  = momxml.Angle(shms = ('+', 8, 13, 36.0678)),
                                   dec_angle = momxml.Angle(sdms = ('+', 48, 13, 2.581)))

transit_date = momxml.next_date_with_lofar_lst(target.ra_angle.as_rad(), start_search_date)

target.name = '3C196-%4d-%02d-%02d' % start_search_date.tuple()[0:3]



cal_fields   = [momxml.TargetSource(name      = '4C45.16',
                                    ra_angle  = momxml.Angle(shms = ('+', 8, 30, 35.8)),
                                    dec_angle = momxml.Angle(sdms = ('+', 45, 43, 30.0)))
                ]
ra_4c45_16    = cal_fields[0].ra_angle
dec_4c45_16   = cal_fields[0].dec_angle
pos_angle_inc = momxml.Angle(deg = 60.0)
Example #6
0
    momxml.next_sunrise(mid_day) - 20 * momxml.ephem.minute)

total_duration_s = (end_date - start_date) * 24 * 3600.0
target_duration_s = total_duration_s - 2 * cal_duration_s - 2 * 61.0

target = momxml.simbad('NCP')
target.name = 'NCP-%4d-%02d-%02d' % start_date.tuple()[0:3]

pre_cal = source_catalogue.cal_source(start_date, 'HBA')
post_cal = source_catalogue.cal_source(
    start_date + (target_duration_s + 2 * cal_duration_s) * ephem.second,
    'HBA')
cal_fields = [momxml.simbad('3C61.1')]
ra_3c61_1 = cal_fields[0].ra_angle
dec_3c61_1 = cal_fields[0].dec_angle
ra_inc = momxml.Angle(deg=60.0)

antenna_set = 'HBA_DUAL_INNER'
band = 'HBA_LOW'
stations = momxml.station_list('nl', exclude=[])
int_s = 2.0
chan = 64
target_subbands = '77..456'  # 380 subbands 115 -- 189 MHz
cal_subbands = '77,99,121,144,166,188,211,233,257,278,299,321,345,367,389,412,434,456'

for i in range(5):
    cal_fields.append(
        momxml.TargetSource('NCP-' + chr(ord('A') + i),
                            ra_angle=ra_3c61_1 + ra_inc * (i + 1),
                            dec_angle=dec_3c61_1))
    return (momxml.Angle(rad=ra_rad), momxml.Angle(rad=dec_rad))


def rotate_lm_CCW(l_rad, m_rad, ccw_angle):
    cs = cos(float(ccw_angle))
    ss = sin(float(ccw_angle))

    l_new =  l_rad*cs + m_rad*ss
    m_new = -l_rad*ss + m_rad*cs
    return l_new, m_new
                

start_search_date = momxml.ephem.Date(momxml.next_sunset(sys.argv[1]))

target       = momxml.TargetSource(name      = '3C196',
                                   ra_angle  = momxml.Angle(shms = ('+', 8, 13, 36.0678)),
                                   dec_angle = momxml.Angle(sdms = ('+', 48, 13, 2.581)))

transit_date = momxml.next_date_with_lofar_lst(target.ra_angle.as_rad(), start_search_date)

target.name = '3C196-%4d-%02d-%02d' % transit_date.tuple()[0:3]


degree  = pi/180.0
offsets =  arange(-3,4)*1.0*degree

lm_pointings = [(l, m) for l in offsets for m in offsets if (l, m) != (0.0, 0.0)]
ra_dec_pointings = [ra_dec_from_lm(l, m, target.ra_angle, target.dec_angle)
                    for (l, m) in lm_pointings]

aux_pointings = [momxml.TargetSource(name = '3C196-GRID-%02d' % field_id,
Example #8
0
    return (momxml.Angle(rad=ra_rad), momxml.Angle(rad=dec_rad))


def rotate_lm_CCW(l_rad, m_rad, ccw_angle):
    cs = cos(float(ccw_angle))
    ss = sin(float(ccw_angle))

    l_new =  l_rad*cs + m_rad*ss
    m_new = -l_rad*ss + m_rad*cs
    return l_new, m_new
                

start_search_date = (2013, 6, 17, 12, 0, 0.0)

target       = momxml.TargetSource(name      = 'ELAIS-N1',
                                   ra_angle  = momxml.Angle(shms = ('+', 16, 11, 0.0)),
                                   dec_angle = momxml.Angle(sdms = ('+', 55,  0, 0.0)))

transit_date = momxml.next_date_with_lofar_lst(target.ra_angle.as_rad(), start_search_date)

target.name = 'ELAIS-N1-%4d-%02d-%02d' % transit_date.tuple()[0:3]



cal_fields   = [momxml.TargetSource(name      = '87GB 160333.2+573543',
                                    ra_angle  = momxml.Angle(shms = ('+', 16,  4, 34.5)),
                                    dec_angle = momxml.Angle(sdms = ('+', 57, 28,  1.7)))
                ]
ra_4c45_16    = cal_fields[0].ra_angle
dec_4c45_16   = cal_fields[0].dec_angle
pos_angle_inc = momxml.Angle(deg = 60.0)
Example #9
0
mid_day    = momxml.ephem.Date(sys.argv[1])
start_date = momxml.ephem.Date(momxml.next_sunset(mid_day)  + 20*momxml.ephem.minute)
end_date   = momxml.ephem.Date(momxml.next_sunrise(start_date) - 20*momxml.ephem.minute)

total_duration_s = (end_date - start_date)*24*3600.0
target_duration_s = total_duration_s - 2*cal_duration_s - 2*61.0

target       = momxml.simbad('NCP')
target.name = 'NCP-%4d-%02d-%02d' % start_date.tuple()[0:3]

pre_cal      = source_catalogue.cal_source(start_date, 'HBA')
post_cal     = source_catalogue.cal_source(start_date+(target_duration_s+2*cal_duration_s)*ephem.second, 'HBA')
cal_fields   = [momxml.simbad('3C61.1')]
ra_3c61_1    = cal_fields[0].ra_angle
dec_3c61_1   = cal_fields[0].dec_angle
ra_inc       = momxml.Angle(deg = 60.0)
ra_offset    = momxml.Angle(deg=30.0)

antenna_set     = 'HBA_DUAL_INNER'
band            = 'HBA_LOW'
stations        = momxml.station_list('all', exclude = [])
int_s           = 2.0
chan            = 64
target_subbands = '62..393' # 380 subbands 115 -- 189 MHz
cal_subbands_base = array([ 62,  75,  88, 101, 114, 127, 140, 153, 166, 179, 192, 205, 218,
                            231, 244, 257, 270, 283, 296, 309, 322, 335, 348, 361, 374, 387])
cal_subbands_offset = int(sys.argv[2])*6
cal_subbands    = [[','.join([str(sb) for sb in (cal_subbands_base+cal_subbands_offset)])]*6][0]

#scintillation_3c220_3 = momxml.TargetSource(name      = '3C 220.3',
#                                     ra_angle  = momxml.Angle(shms = ('+', 9, 39, 23.4)),
Example #10
0
end_date = momxml.ephem.Date(
    momxml.next_sunrise(start_date) - 20 * momxml.ephem.minute)

total_duration_s = (end_date - start_date) * 24 * 3600.0
target_duration_s = total_duration_s - 2 * cal_duration_s - 2 * 61.0

target = momxml.simbad('NCP')
target.name = 'NCP-VLBI-%4d-%02d-%02d' % start_date.tuple()[0:3]

pre_cal = source_catalogue.cal_source(start_date, 'HBA')
post_cal = source_catalogue.cal_source(
    start_date + (target_duration_s + 2 * cal_duration_s) * ephem.second,
    'HBA')
cal_fields = [
    momxml.TargetSource(name='J%02d%02d%04.1f+%02d%02d%04.1f' % (ra + dec),
                        ra_angle=momxml.Angle(hms=ra),
                        dec_angle=momxml.Angle(sdms=('+', ) + dec))
    for ra, dec in [((
        1,
        17,
        28.7,
    ), (89, 28, 49.1)), ((
        10,
        57,
        40.0,
    ), (88, 58, 47.0)), ((
        1,
        10,
        47.3,
    ), (87, 38, 21.1)), ((
        22,
Example #11
0
    return (momxml.Angle(rad=ra_rad), momxml.Angle(rad=dec_rad))


def rotate_lm_CCW(l_rad, m_rad, ccw_angle):
    cs = cos(float(ccw_angle))
    ss = sin(float(ccw_angle))

    l_new = l_rad * cs + m_rad * ss
    m_new = -l_rad * ss + m_rad * cs
    return l_new, m_new


start_search_date = (2013, 4, 12, 17, 0, 0.0)

target = momxml.TargetSource(name='3C 295',
                             ra_angle=momxml.Angle(shms=('+', 14, 11, 20.6)),
                             dec_angle=momxml.Angle(sdms=('+', 52, 12, 9.0)))

transit_date = momxml.next_date_with_lofar_lst(target.ra_angle.as_rad(),
                                               start_search_date)

target.name = '3C295-%4d-%02d-%02d' % transit_date.tuple()[0:3]

cal_fields = [
    momxml.TargetSource(name='3C295-A',
                        ra_angle=momxml.Angle(shms=('+', 14, 11, 28.61)),
                        dec_angle=momxml.Angle(sdms=('+', 55, 42, 23.8)))
]
ra_4c55_28 = cal_fields[0].ra_angle
dec_4c55_28 = cal_fields[0].dec_angle
pos_angle_inc = momxml.Angle(deg=60.0)
Example #12
0
end_date = momxml.ephem.Date(
    momxml.next_sunrise(start_date) - 20 * momxml.ephem.minute)

total_duration_s = (end_date - start_date) * 24 * 3600.0
target_duration_s = total_duration_s - 2 * cal_duration_s - 2 * 61.0

target = momxml.simbad('NCP')
target.name = 'NCP-%4d-%02d-%02d' % start_date.tuple()[0:3]

pre_cal = source_catalogue.cal_source(start_date, 'HBA')
post_cal = source_catalogue.cal_source(
    start_date + (target_duration_s + 2 * cal_duration_s) * ephem.second,
    'HBA')
cal_fields = [
    momxml.simbad('3C61.1'),
    momxml.TargetSource('J0121+8928', momxml.Angle(hms=(1, 17, 32.82)),
                        momxml.Angle(sdms=('+', 89, 28, 48.7)))
]
antenna_set = 'HBA_DUAL_INNER'
band = 'HBA_LOW'
stations = momxml.station_list('all', exclude=[])
int_s = 2.0
chan = 64
target_subbands = '77..456'  # 380 subbands 115 -- 189 MHz
cal_subbands = ','.join(
    [str(i) for i in (range(50, 207, 6) + range(213, 396, 7))])

sys.stderr.write('PRE : ' + str(pre_cal) + '\n')
sys.stderr.write('MAIN: ' + str(target) + '\n')
for cal in cal_fields:
    sys.stderr.write(' CAL: ' + str(cal) + '\n')
Example #13
0
end_date = ephem.Date(start_date + duration_s * ephem.second)
antenna_set = 'HBA_DUAL_INNER'
bit_mode = 8

lc0_003_fields = [['A', ('+', 3, 32, 59.30), ('+', 54, 34, 43.6)],
                  ['B', ('+', 3, 15, 5.15), ('+', 54, 34, 43.6)],
                  ['C', ('+', 3, 23, 46.70), ('+', 56, 49, 29.5)],
                  ['D', ('+', 3, 24, 16.38), ('+', 52, 19, 57.7)],
                  ['E', ('+', 3, 41, 42.22), ('+', 52, 19, 57.7)],
                  ['F', ('+', 3, 42, 11.90), ('+', 56, 49, 29.5)],
                  ['G', ('+', 3, 50, 53.45), ('+', 54, 34, 43.6)],
                  ['H', ('+', 2, 40, 31.67), ('+', 61, 18, 45.6)]]

targets = [
    TargetSource(name,
                 ra_angle=momxml.Angle(shms=ra),
                 dec_angle=momxml.Angle(sdms=dec))
    for name, ra, dec in lc0_003_fields
]

cal_list = SourceCatalogue()

calibrator = momxml.simbad('3C 147')
exclude = ['CS013']
subbands = '115..131,207..223,279..295,427..443'

cal_beam = Beam(calibrator, subbands)
src_beams = [Beam(target, subbands) for target in targets[0:-1]]
src_beams += [Beam(targets[-1], '207..218')]

observations = []
Example #14
0
mid_day    = momxml.ephem.Date(sys.argv[1])
start_date = momxml.ephem.Date(momxml.next_sunset(mid_day)  + 20*momxml.ephem.minute)
end_date   = momxml.ephem.Date(momxml.next_sunrise(start_date) - 20*momxml.ephem.minute)

total_duration_s = (end_date - start_date)*24*3600.0
target_duration_s = total_duration_s - 2*cal_duration_s - 2*61.0

target       = momxml.simbad('NCP')
target.name = 'NCP-%4d-%02d-%02d' % start_date.tuple()[0:3]

pre_cal      = source_catalogue.cal_source(start_date, 'HBA')
post_cal     = source_catalogue.cal_source(start_date+(target_duration_s+2*cal_duration_s)*ephem.second, 'HBA')
cal_fields   = [momxml.simbad('3C61.1')]
ra_3c61_1    = cal_fields[0].ra_angle
dec_3c61_1   = cal_fields[0].dec_angle
ra_inc       = momxml.Angle(deg = 60.0)
ra_offset    = momxml.Angle(deg=30.0)

antenna_set     = 'HBA_DUAL_INNER'
band            = 'HBA_LOW'
stations        = momxml.station_list('all', exclude = [])
int_s           = 2.0
chan            = 64
target_subbands = '77..456' # 380 subbands 115 -- 189 MHz
cal_subbands_base = array([77, 101, 125, 149, 173, 197, 221, 245, 269, 293, 317, 341, 365, 389, 413, 437])
cal_subbands_offset = int(sys.argv[2])*6
cal_subbands    = [[','.join([str(sb) for sb in (cal_subbands_base+cal_subbands_offset)])]*5
                   + [','.join([str(sb) for sb in (cal_subbands_base+cal_subbands_offset)][:-1]), '77']][0]

scintillation_3c220_3 = momxml.TargetSource(name      = '3C 220.3',
                                     ra_angle  = momxml.Angle(shms = ('+', 9, 39, 23.4)),