ch_util.chan_monitor

Channel quality monitor routines

Classes

ChanMonitor(t1[, t2, freq_sel, prod_sel, ...])

This class provides the user interface to FeedLocator.

FeedLocator(vis1, vis2, tm1, tm2, src1, ...)

This class contains functions that do all the computations to determine feed positions from data.

class ch_util.chan_monitor.ChanMonitor(t1, t2=None, freq_sel=None, prod_sel=None, bswp1=26, bswp2=90, bsep1=154, bsep2=218)[source]

Bases: object

This class provides the user interface to FeedLocator.

It initializes instances of FeedLocator (normally one per polarization) and returns results combined lists of results (good channels and positions, agreement/disagreement with the layout database, etc.)

Feed locator should not have to sepparate the visibilities in data to run the test on and data not to run the test on. ChanMonitor should make the sepparation and provide FeedLocator with the right data cube to test.

Parameters:
  • [t2] (t1) – set to 1 sideral day after t1

  • freq_sel

  • prod_sel

Here t1 and t2 have to be unix time (floats)

classmethod fromdata(data, freq_sel=None, prod_sel=None)[source]

Initialize class from andata object

classmethod fromdate(date, freq_sel=None, prod_sel=None, bswp1=26, bswp2=90, bsep1=154, bsep2=218)[source]

Initialize class from date

get_results(src, tdelt=2800)[source]

If self.finder exists, then it takes a deep copy of this object, further restricts the time range to include only src transits, and then queries the database to obtain a list of the acquisitions. If self.finder does not exist, then it creates a finder object, restricts the time range to include only src transits between self.t1 and self.t2, and then queries the database to obtain a list of the acquisitions.

get_sunfree_srcs(srcs=None)[source]

This method uses the attributes ‘night_acq_list’ and ‘acq_list’ to determine the srcs that transit in the available data. If these attributes do not exist, then the method ‘set_acq_list’ is called. If srcs is not specified, then it defaults to the brightest four radio point sources in the sky: CygA, CasA, TauA, and VirA.

set_acq_list()[source]

This method sets four attributes. The first two attributes are ‘night_finder’ and ‘night_acq_list’, which are the finder object and list of acquisitions that contain all night time data between self.t1 and self.t2. The second two attributes are ‘finder’ and ‘acq_list’, which are the finder object and list of acquisitions that contain all data beween self.t1 and self.t2 with the sunrise, sun transit, and sunset removed.

set_metadata(tms, input_map)[source]

Sets self.corr_inputs, self.pwds, self.pstns, self.p1_idx, self.p2_idx

single_source_check()[source]

Assumes self.source1 is NOT None

class ch_util.chan_monitor.FeedLocator(vis1, vis2, tm1, tm2, src1, src2, freqs, prods, inputs, pstns0, bsipts=None)[source]

Bases: object

This class contains functions that do all the computations to determine feed positions from data. It also determines the quality of data and returns a list of good inputs and frequencies.

Uppon initialization, it receives visibility data around one or two bright sources transits as well as corresponding meta-data.

Parameters:
  • vis1 (Visibility data around bright source transit)

  • [vis2] (Visibility data around bright source transit)

  • tm1 (Timestamp corresponding to vis1 [vis2])

  • [tm2] (Timestamp corresponding to vis1 [vis2])

  • src1 (Ephemeris astronomical object corresponding to the) – transit in vis1 [vis2]

  • [src2] (Ephemeris astronomical object corresponding to the) – transit in vis1 [vis2]

  • freqs (frequency axis of vis1 [and vis2])

  • prods (Product axis of vis1 [and vis2])

  • inputs (inputs loaded in vis1 [and vis2])

  • pstns0 (positions of inputs as obtained from the layout database)

  • bsipts (base inputs used to determine cross correlations loaded) – (might become unecessary in the future)

Basic initialization method

continuity_test(tol=0.2, knl=5)[source]

Call only if freqs are adjacent. Uses xdists (Earth coords) instead of c_xdists (cylinder coords) to allow for calling before ydists are computed. Doesn’t make any difference for this test. Results are used in computing y_dists.

get_c_ydist(ph1=None, ph2=None, good_freqs=None, tol=1.5, Nmax=20)[source]

N-S. Absolutelly assumes contiguous frequencies!!!

get_c_ydist_perfreq(ph1=None, ph2=None)[source]

Old N-S dists function. TO be used only in case a continuum of frequencies is not available

get_xdist(ft_prms, dec)[source]

E-W

good_prod_freq(pass_rst, tol_ch1=0.3, tol_ch2=0.7, tol_fr1=0.6, tol_fr2=0.7)[source]

Tries to determine overall bad products and overall bad frequencies from a test_pass result.

params_ft(tm, vis, dec, x0_shift=5.0)[source]
Extract relevant parameters from source transit
visibility in two steps:
  1. FFT visibility

  2. Fit a gaussian to the transform

Parameters:
  • tm (array-like) – Independent variable (time)

  • trace (array-like) – Dependent variable (visibility)

  • freq (float) – Frenquency of the visibility trace, in MHz.

  • dec (float) – Declination of source. Used for initial guess of gaussian width. Defaults to CygA declination: 0.71

Returns:

  • popt (array of float) – List with optimal parameters: [A,mu,sig2]

  • pcov (array of float) – Covariance matrix for optimal parameters. For details see documentation on numpy.curve_fit

set_good_ipts(base_ipts)[source]

Good_prods to good_ipts