sigpyproc.FoldedData

class sigpyproc.FoldedData.FoldSlice(input_array)[source]

Bases: numpy.ndarray

Class to handle a 2-D slice of a FoldedData instance.

Parameters

input_array (numpy.ndarray) – a 2-D array with phase in x axis.

Returns

2-D array

Return type

numpy.ndarray

getProfile()[source]

Return the pulse profile from the slice.

Returns

a pulse profile

Return type

Profile

normalise()[source]

Normalise the slice by dividing each row by its mean.

Returns

normalised version of slice

Return type

FoldSlice

class sigpyproc.FoldedData.FoldedData(input_array, header, period, dm, accel=0)[source]

Bases: numpy.ndarray

Class to handle a data cube produced by any of the sigpyproc folding methods.

Parameters
  • input_array (numpy.ndarray) – 3-D array of folded data

  • header (Header) – observational metadata

  • period (float) – period that data was folded with

  • dm (float) – DM that data was folded with

  • accel (float) – accleration that data was folded with, by default 0

Returns

3-D array of folded data with header metadata

Return type

numpy.ndarray

Notes

Data cube should have the shape: (number of subintegrations, number of subbands, number of profile bins)

centre()[source]

Try and roll the data cube to center the pulse.

getFreqPhase()[source]

Return the data cube collapsed in time.

Returns

a 2-D array containing the frequency vs. phase plane

Return type

FoldSlice

getProfile()[source]

Return a the data cube summed in time and frequency.

Returns

a 1-D array containing the power as a function of phase (pulse profile)

Return type

Profile

getSubband(n)[source]

Return a single subband from the data cube.

Parameters

n (int) – subband number (n=0 is first subband)

Returns

a 2-D array containing the subband

Return type

FoldSlice

getSubint(n)[source]

Return a single subintegration from the data cube.

Parameters

n (int) – subintegration number (n=0 is first subintegration

Returns

a 2-D array containing the subintegration

Return type

FoldSlice

getTimePhase()[source]

Return the data cube collapsed in frequency.

Returns

a 2-D array containing the time vs. phase plane

Return type

FoldSlice

updateParams(dm=None, period=None)[source]

Install a new folding period and/or DM in the data cube.

Parameters
  • dm (float, optional) – the new DM to dedisperse to, by default None

  • period (float, optional) – the new period to fold with, by default None

class sigpyproc.FoldedData.Profile(input_array)[source]

Bases: numpy.ndarray

Class to handle a 1-D pulse profile.

Parameters

input_array (numpy.ndarray) – a pulse profile in array form

Returns

pulse profile

Return type

numpy.ndarray

SN()[source]

Return a rudimentary signal-to-noise measure for the profile.

Returns

calculated signal-to-noise ratio

Return type

float

Notes

This is a bare-bones, quick-n’-dirty algorithm that should not be used for high quality signal-to-noise measurements.

retroProf(height=0.7, width=0.7)[source]

Display the profile in ASCII formay in the terminal window.

Parameters
  • height (float, optional) – fraction of terminal rows to use, by default 0.7

  • width (float, optional) – fraction of terminal columns to use, by default 0.7

Notes

This function requires a system call to the Linux/Unix stty command.