sigpyproc.TimeSeries

class sigpyproc.TimeSeries.TimeSeries(input_array, header)[source]

Bases: numpy.ndarray

Class for handling pulsar data in time series.

Parameters
  • input_array (numpy.ndarray) – 1 dimensional array of shape (nsamples)

  • header (Header) – observational metadata

applyBoxcar(width)[source]

Apply a boxcar filter to the time series.

Parameters

width (int) – width in bins of filter

Returns

filtered time series

Return type

TimeSeries

Note

Time series returned is of size nsamples-width with width/2 removed removed from either end.

correlate(other)[source]

Cross correlate with another time series of the same length.

Parameters

other (numpy.ndarray) – array to correlate with

Returns

time series containing the correlation

Return type

sigpyproc.TimeSeries.TimeSeries

downsample(factor)[source]

Downsample the time series.

Parameters

factor (int) – factor by which time series will be downsampled

Returns

downsampled time series

Return type

TimeSeries

Note

Returned time series is of size nsamples//factor

fold(period, accel=0, nbins=50, nints=32)[source]

Fold time series into discrete phase and subintegration bins.

Parameters
  • period (float) – period in seconds to fold with

  • nbins (int) – number of phase bins in output

  • nints (int) – number of subintegrations in output

Returns

data cube containing the folded data

Return type

FoldedData

pad(npad)[source]

Pad a time series with mean valued data.

Parameters

npad – number of padding points

Returns

padded time series

Return type

TimeSeries

rFFT()[source]

Perform 1-D real to complex forward FFT.

Returns

output of FFTW3

Return type

FourierSeries

resample(accel, jerk=0)[source]

Perform time domain resampling to remove acceleration and jerk.

Parameters
  • accel (float) – The acceleration to remove from the time series

  • jerk (float) – The jerk/jolt to remove from the time series

  • period (float) – The mimimum period that the resampling will be sensitive to.

Returns

resampled time series

Return type

TimeSeries

runningMean(window=10001)[source]

Filter time series with a running mean.

Parameters

window (int) – width in bins of running mean filter

Returns

filtered time series

Return type

TimeSeries

Note

Window edges will be dealt with only at the start of the time series.

runningMedian(window=10001)[source]

Filter time series with a running median.

Parameters

window (int) – width in bins of running median filter

Returns

filtered time series

Return type

TimeSeries

Note

Window edges will be dealt with only at the start of the time series.

toDat(basename)[source]

Write time series in presto .dat format.

Parameters

basename (string) – file basename for output .dat and .inf files

Returns

.dat file name and .inf file name

Return type

tuple() of str()

Note

Method also writes a corresponding .inf file from the header data

toFile(filename)[source]

Write time series in sigproc format.

Parameters

filename (str) – output file name

Returns

output file name

Return type

str()