Coverage for /opt/obspy/update-docs/src/obspy/obspy/xseed/blockette/blockette041 : 93%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
Loop
""" Blockette 041: FIR Dictionary Blockette.
The FIR blockette is used to specify FIR (Finite Impulse Response) digital filter coefficients. It is an alternative to blockette [44] when specifying FIR filters. The blockette recognizes the various forms of filter symmetry and can exploit them to reduce the number of factors specified in the blockette. See Response (Coefficients) Blockette [54] for more information. """
Integer(3, "Response Lookup Key", 4), VariableString(4, "Response Name", 1, 25, 'UN_'), FixedString(5, "Symmetry Code", 1, 'U'), Integer(6, "Signal In Units", 3, xpath=34), Integer(7, "Signal Out Units", 3, xpath=34), Integer(8, "Number of Factors", 4), #REPEAT field 9 for the Number of Factors Loop("FIR Coefficient", "Number of Factors", [ Float(9, "FIR Coefficient", 14, mask='%+1.7e')], flat=True), ]
""" If number of FIR coefficients are larger than maximal blockette size of 9999 chars a follow up blockette with the same blockette id and response lookup key is expected - this is checked here. """ # convert to stream for test issues # get current lookup key # read first blockette # check next blockettes # save position # different blockette id -> break # different lookup key -> break # ok follow up blockette found - skip some unneeded fields # remaining length in current blockette # read follow up blockette and append it to temporary blockette # reposition file pointer # parse new combined temporary blockette
xml_doc.find('fir_coefficient').tag = 'FIR_coefficient'
xml.find('FIR_coefficient').tag = 'fir_coefficient'
""" Returns RESP string. """ '#\t\t+ +--------------------------------+' + \ ' +\n' + \ '#\t\t+ | FIR response,' + \ '%6s ch %s | +\n' % (station, channel) + \ '#\t\t+ +--------------------------------+' + \ ' +\n' + \ '#\t\t\n' + \ 'B041F05 Symmetry type: %s\n' \ % self.symmetry_code + \ 'B041F06 Response in units lookup: %s - %s\n'\ % (LookupCode(abbreviations, 34, 'unit_name', 'unit_lookup_code', self.signal_in_units), LookupCode(abbreviations, 34, 'unit_description', 'unit_lookup_code', self.signal_in_units)) + \ 'B041F07 Response out units lookup: %s - %s\n'\ % (LookupCode(abbreviations, 34, 'unit_name', 'unit_lookup_code', self.signal_out_units), LookupCode(abbreviations, 34, 'unit_description', 'unit_lookup_code', self.signal_out_units)) + \ 'B041F08 Number of numerators: %s\n' \ % self.number_of_factors '#\t\t i, coefficient\n' % (_i, formatRESP(self.FIR_coefficient[_i], 6)) string += '#\t\tNumerator coefficients:\n' + \ '#\t\t i, coefficient\n' string += 'B041F09 %4s %13s\n' \ % (0, formatRESP(self.FIR_coefficient, 6)) |