nenupy.undysputed.dynspec


Dynspec

Dynspec([lanefiles])

Main class to read and analyze UnDySPuTeD high-rate data.

class nenupy.undysputed.dynspec.Dynspec(lanefiles=[])[source]

Bases: object

Main class to read and analyze UnDySPuTeD high-rate data.

Parameters:

lanefiles (list) – List of *.spctra files (see lanefiles).

Added in version 1.1.0.

property beam

Select a beam index among available beams beams.

Setter:

Selected beam index. Default is 0.

Getter:

Selected beam index.

Type:

int

Added in version 1.1.0.

property beams

Array of unique beam indices recorded during the observation over the different lane files.

Getter:

Available beam indices.

Type:

ndarray

Added in version 1.1.0.

property bp_correction

Polyphase-filter introduces a band-pass response that may be corrected using one of the following methods:

  • 'none': no band-pass correction is applied,

  • 'standard': pre-computed coefficients are used to correct the bandpass,

  • 'median': the band-pass correction is actively corrected (this lead to the best results but it is the slowest method).

Setter:

Band-pass correction method (default is 'none').

Getter:

Band-pass correction method.

Type:

str

Warning

Effects of bandpass correction may depend on data quality.

_images/bandpass_corr.png

Added in version 1.1.0.

property df

Native frequency resolution.

Getter:

Frequency resolution in Hz.

Type:

Quantity

Added in version 1.1.0.

property dispersion_measure

Apply (if other than None) de-dispersion process to the data in order to compensate for the dispersion delay.

Setter:

Dispersion Measure \(\mathcal{D}\mathcal{M}\) either as float (understood as \(\rm{pc}\,\rm{cm}^{-3}\) unit) or Quantity.

Getter:

Dispersion Measure \(\mathcal{D}\mathcal{M}\) in \(\rm{pc}\,\rm{cm}^{-3}\).

Type:

Quantity or float

Added in version 1.1.0.

property dreambeam_inputs

DreamBeam inputs, if different than (None, None, None) the calibration will be applied to the data at the Lane level.

property dt

Native time resolution.

Getter:

Time resolution in seconds.

Type:

Quantity

Added in version 1.1.0.

property edge_channels_to_remove

Number of channels to remove at each subband edge. Generally, the 2 extreme channels are not taken into account.

Type:

int

property fmax

Maximal frequency recorded for the observation, over all lane file.

Getter:

Maximal frequency in MHz.

Type:

Quantity

Added in version 1.1.0.

property fmin

Minimal frequency recorded for the observation, over all lane file.

Getter:

Minimal frequency in MHz.

Type:

Quantity

Added in version 1.1.0.

property freq_range

Frequency range selection.

Setter:

Frequency range expressed as [f_min, f_max] where f_min and f_max could either be float (understood as MHz) or Quantity instances.

Getter:

Frequency range in Hz.

Type:

list

Added in version 1.1.0.

get(stokes='I')[source]

UnDySPuTeD produces four quantities: \(|\rm{XX}|^2\), \(|\rm{YY}|^2\), \(\operatorname{Re}(\rm{XY}^*)\), \(\operatorname{Im}(\rm{XY}^*)\). They are used to compute the four Stokes parameters (\(\rm{I}\), \(\rm{Q}\), \(\rm{U}\), \(\rm{V}\)) and the linear polarization \(\rm{L}\):

\[\rm{I} = |\rm{XX}|^2 + |\rm{YY}|^2\]
\[\rm{Q} = |\rm{XX}|^2 - |\rm{YY}|^2\]
\[\rm{U} = 2 \operatorname{Re}(\rm{XY}^*)\]
\[\rm{V} = 2 \operatorname{Im}(\rm{XY}^*)\]
\[\rm{L} = \sqrt{\rm{Q}^2 + \rm{U}^2}\]
Parameters:

stokes (str) – Stokes parameter to return (case insensitive). Allowed values are 'I', 'Q', 'U', 'V', 'L', 'XX', 'YY'. Default is 'I'.

Returns:

Return type:

SData

Added in version 1.1.0.

property jump_correction

Correct or not the known 6-minute gain jumps due to analogical Mini-Array pointing orders.

Setter:

6-min jump correction.

Getter:

6-min jump correction.

Type:

bool

Added in version 1.1.0.

property lanefiles

UnDySPuTeD time-frequency files input (i.e. one file per lane) that are stored in the attribute lanes as _Lane instances.

Subsequent selections in time, frequency, beam and data operation processes will be run on these files while querying only those required. It means that any file listed in input is not necessarily read, and therefore having more files in input than needed does not increase memory usage or computing time.

Setter:

list of '*.spectra' files.

Getter:

list of '*.spectra' files.

Type:

list

Example:
>>> from nenupy.undysputed import Dynspec
>>> ds = Dynspec(
        lanefiles=['lane_0.spectra', 'lane_0.spectra']
    )
>>> ds.lanefiles
['/path/to/lane_0.spectra', '/path/to/lane_0.spectra']

Warning

Files are checked to belong to the same observation based on their prefix.

Added in version 1.1.0.

property nchan

Native number of channels per subband.

Type:

int

property rebin_df

Averaged data frequency step. If None data will not be frequency-averaged.

Setter:

Frequency step (in MHz is not unit is provided).

Getter:

Frequency step in Hz.

Type:

Added in version 1.1.0.

property rebin_dt

Averaged data time step. If None data will not be time-averaged.

Setter:

Time step (in sec if no unit is provided).

Getter:

Time step in seconds.

Type:

Quantity or float

Added in version 1.1.0.

property rfi_std_threshold

Select the background standard deviation factor above which the data is considered to be Radio Frequency Interference.

By default, or if set to 0, nothing happens. Otherwise, a time-frequency background \(\mathbf{B}\) is computed, and everything that exceeds \(\mathbf{B} + n \sigma(\mathbf{B})\) is set to NaN, where \(n\) is the rfi_std_threshold and \(\sigma(\mathbf{B})\) is the backgroun’s standard deviation.

Type:

float

property rotation_measure
property time_range

Time range selection.

Setter:

Time range expressed as [t_min, t_max] where t_min and t_max could either be str (ISO or ISOT formats) or Time instances.

Getter:

Time range in UNIX unit.

Type:

list

Added in version 1.1.0.

property tmax

End-time of the whole observation.

Getter:

Maximal observation time.

Type:

Time

Added in version 1.1.0.

property tmin

Start time of the whole observation.

Getter:

Minimal observation time.

Type:

Time

Added in version 1.1.0.

write_hdf5(file_name, stokes=['I'], beams=[0], **metadata)[source]

Save a NenuFAR dynamic spectrum from the Dynspec class. The processing pipeline set up in the dynspec object is then run before saving everything in a HDF5 file.

Parameters:
  • file_name (str) – Name of the HDF5 to store.

  • stokes (list of str) – List of Stokes parameters to store. Each Stokes parameter should be written as if given to the get() method. Default is ["I"].

  • metadata – Any additional metadata to be written as the HDF5 root attributes.

Beams:

List of beam indices to store. This will make use of the beam attribute. Default value is [0].