Exemple #1
0
 def __init__(
     self,
     fp=None,
     dm=None,
     tcand=0,
     width=0,
     label=-1,
     snr=0,
     min_samp=256,
     device=0,
     kill_mask=None,
 ):
     Your.__init__(self, fp)
     self.dm = dm
     self.tcand = tcand
     self.width = width
     self.label = label
     self.snr = snr
     self.id = f"cand_tstart_{self.tstart:.12f}_tcand_{self.tcand:.7f}_dm_{self.dm:.5f}_snr_{self.snr:.5f}"
     self.data = None
     self.dedispersed = None
     self.dmt = None
     self.device = device
     self.min_samp = min_samp
     self.dm_opt = -1
     self.snr_opt = -1
     self.kill_mask = kill_mask
     logger.debug(f"Initiated a cand object with"
                  f"dm: {self.dm}"
                  f"snr: {self.snr}"
                  f"width:{self.width}"
                  f"tcand: {self.tcand}")
Exemple #2
0
    def __init__(self, fp=None, copy_hdr=None, dm=None, tcand=0, width=0, label=-1, snr=0, min_samp=256, device=0,
                 kill_mask=None):
        """

        :param fp: Filepath of the filterbank
        :param copy_hdr: Custom header to the filterbank file
        :param dm: DM of the candidate
        :param tcand: Time of the candidate in filterbank file (seconds)
        :param width: Width of the candidate (number of samples)
        :param label: Label of the candidate (1: for FRB, 0: for RFI)
        :param snr: SNR of the candidate
        :param min_samp: Minimum number of time samples to read
        :param device: If using GPUs, device is the GPU id
        :param kill_mask: Boolean mask of channels to kill
        """
        Your.__init__(self, fp)
        self.dm = dm
        self.tcand = tcand
        self.width = width
        self.label = label
        self.snr = snr
        self.id = f'cand_tstart_{self.tstart:.12f}_tcand_{self.tcand:.7f}_dm_{self.dm:.5f}_snr_{self.snr:.5f}'
        self.data = None
        self.dedispersed = None
        self.dmt = None
        self.device = device
        self.min_samp = min_samp
        self.dm_opt = -1
        self.snr_opt = -1
        self.kill_mask = kill_mask
Exemple #3
0
 def __init__(
     self,
     fp=None,
     dm=None,
     tcand=0,
     width=0,
     label=-1,
     snr=0,
     min_samp=256,
     device=0,
     kill_mask=np.array([False]),
     spectral_kurtosis_sigma=4,
     savgol_frequency_window=15,
     savgol_sigma=4,
     flag_rfi=False,
 ):
     Your.__init__(self, fp)
     self.dm = dm
     self.tcand = tcand
     self.width = width
     self.label = label
     self.snr = snr
     self.id = f"cand_tstart_{self.tstart:.12f}_tcand_{self.tcand:.7f}_dm_{self.dm:.5f}_snr_{self.snr:.5f}"
     self.data = None
     self.dedispersed = None
     self.dmt = None
     self.device = device
     self.min_samp = min_samp
     self.dm_opt = -1
     self.snr_opt = -1
     self.kill_mask = kill_mask
     self.spectral_kurtosis_sigma = spectral_kurtosis_sigma
     self.savgol_frequency_window = savgol_frequency_window
     self.savgol_sigma = savgol_sigma
     self.flag_rfi = flag_rfi
     self.rfi_mask = np.array([False])
     logger.debug(f"Initiated a cand object with "
                  f"dm: {self.dm}, "
                  f"snr: {self.snr}, "
                  f"width:{self.width}, "
                  f"tcand: {self.tcand}")