Esempio n. 1
0
    args.label = args.label.lower()
    at_date = cm_utils.get_astropytime(args.date, args.time)
    if args.station_types not in ['default', 'all']:
        args.station_types = cm_utils.listify(args.station_types)
    if args.label == 'false' or args.label == 'none':
        args.label = False
    xgraph = args.xgraph.upper()
    ygraph = args.ygraph.upper()
    if args.fg_action.startswith('s'):
        cutoff = at_date
        at_date = cm_utils.get_astropytime('now')

    # start session and instances
    db = mc.connect_to_mc_db(args)
    session = db.sessionmaker()
    G = geo_handling.Handling(session)

    # If args.graph is set, apply background
    if args.graph:
        G.set_graph(True)
        if args.background == 'all' or args.background == 'layers':
            G.plot_all_stations()
        if not args.fg_action.startswith('i'):
            if args.background == 'installed' or args.background == 'layers':
                G.plot_station_types(query_date=at_date,
                                     station_types_to_use=args.station_types,
                                     xgraph=xgraph,
                                     ygraph=ygraph,
                                     label=args.label)

    # Process foreground action.
Esempio n. 2
0
import astropy.constants as const

list_of_miriad_files = [
    '/lustre/aoc/projects/hera/rbyrne/HERA_PAPER_data/zen.2457458.16694.xx.uv'
]

ant_nums = []
longitudes = []
latitudes = []
elevations = []

jd = 2457458
t = Time(jd, format='jd')
hookup = cm_hookup.Hookup(at_date=t)
hookup_dict = hookup.get_hookup(['HH', 'PI'])
geo = geo_handling.Handling()

# get cofa info
cofa_loc = geo.cofa()[0]
latitude = cofa_loc.lat * np.pi / 180.
longitude = cofa_loc.lon * np.pi / 180.
altitude = cofa_loc.elevation
location = latitude, longitude, altitude

# get antennas and their locations (lat, lon, alt)
for hkey in hookup_dict['hookup'].keys():
    for pkey in hookup_dict['hookup'][hkey]:
        ant_number = int(
            hookup_dict['hookup'][hkey][pkey][0].downstream_part[1:])
        if ant_number not in ant_nums:
            stn_name = hookup_dict['parts_epoch']['path'][0]
Esempio n. 3
0
    args = parser.parse_args()
    db = mc.connect_to_mc_db(args)
    session = db.sessionmaker()

    if args.starttime is not None:
        starttime_obj = Time(args.starttime, format=args.starttime_format,
                             scale=args.starttime_scale)
    elif args.now:
        # now + 60s buffer for correlator to collect itself
        starttime_obj = Time.now() + TimeDelta(Quantity(60, 'second'))
    else:
        starttime_obj = None
    if args.lstlock and starttime_obj is not None:
        LSTbin_size = 16  # seconds
        geo = geo_handling.Handling(session)  # get the geo part of CM
        cofa = geo.cofa()  # center of array (COFA yo)
        longitude = cofa[0].lon  # the longitude in _degrees_
        starttime_obj, LSTbin = LSTScheduler(starttime_obj,
                                             LSTbin_size,
                                             longitude=longitude)
        print("locking to {s}s LST grid. Next bin at".format(s=LSTbin_size),
              starttime_obj.iso)
    command_list = session.correlator_control_command(args.command,
                                                      starttime=starttime_obj,
                                                      duration=args.duration,
                                                      acclen_spectra=args.acclen_spectra,
                                                      tag=args.tag,
                                                      overwrite_take_data=args.overwrite_take_data,
                                                      config_file=args.config_file,
                                                      force=args.force,