ch_util.plot

Plotting routines for CHIME data

Functions

spectra(data[, freq_sel, prod_sel, ...])

Plots spectra at different times and for different correlation products.

time_ordered(data[, freq_sel, prod_sel, ...])

Plots data vs time for different frequencies and corr-pords.

waterfall(data[, freq_sel, prod_sel, ...])

Two dimensional plot of a visibility vs time and frequency.

ch_util.plot.spectra(data, freq_sel=None, prod_sel=None, time_sel=None, part_sel=None, **kwargs)[source]

Plots spectra at different times and for different correlation products.

ch_util.plot.time_ordered(data, freq_sel=None, prod_sel=None, time_sel=None, part_sel=None, **kwargs)[source]

Plots data vs time for different frequencies and corr-pords.

ch_util.plot.waterfall(data, freq_sel=None, prod_sel=None, time_sel=None, part_sel=None, **kwargs)[source]

Two dimensional plot of a visibility vs time and frequency.

Parameters:
  • data (numpy array or AnData object) – Data to plot. If a numpy array, must be 2D or 3D.

  • freq_sel (valid numpy index) – Selects data to include along the frequency axis.

  • prod_sel (valid numpy index) – Selects data to include along the correlation product axis. If data is a 2D array, this argument is ignored.

  • time_sel (valid numpy index) – Selects data to include along the time axis.

  • part_sel (string, one of: 'real', 'imag', 'mag', 'phase' or 'complex') – Selects what part of data to plot. If ‘None’, plot real part.

Examples

>>> data = np.ones((100, 100))
>>> waterfall(data)
>>> data = andata.AnData.from_acq("...")
>>> waterfall(data, prod_sel=5, out_file='filename.png')

To make a plot normalized by a baseline of the median-filtered power spectrum averaged over 200 time bins starting at bin 0 with a median filter window of 40 bins: >>> data = andata.AnData.from_acq(”…”) >>> med_filt_arg = [‘new’,200,0,40] >>> waterfall(data, prod_sel=21, med_filt=med_filt_arg)

You can also make it save the calculated baseline to a file, by providing the filename: >>> data = andata.AnData.from_acq(”…”) >>> med_filt_arg = [‘new’,200,0,40,’base_filename.dat’] >>> waterfall(data, prod_sel=21, med_filt=med_filt_arg)

…or to use a previously obtained baseline to normalize data: (where bsln is either a numpy array or a list with length equal to the frequency axis of the data) >>> data = andata.AnData.from_acq(”…”) >>> med_filt_arg = [‘old’,bsln] >>> waterfall(data, prod_sel=21, med_filt=med_filt_arg)

To make a full day plot of 01/14/2014, rebinned to 4000 time bins: >>> data = andata.AnData.from_acq(”…”) >>> full_day_arg = [[2014,01,14],4000,’time’] >>> waterfall(data, prod_sel=21, full_day=full_day_arg)