Skip to content

burstfit.data

[view_source]

BurstData Objects

class BurstData(Candidate)

[view_source]

Class to handle burst data

Arguments:

  • fp Union[str, list] - String or a list of files. It can either filterbank or psrfits files.
  • dm float - Dispersion Measure of the candidate
  • tcand float - start time of the candidate in seconds at the highest frequency channel
  • width int - pulse width of the candidate in samples
  • snr float - Signal to Noise Ratio
  • min_samp int - Minimum number of time samples
  • kill_mask numpy.ndarray - Boolean mask of channels to kill
  • spectral_kurtosis_sigma float - Sigma for spectral kurtosis filter
  • savgol_frequency_window float - Filter window for savgol filter
  • savgol_sigma float - Sigma for savgol filter
  • flag_rfi bool - To turn on RFI flagging

prepare_data

 | def prepare_data(mask_chans=[], time_window=200e-3, normalise=True)

[view_source]

Prepares data for burst fitting

Arguments:

  • mask_chans - list with tuples (start_freq, end_freq) and channel numbers to mask
  • time_window - time window (s) around the burst to use for burst fitting
  • normalise - To normalise the mean and std of the data using an off pulse region

Returns:

nstart

 | @property
 | def nstart()

[view_source]

Returns: start sample number of the spectrogram

mask

 | @property
 | def mask()

[view_source]

Returns: Channel mask array using all the available masks

prepare_input_mask

 | def prepare_input_mask(mask_chans=[])

[view_source]

Function to mask some frequency channels using input_mask, kill_mask and rfi_mask

Arguments:

  • mask_chans - list with tuples (start_freq, end_freq) and channel numbers to mask

Returns:

mask_channels

 | def mask_channels()

[view_source]

Apply channel mask to the dedispersed data

Returns:

normalise_data

 | def normalise_data(on_pulse_data, off_pulse_data, return_clip_fac=True)

[view_source]

Function to normalise data

Arguments:

  • on_pulse_data - Data to normalise
  • off_pulse_data - Data to use to estimate mean and std
  • return_clip_fac - To return the clipping factor, decided using nbits of data

Returns:

crop_dedispersed_data

 | def crop_dedispersed_data(time_window)

[view_source]

To get a cutout of data from only around the burst

Arguments:

  • time_window - time length to use on both sides of burst for the cutout

Returns: