コード例 #1
0
def subint_signal():
    """
    Fixture for signal class
    - Makes a subintegrated signal
    """
    fbsubsig = FilterBankSignal(1400, 400, fold=True)
    return fbsubsig
コード例 #2
0
ファイル: test_io.py プロジェクト: paulthebaker/PsrSigSim
def signal():
    """
    Fixture signal class
    """
    fbsig = FilterBankSignal(1400,400,Nsubband=2,\
                             sample_rate=186.49408124993144*2048*10**-6,\
                             sublen=0.5)
    return fbsig
コード例 #3
0
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
コード例 #4
0
def fbsignal():
    """
    Fixture signal class
    """
    fbsig = FilterBankSignal(1400,400,Nsubband=2,\
                             sample_rate=1.0*2048*10**-6,\
                             sublen=0.5)
    return fbsig
コード例 #5
0
def signal():
    """
    Fixture signal class
    """
    fbsig = FilterBankSignal(1400,
                             400,
                             fold=False,
                             sample_rate=(1.0 / 0.005) * 2048 * 10**-6)
    return fbsig
コード例 #6
0
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)
コード例 #7
0
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()
コード例 #8
0
ファイル: test_io.py プロジェクト: paulthebaker/PsrSigSim
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)
コード例 #9
0
ファイル: test_ism.py プロジェクト: natazipper/PsrSigSim
def signal():
    """
    Fixture signal class
    """
    fbsig = FilterBankSignal(1400, 400)
    return fbsig
コード例 #10
0
ファイル: test_ism.py プロジェクト: paulthebaker/PsrSigSim
def S_lowchan():
    """
    Fixture signal class
    """
    fbsig = FilterBankSignal(1400, 400, Nsubband=10)
    return fbsig