sigpyproc.fourierseries
sigpyproc.fourierseries¶
- class sigpyproc.fourierseries.PowerSpectrum(input_array, header)¶
Bases:
numpy.ndarrayAn array class to handle pulsar power spectrum.
- Parameters
- Returns
1 dimensional power spectra with header
- Return type
Notes
Data is converted to 32 bits regardless of original type.
- bin2freq(bin_num)¶
Return centre frequency of a given bin.
- bin2period(bin_num)¶
Return centre period of a given bin.
- freq2bin(freq)¶
Return nearest bin to a given frequency.
- period2bin(period)¶
Return nearest bin to a given periodicity.
- class sigpyproc.fourierseries.FourierSeries(input_array, header)¶
Bases:
numpy.ndarrayAn array class to handle Fourier series with headers.
- Parameters
- Returns
1 dimensional fourier series with header
- Return type
- ifft()¶
Perform 1-D complex to real inverse FFT.
- Returns
a time series
- Return type
- form_spec(interpolated=True)¶
Form power spectrum.
- Parameters
interpolated (
bool, optional) – flag to set nearest bin interpolation, by default True- Returns
a power spectrum
- Return type
- remove_rednoise(startwidth=6, endwidth=100, endfreq=1.0)¶
Perform rednoise removal via Presto style method.
- Parameters
- Returns
whitened fourier series
- Return type
- recon_prof(freq, nharms=32)¶
Reconstruct the time domain pulse profile from a signal and its harmonics.
- to_file(filename=None)¶
Write Fourier series to file in sigproc format.
- to_fftfile(basename=None)¶
Write spectrum to file in presto
.fftformat.
- classmethod read_fft(fftfile, inffile=None)¶
Read a presto format
.fftfile.- Parameters
- Returns
an array containing the whole file contents
- Return type
- Raises
IOError – If no
.inffile found in the same directory of.fftfile.
Notes
If inf is None, then the associated .inf file must be in the same directory.
- classmethod read_spec(filename)¶
Read a sigpyproc format
.specfile.- Parameters
filename (
str) – the name of the.specfile to read- Returns
an array containing the whole file contents
- Return type
Notes
This is not setup to handle
.specfiles such as are created by Sigprocs seek module. To do this would require a new header parser for that file format.