eat.io package

Submodules

eat.io.fits module

class eat.io.fits.fitshdu(hdu)[source]

Bases: object

class eat.io.fits.fitshdulist(hdulist)[source]

Bases: object

close()[source]
eat.io.fits.open(filename, mode='readonly')[source]

open fits file into convenient contained class for interactive work

Parameters:filename – fits filename
Returns:container object (fitshdulist)
class eat.io.fits.uvfits(hdulist)[source]

Bases: object

eat.io.hops module

eat.io.hops.condense_formats(fmtlist)[source]
eat.io.hops.get_alist_version(filename)[source]
eat.io.hops.read_alist(filename)[source]

Read alist file into pandas table, automatically deteremine version (v5 or v6)

Parameters:filename (str) – alist filename
Returns:pandas.DataFrame with alist contents
eat.io.hops.read_alist_v5(filename)[source]
eat.io.hops.read_alist_v6(filename)[source]
eat.io.hops.read_bandpass(filename)[source]
eat.io.hops.read_caltable(filename)[source]
eat.io.hops.read_mastercal(filename)[source]
eat.io.hops.read_networksol(filename)[source]
eat.io.hops.read_networksol2(filename)[source]
eat.io.hops.read_tlist_v6(filename)[source]
eat.io.hops.write_alist_v5(df, out=<open file '<stdout>', mode 'w'>)[source]
eat.io.hops.write_alist_v6(df, out=<open file '<stdout>', mode 'w'>)[source]
eat.io.hops.write_tlist_v6(df, out=<open file '<stdout>', mode 'w'>)[source]

eat.io.misc module

eat.io.misc.read_blist(filename)[source]
eat.io.misc.read_cns2log(filename)[source]
eat.io.misc.read_g3mm(filename)[source]
eat.io.misc.read_generic(filename)[source]
eat.io.misc.read_m3mmca(filename)[source]
eat.io.misc.read_rlulist(filename)[source]
eat.io.misc.read_x21log(filename)[source]

eat.io.ovex module

USAGE NOTE:

ovex_reader.Ovex(‘ovex file name’) returns an object that contains various observational information.

import ovex_reader as ov fname = “ovex_files/3C279.zmubap” ovex = ov.Ovex(fname)

Summary of mnemonics:

— Read in from “$MODE” section in a ovex file “mode index”=0 if there’s only 1 mode ovex.modes[mode index][‘mode’] = name of mode ovex.modes[mode index][‘site_dic’] = dictionary of site name in $FREQ language and site ID in $SITES language

— Read in from “$FREQ” section in a ovex file ovex.freqs[site index][‘antenna’] = antenna ID ovex.freqs[site index][‘sample_rate’] = sample rate ovex.freqs[site index][‘chans’][channel index][‘chan_name’] = name of channel ? ovex.freqs[site index][‘chans’][channel index][‘freq’] = frequency in MHz ovex.freqs[site index][‘chans’][channel index][‘bw’] = bandwidth in MHz

— Read in from “$SITES” section in a ovex file ovex.sites[site index][‘site_name’] ovex.sites[site index][‘site_ID’] ovex.sites[site index][‘mk4_site_ID’] ovex.sites[site index][‘site_position’]

— Read in from “$SCHED” section in a ovex file “scan index”=0 if there’s only 1 scan, which is always the case for ovex files ?? ovex.sched[scan index][‘scan_numer’] = scan number of “scan ID”-th scan ovex.sched[scan index][‘source’] = source name of “scan ID”-th scan ovex.sched[scan index][‘start’] = start time of the scan ovex.sched[scan index][‘mode’] = scan mode of the scan ovex.sched[scan index][‘scan’][site index][‘site’] = site name of “site-ID”-th site of the “scan ID”-th scan ovex.sched[scan index][‘scan’][site index][‘scan_sec’] = duration of the scan in second ovex.sched[scan index][‘scan’][site index][‘data_size’] = data size (?) of the scan in GB ovex.sched[scan index][‘scan’][site index][‘scan_sec_start’] = probably ‘start_hr’ + ‘scan_sec_start’(in sec) is the actual time that the scan starts, but not sure

— Read in from “$SOURCE” section in a ovex file “source index”=0 if there’s only 1 source ovex.source[source index][‘source’] = source name of “source ID”-th source ovex.source[source index][‘ra’] = RA of the source ovex.source[source index][‘dec’] = DEC of the source ovex.source[source index][‘ref_coord_frame’] = something about the source

— Others ovex.sites_dic = sites’ names in various languages (site_name, site_ID, mk4_site_ID, $FREQ’s ref) ovex.lvex_rev ovex.evex_rev ovex.ivex_rev

class eat.io.ovex.Ovex(filename)[source]

Bases: object

find_variable(vname, line)[source]
get_def_name(line)[source]
get_ref_special(vname, line)[source]
get_sector(sname)[source]
get_variable(vname, line)[source]

eat.io.sma module

EHT tables for SMA data products

eat.io.sma.read_swarm(filename)[source]

eat.io.smt module

EHT tables

eat.io.smt.group(df, col)[source]
eat.io.smt.read_tau(filename)[source]
eat.io.smt.read_totalpower(filename)[source]
eat.io.smt.read_tsys(filename)[source]
eat.io.smt.sddfile(filename, cols=['c1_scan', 'c1_object', 'c1_obsmode', 'c3_utdate', 'c3_ut', 'c5_tamb', 'c12_tcal', 'c12_stsys', 'c12_rtsys', 'c12_tauh2o'])[source]
eat.io.smt.sddscantimes(filename)[source]
eat.io.smt.subset(df)[source]
eat.io.smt.tp2tsys(tp, trec=100.0, thot=284.8, tcal3=284.0, tcal7=284.0)[source]
eat.io.smt.tpreduce(tp)[source]
eat.io.smt.xlim2range(ax=None)[source]

eat.io.util module

eat.io.util.add_days(df)[source]

decimal days since beginning of year = (DOY - 1) + hour/24.

eat.io.util.add_delayerr(df, bw=None, bw_factor=1.0, mbd_systematic=2e-06, sbd_systematic=2e-06, rate_systematic=0.001, crosspol_systematic=2e-05)[source]

Add in place error to delay and rate fit from fourfit.

This is re-derived and close in spirit to the code in fourfit/fill_208.c but there are small different factors, not sure what is origin of the fourfit eqns add some sytematic errors in quadrature.. (alist precision, linear approx systematics..)

Parameters:
  • bw – bw spread in MHz (not in alist..) [default guess based on ambiguity and freq code]
  • bw_factor – use bw*bw_factor “effective bandwidth” to calculate statistical error on estimate compensates for non-white data
  • rate_systematic (mbd_systematic,) – added in quadrature to statistical error (us, ps/s)
  • crosspol_systematic – added in quadrature to delay error for cross polarization products
Returns:

additional columns mbd_err and rate_err added directly to original DataFrame

eat.io.util.add_doy(df)[source]

add day-of-year doy extracted from time-tag

eat.io.util.add_gmst(df)[source]

add gmst column to data frame with datetime field using astropy for conversion

eat.io.util.add_hour(df, t0=-6)[source]

add hour if HOPS timetag available

eat.io.util.add_id(df, col=['timetag', 'baseline', 'polarization'])[source]

add unique id tuple to data frame based on columns

eat.io.util.add_mjd(df)[source]

add gmst column to data frame with datetime field using astropy for conversion

eat.io.util.add_path(df, datadir='')[source]

add a path to each alist line for easier file access, with optional root datadir

eat.io.util.add_scanno(df, unique=True)[source]

add scan_no based on 2017 scan_id e.g. No0012 -> 12, or a unique number in increasing order

eat.io.util.add_utime(df)[source]

add UNIX time utime

eat.io.util.debias(df)[source]

amplitude debias by subtracting noise expectation from squared amplitude from df.amp, do not run twice!

eat.io.util.dt2tt(dt)[source]

convert datetime to HOPS timetag

eat.io.util.fix(df)[source]
eat.io.util.isunique(df, cols=['timetag', 'baseline', 'polarization'])[source]

Return True if data frame rows are uniquely identified by columns

e.g. check for single root_id per (timetag, baseline, polarization)

Parameters:
  • df (pandas.DataFrame) – input data frame with necessary columns
  • cols – list of columns to use for checking uniquness
eat.io.util.noauto(df)[source]

returns new data frame with autocorrelations removed regardless of polarziation

eat.io.util.rewrap_mbd(df, mbd_ambiguity=None)[source]

Rewrap in place the MBD based on the ambiguity [us], choose value within +/-ambiguity window

eat.io.util.tt2days(timetag)[source]

convert HOPS timetag DOY-HHMMSS to days since Jan 1 00:00:00

eat.io.util.tt2dt(timetag, year=2018)[source]

convert HOPS timetag to pandas Timestamp (np.datetime64)

eat.io.util.undofix(df)[source]
eat.io.util.unwrap_mbd(df, mbd_ambiguity=None)[source]

Add mbd_unwrap to DataFrame based on ambiguity [us], choose value closest to SBD

eat.io.util.unwrap_mbd_old(df, mbd_ambiguity=None)[source]
eat.io.util.uvdict(filename)[source]

take calibration output data frame, and make UV dictionary lookup table

Module contents