Esempio n. 1
0
def make_stationxml_response(presponse, input_unit, output_unit):
    norm_factor = 1.0 / float(
        abs(presponse.evaluate(num.array([1.0]))[0] / presponse.constant))

    pzs = fs.PolesZeros(pz_transfer_function_type='LAPLACE (RADIANS/SECOND)',
                        normalization_factor=norm_factor,
                        normalization_frequency=fs.Frequency(1.0),
                        zero_list=[
                            fs.PoleZero(real=fs.FloatNoUnit(z.real),
                                        imaginary=fs.FloatNoUnit(z.imag))
                            for z in presponse.zeros
                        ],
                        pole_list=[
                            fs.PoleZero(real=fs.FloatNoUnit(z.real),
                                        imaginary=fs.FloatNoUnit(z.imag))
                            for z in presponse.poles
                        ])

    pzs.validate()

    stage = fs.ResponseStage(number=1,
                             poles_zeros_list=[pzs],
                             stage_gain=fs.Gain(presponse.constant /
                                                norm_factor))

    resp = fs.Response(instrument_sensitivity=fs.Sensitivity(
        value=stage.stage_gain.value,
        input_units=fs.Units(input_unit),
        output_units=fs.Units(output_unit)),
                       stage_list=[stage])

    return resp
Esempio n. 2
0
def pblock_061(content):
    stage_number = int(get1(content, '03'))

    fir = fs.FIR(name=get1(content, '04', optional=True),
                 input_units=fs.Units(name=punit(get1(content, '06'))),
                 output_units=fs.Units(name=punit(get1(content, '07'))),
                 symmetry=psymmetry(get1(content, '05')),
                 numerator_coefficient_list=map(pnc, getn(content, '09')))

    return stage_number, fir
Esempio n. 3
0
def pblock_054(content):
    stage_number = int(get1(content, '04'))

    cfs = fs.Coefficients(
        cf_transfer_function_type=pcftype(get1(content, '03')),
        input_units=fs.Units(name=punit(get1(content, '05'))),
        output_units=fs.Units(name=punit(get1(content, '06'))),
        numerator_list=map(pcfu, getn(content, '08-09')),
        denominator_list=map(pcfu, getn(content, '11-12')))

    return stage_number, cfs
Esempio n. 4
0
def pblock_044(content):
    stage_number = -1

    cfs = fs.Coefficients(
        cf_transfer_function_type=pcftype(get1(content, '05')),
        input_units=fs.Units(name=punit(get1(content, '06'))),
        output_units=fs.Units(name=punit(get1(content, '07'))),
        numerator_list=map(pcfu, getn(content, '09-10')),
        denominator_list=map(pcfu, getn(content, '12-13')))

    return stage_number, cfs
Esempio n. 5
0
def pblock_053(content):
    stage_number = int(get1(content, '04'))

    pzs = fs.PolesZeros(
        pz_transfer_function_type=ptftype(get1(content, '03')),
        input_units=fs.Units(name=punit(get1(content, '05'))),
        output_units=fs.Units(name=punit(get1(content, '06'))),
        normalization_factor=float(get1(content, '07')),
        normalization_frequency=fs.Frequency(value=float(get1(content, '08'))),
        zero_list=map(ppolezero, getn(content, '10-13')),
        pole_list=map(ppolezero, getn(content, '15-18')))

    for i, x in enumerate(pzs.zero_list):
        x.number = i

    for i, x in enumerate(pzs.pole_list):
        x.number = i

    return stage_number, pzs