sigpyproc.foldedcube

sigpyproc.foldedcube

class sigpyproc.foldedcube.Profile(input_array)

Bases: numpy.ndarray

An array class to handle a 1-D pulse profile.

Parameters

input_array (ArrayLike) – 1-D array of a pulse profile

Returns

Pulse profile

Return type

ndarray

snr()

Calculate a rudimentary Signal-to-noise ratio for the profile.

Returns

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.

class sigpyproc.foldedcube.FoldSlice(input_array)

Bases: numpy.ndarray

An array class to handle a 2-D slice of FoldedData.

Parameters

input_array (ArrayLike) – 2-D array with phase in x axis.

Returns

2-D array array

Return type

ndarray

normalize()

Normalise the slice by dividing each row by its mean.

Returns

normalised version of slice

Return type

FoldSlice

get_profile()

Return the pulse profile from the slice.

Returns

a pulse profile

Return type

Profile

class sigpyproc.foldedcube.FoldedData(input_array, header, period, dm, accel=0)

Bases: numpy.ndarray

An array class to handle a data cube produced by any of the folding methods.

Parameters
  • input_array (ArrayLike) – 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, optional) – accleration that data was folded with, by default 0

Returns

3-D array of folded data with header metadata

Return type

ndarray

Notes

Input array should have the shape: (number of subintegrations, number of subbands, number of profile bins)

property nints

Number of subintegrations in the data cube(int, read-only).

property nbands

Number of subbands in the data cube (int, read-only).

property nbins

Number of bins in the data cube(int, read-only).

get_subint(nint)

Return a single subintegration from the data cube.

Parameters

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

Returns

a 2-D array containing the subintegration

Return type

FoldSlice

get_subband(nint)

Return a single subband from the data cube.

Parameters

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

Returns

a 2-D array containing the subband

Return type

FoldSlice

get_profile()

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

get_time_phase()

Return the data cube collapsed in frequency.

Returns

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

Return type

FoldSlice

get_freq_phase()

Return the data cube collapsed in time.

Returns

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

Return type

FoldSlice

centre()

Roll the data cube to center the pulse.

replace_nan()
update_dm(dm)

Install a new DM in the data cube.

Parameters

dm (float) – the new DM to dedisperse to

update_period(period)

Install a new folding period in the data cube.

Parameters

period (float) – the new period to fold with