eat.io package¶
Submodules¶
eat.io.fits module¶
-
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)
eat.io.hops module¶
eat.io.misc module¶
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
eat.io.smt module¶
EHT tables
eat.io.util module¶
-
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_gmst(df)[source]¶ add gmst column to data frame with datetime field using astropy for conversion
-
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.debias(df)[source]¶ amplitude debias by subtracting noise expectation from squared amplitude from df.amp, do not run twice!
-
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.tt2dt(timetag, year=2018)[source]¶ convert HOPS timetag to pandas Timestamp (np.datetime64)