nenupy.io.tf_utils.compute_spectra_frequencies

nenupy.io.tf_utils.compute_spectra_frequencies(subband_start_hz, n_channels, frequency_step_hz)[source]

Compute the frequency axis of a time-frequency file. Re-construct the whole frequency range, knowing the starting frequency of each sub-band, the number of channels per sub-band and the frequency resolution.

Parameters:
  • subband_start_hz (ndarray) – Array of sub-band starting frequencies

  • n_channels (int) – Number of channels per subband

  • frequency_step_hz (float) – Frequency resolution in Hz

Returns:

The frequency array (Dask format), in Hz

Return type:

Array

Example

>>> from nenupy.io.tf_utils import compute_spectra_frequencies
>>> import astropy.units as u

>>> sb_start_freq = [50.1953125, 50.390625, 50.5859375, 50.781250] * u.MHz
>>> n_channels = 16
>>> df = 12.20703125 * u.kHz
>>> freq_axis = compute_spectra_frequencies(
        subband_start_hz=sb_start_freq.to_value(u.Hz),
        n_channels=n_channels,
        frequency_step_hz=df.to_value(u.Hz)
    )
>>> freq_axis.compute()
array([50097656.25, 50109863.28125,....50854492.1875, 50866699.21875])