Correlation

Python module to handle the channelization and cross-correlation of TBW and TBN data. The main python functions in this module are:

  • calcSpectra - calculate power spectra for a collection of signals
  • FXCorrelator - calculate cross power spectra for a collection of signals
  • FXStokes - calculate Stokes cross power spectra for a collection of signals

both of which have been deprecated in favor of the new C extension based routines listed below.

The main python/C extension functions in this module are:
  • SpecMaster - similar to calcSpectra but uses the _spec module for all computations and does not support automatic sub-integration
  • SpecMasterP - SpecMaster with a 64-tap uniform DFT filter bank
  • StokesMaster - similar to SpecMaster but computes all four Stokes parameters
  • FXMaster - calculate cross power spectra for a collection of signals

Each function is set up to process the signals in parallel using the multiprocessing module and accepts a variety of options controlling the processing of the data, including various window functions and time averaging.

Changed in version 1.0.1: Removed SpecMasterP.

Changed in version 1.0.0: All of the functions here now return all ‘LFFT’ channels.

Baseline Utilities

lsl.correlator.uvUtils.getBaselines(antennas, antennas2=None, IncludeAuto=False, Indicies=False)

Generate a list of two-element tuples that describe which antennae compose each of the output uvw triplets from computeUVW/computeUVTrack. If the Indicies keyword is set to True, the two-element tuples contain the indicies of the stands array used, rather than the actual stand numbers.

lsl.correlator.uvUtils.baseline2antenna(baseline, antennas, antennas2=None, BaselineList=None, IncludeAuto=False, Indicies=False)

Given a baseline number, a list of stands, and options of how the base- line listed was generated, convert the baseline number to antenna numbers. Alternatively, use a list of baselines instead of generating a new list. This utility is useful for figuring out what antennae comprise a baseline.

lsl.correlator.uvUtils.antenna2baseline(ant1, ant2, antennas, antennas2=None, BaselineList=None, IncludeAuto=False, Indicies=False)

Given two antenna numbers, a list of stands, and options to how the base- line listed was generated, convert the antenna pair to a baseline number. This utility is useful for picking out a particular pair from a list of baselines.

Computing uvw Coordinates

lsl.correlator.uvUtils.computeUVW(antennas, HA=0.0, dec=34.07, freq=49000000.0, site=<ephem.Observer date='2014/8/7 02:51:38' epoch='2000/1/1 12:00:00' lon=-107:37:40.8 lat=34:04:12.0 elevation=2133.6m horizon=0:00:00.0 temp=15.0C pressure=0.0mBar>, IncludeAuto=False)

Compute the uvw converate of a baselines formed by a collection of stands. The coverage is computed at a given HA (in hours) and declination (in degrees) for a given site. The frequency provided (in Hz) can either as a scalar or as a numpy array. If more than one frequency is given, the output is a three dimensional with dimensions of baselines, uvw, and frequencies.

Changed in version 0.4.0: Switched over to passing in Antenna instances generated by the lsl.common.station module instead of a list of stand ID numbers.

Changed in version 1.0.0: Added a keyword (site) to specify the station used for the observation.

lsl.correlator.uvUtils.computeUVTrack(antennas, dec=34.07, freq=49000000.0, site=<ephem.Observer date='2014/8/7 02:51:38' epoch='2000/1/1 12:00:00' lon=-107:37:40.8 lat=34:04:12.0 elevation=2133.6m horizon=0:00:00.0 temp=15.0C pressure=0.0mBar>)

Whereas computeUVW provides the uvw coverage at a particular time, computeUVTrack provides the complete uv plane track for a long integration. The output is a three dimensional numpy array with dimensions baselines, uv, and 512 points along the track ellipses. Unlike computeUVW, however, only a single frequency (in Hz) can be specified.

Changed in version 0.4.0: Switched over to passing in Antenna instances generated by the lsl.common.station module instead of a list of stand ID numbers.

Changed in version 1.0.0: Added a keyword (site) to specify the station used for the observation.

Polyphase Filter Bank

This module implements a uniform DFT filter bank for use in calculating spectra as an alternative to a simple FFT. The implementation here is based on: http://www.scribd.com/doc/20561850/6/Polyphase-Filter-Coef%EF%AC%81cients

Changed in version 1.0.1: Added support for using PyFFTW instead of NumPy for the FFTs

lsl.correlator.filterbank.fft(signal, N, P=1, window=<function noWindow at 0x50f3cf8>)

FFT-based poly-phase filter bank for creating N channels with P taps. Optionally, a window function can be specified using the ‘window’ keyword. See lsl.correlator.fx.calcSpectra for details on using window functions.

lsl.correlator.filterbank.fft2(signal, N, window=<function noWindow at 0x50f3cf8>)

Sub-type of lsl.correlator.filterbank.fft that uses two taps.

lsl.correlator.filterbank.fft4(signal, N, window=<function noWindow at 0x50f3cf8>)

Sub-type of lsl.correlator.filterbank.fft that uses four taps.

lsl.correlator.filterbank.fft8(signal, N, window=<function noWindow at 0x50f3cf8>)

Sub-type of lsl.correlator.filterbank.fft that uses eight taps.

lsl.correlator.filterbank.fft16(signal, N, window=<function noWindow at 0x50f3cf8>)

Sub-type of lsl.correlator.filterbank.fft that uses 16 taps.

lsl.correlator.filterbank.fft32(signal, N, window=<function noWindow at 0x50f3cf8>)

Sub-type of lsl.correlator.filterbank.fft that uses 32 taps.

FX Correlator

lsl.correlator.fx.noWindow(L)

Default “empty” windowing function for use with the various routines. This function returned a numpy array of ‘1’s of the specified length.

lsl.correlator.fx.FXMaster(signals, antennas, LFFT=64, Overlap=1, IncludeAuto=False, verbose=False, window=<function noWindow at 0x50f3cf8>, SampleRate=None, CentralFreq=0.0, Pol='XX', GainCorrect=False, ReturnBaselines=False, ClipLevel=0, phaseCenter=(0.0, 90.0))

A more advanced version of FXCorrelator for TBW and TBN data. Given an 2-D array of signals (stands, time-series) and an array of stands, compute the cross-correlation of the data for all baselines. Return the frequencies and visibilities as a two-elements tuple.

Changed in version 0.4.0: Switched over to passing in Antenna instances generated by the lsl.common.stations module instead of a list of stand ID numbers.

Changed in version 1.0.0: Added a phase-center keyword that accept a two-element tuple of azimuth and elelvation (in degrees) to change where the correlations are phased to

lsl.correlator.fx.FXStokes(signals, antennas, LFFT=64, Overlap=1, IncludeAuto=False, verbose=False, window=<function noWindow at 0x50f3cf8>, SampleRate=None, CentralFreq=0.0, GainCorrect=False, ReturnBaselines=False, ClipLevel=0, phaseCenter=(0.0, 90.0))

A more advanced version of FXCorrelator for TBW and TBN data. Given an 2-D array of signals (stands, time-series) and an array of stands, compute the cross-correlation of the data for all baselines. Return the frequencies and visibilities as a two-elements tuple.

Changed in version 1.0.0: Added a phase-center keyword that accept a two-element tuple of azimuth and elelvation (in degrees) to change where the correlations are phased to

Table Of Contents

Previous topic

Computing Spectra

Next topic

Imaging

This Page