sigpyproc.foldedcube#

Classes for handling folded data cubes.

This module contains the Profile and FoldedData classes for handling 1D and 3D data cubes, respectively.

Classes

FoldSlice

An array class to handle a folded 2-D data slice.

FoldedData

An array class to handle a folded 3-D data cube.

Profile

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

class sigpyproc.foldedcube.FoldSlice(data, tsamp)[source]#

Bases: object

An array class to handle a folded 2-D data slice.

Parameters:
input_arrayArrayLike

2-D array with phase in x axis.

Attributes:
data

The data slice (numpy.ndarray, read-only).

nbins

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

tsamp

The sampling time of the slice (float, read-only).

Methods

get_profile()

Return the pulse profile from the slice.

normalize()

Normalise the slice by dividing each row by its mean.

Returns:
ndarray

2-D array array

property data#

The data slice (numpy.ndarray, read-only).

property tsamp#

The sampling time of the slice (float, read-only).

property nbins#

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

normalize()[source]#

Normalise the slice by dividing each row by its mean.

Returns:
FoldSlice

normalised version of slice

get_profile()[source]#

Return the pulse profile from the slice.

Returns:
Profile

a pulse profile

class sigpyproc.foldedcube.FoldedData(data, hdr, period, dm, accel=0)[source]#

Bases: object

An array class to handle a folded 3-D data cube.

Parameters:
datandarray

3-D array of folded data

headerHeader

observational metadata

periodfloat

period that data was folded with

dmfloat

DM that data was folded with

accelfloat, optional

accleration that data was folded with, by default 0

Attributes:
data

The folded data cube (numpy.ndarray, read-only).

dm

The DM (float, read-only).

header

The observational metadata (sigpyproc.header.Header, read-only).

nbins

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

nsubbands

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

nsubints

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

period

The folding period (float, read-only).

Methods

centre()

Roll the data cube to center the pulse.

get_freq_phase()

Return the data cube collapsed in time.

get_profile()

Get the summed pulse profile from the data cube.

get_subband(nsubband)

Get a single subband from the data cube.

get_subint(nsubint)

Get a single subintegration from the data cube.

get_time_phase()

Return the data cube collapsed in frequency.

update_dm(dm)

Install a new DM in the data cube.

update_period(period)

Install a new folding period in the data cube.

replace_nan

Returns:
ndarray

3-D array of folded data with header metadata

Notes

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

property data#

The folded data cube (numpy.ndarray, read-only).

property header#

The observational metadata (sigpyproc.header.Header, read-only).

property period#

The folding period (float, read-only).

property dm#

The DM (float, read-only).

property nsubints#

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

property nsubbands#

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

property nbins#

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

get_subint(nsubint)[source]#

Get a single subintegration from the data cube.

Parameters:
nsubintint

subintegration number (n=0 is first subintegration)

Returns:
FoldSlice

a 2-D array containing the subintegration

get_subband(nsubband)[source]#

Get a single subband from the data cube.

Parameters:
nsubbandint

subband number (n=0 is first subband)

Returns:
FoldSlice

a 2-D array containing the subband

get_profile()[source]#

Get the summed pulse profile from the data cube.

Returns:
Profile

a 1-D array containing the power as a function of phase

get_time_phase()[source]#

Return the data cube collapsed in frequency.

Returns:
FoldSlice

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

get_freq_phase()[source]#

Return the data cube collapsed in time.

Returns:
FoldSlice

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

centre()[source]#

Roll the data cube to center the pulse.

replace_nan()[source]#
update_dm(dm)[source]#

Install a new DM in the data cube.

Parameters:
dmfloat

The new DM to dedisperse to

update_period(period)[source]#

Install a new folding period in the data cube.

Parameters:
periodfloat

The new period to fold with

class sigpyproc.foldedcube.Profile(data, tsamp)[source]#

Bases: object

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

Parameters:
dataArrayLike

1-D pulse profile

Attributes:
data

The pulse profile data (numpy.ndarray, read-only).

tsamp

The sampling time of the profile (float, read-only).

Methods

compute_mf

Returns:
ndarray

1-D Pulse profile

property data#

The pulse profile data (numpy.ndarray, read-only).

property tsamp#

The sampling time of the profile (float, read-only).

compute_mf(temp_kind='boxcar', nbins_max=32, spacing_factor=1.5)[source]#