def subint_signal(): """ Fixture for signal class - Makes a subintegrated signal """ fbsubsig = FilterBankSignal(1400, 400, fold=True) return fbsubsig
def signal(): """ Fixture signal class """ fbsig = FilterBankSignal(1400,400,Nsubband=2,\ sample_rate=186.49408124993144*2048*10**-6,\ sublen=0.5) return fbsig
def fbsignal_nofold(): """ Fixture signal class """ fbsig_nofold = FilterBankSignal(1400,400,Nsubband=2,\ sample_rate=1.0*2048*10**-6,\ sublen=None, fold = False) return fbsig_nofold
def fbsignal(): """ Fixture signal class """ fbsig = FilterBankSignal(1400,400,Nsubband=2,\ sample_rate=1.0*2048*10**-6,\ sublen=0.5) return fbsig
def signal(): """ Fixture signal class """ fbsig = FilterBankSignal(1400, 400, fold=False, sample_rate=(1.0 / 0.005) * 2048 * 10**-6) return fbsig
def test_fbsignal(): """ Test Filterbank Signal class. """ # standard instantiation fbsig1 = FilterBankSignal(1400,400,Nsubband=2,\ sample_rate=186.49408124993144*2048*10**-6,\ sublen=0.5) # minimal instantiation fbsig2 = FilterBankSignal(1400,-400,Nsubband=2,\ sample_rate=None,\ sublen=None, fold=False) # Check return of self fbsig_test = fbsig1.to_FilterBank() assert (fbsig_test == fbsig1) # Check _set_draw_norm function fbsig3 = FilterBankSignal(1400,-400,Nsubband=2,\ sample_rate=None,\ sublen=None, dtype=np.int8, fold=False)
def test_fbsignal_errs(): """ Test Filterbank Signal class errors. """ # Test errors fbsig1 = FilterBankSignal(1400,400,Nsubband=2,\ sample_rate=186.49408124993144*2048*10**-6,\ sublen=0.5) with pytest.raises(NotImplementedError): fbsig1.to_RF() fbsig1.to_Baseband()
def test_moretxtfile(pulsar): """ Test a few additional lines and properties of the txtfile class. Lines to Test: 59 """ fbsig = FilterBankSignal(1400,400,Nsubband=101,\ sample_rate=186.49408124993144*2048*10**-6,\ sublen=0.5) tobs = make_quant(1, 's') pulsar.make_pulses(fbsig, tobs) # Initialize without path tf = TxtFile(path=None) tf.save_psrchive_pdv(fbsig, pulsar) os.remove("PsrSigSim_Simulated_Pulsar.ar_1.txt") os.remove("PsrSigSim_Simulated_Pulsar.ar_2.txt") # Check attribute assert (tf.tbin == 1.0 / fbsig.samprate) assert (tf.obsfreq == fbsig.fcent) assert (tf.chan_bw == fbsig.bw / fbsig.Nchan)
def signal(): """ Fixture signal class """ fbsig = FilterBankSignal(1400, 400) return fbsig
def S_lowchan(): """ Fixture signal class """ fbsig = FilterBankSignal(1400, 400, Nsubband=10) return fbsig