burstfit.data
BurstData Objects
class BurstData(Candidate)
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 candidatetcand
float - start time of the candidate in seconds at the highest frequency channelwidth
int - pulse width of the candidate in samplessnr
float - Signal to Noise Ratiomin_samp
int - Minimum number of time sampleskill_mask
numpy.ndarray - Boolean mask of channels to killspectral_kurtosis_sigma
float - Sigma for spectral kurtosis filtersavgol_frequency_window
float - Filter window for savgol filtersavgol_sigma
float - Sigma for savgol filterflag_rfi
bool - To turn on RFI flagging
prepare_data
| def prepare_data(mask_chans=[], time_window=200e-3, normalise=True)
Prepares data for burst fitting
Arguments:
mask_chans
- list with tuples (start_freq, end_freq) and channel numbers to masktime_window
- time window (s) around the burst to use for burst fittingnormalise
- To normalise the mean and std of the data using an off pulse region
Returns:
nstart
| @property
| def nstart()
Returns: start sample number of the spectrogram
mask
| @property
| def mask()
Returns: Channel mask array using all the available masks
prepare_input_mask
| def prepare_input_mask(mask_chans=[])
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()
Apply channel mask to the dedispersed data
Returns:
normalise_data
| def normalise_data(on_pulse_data, off_pulse_data, return_clip_fac=True)
Function to normalise data
Arguments:
on_pulse_data
- Data to normaliseoff_pulse_data
- Data to use to estimate mean and stdreturn_clip_fac
- To return the clipping factor, decided using nbits of data
Returns:
crop_dedispersed_data
| def crop_dedispersed_data(time_window)
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: