Skip to content

Class Stage

Luis Arean edited this page Mar 24, 2021 · 28 revisions

Description

Stages are discrete units in the block diagram of an electronic circuit which perform a specific function and is usually physically circumscribed to a printed board. An instrument component in obsinfo is usually composed of several chained stages which connect the output of one stage to the input of the next one.

Python class:

Stage

YAML / JSON label:

Unnamed element of response_stages array. The array itself has a label stages

Corresponding StationXML structure

Stage

Object Hierarchy

Superclass

OBSMetadata - All classes which include methods which need to read info files inherit those methods from this class. It is quite irrelevant to end users.

Subclasses

None

Relationships

Attributes

Name Type Required Default Equivalent StationXML Remarks
name string N None e.g. FIR. name In StationXML this attribute is at the filter (PZ, Coeff, FIR, etc.) level.
description string N None e.g. FIR. Description In StationXML this attribute is in the filter (PolesZeros, Coefficients, FIR, etc.)
input_units IRISUnits Y None e.g. FIR. InputUnits In StationXML this attribute is at the filter (PZ, Coeff, FIR, etc.) level.
output_units IRISUnits Y None e.g. FIR. OutputUnits In StationXML this attribute is at the filter (PZ, Coeff, FIR, etc.) level.
gain:   Y None StageGain  
  • frequency
number Y None Frequency In Hertz
  • value
number Y None Value  
filter Filter Y None None No filter attribute in StationXML. Individual filters are subsumed in Stage.
calibration_date date N None None In StationXML this attribute is only found at the equipment level.
decimation_factor number N 1.0 Decimation. Factor  
input_sample_rate number Y None Decimation. InputSampleRate  
delay number N 0.0 Decimation. Delay If not set, will be calculated as filter.offset / input_sample_rate
polarity string with values "+" and "-" Y None None "+" = counts increase when the input voltage increase, "-" otherwise.

Calculated Attributes

These attributes do not exist in the YAML/JSON file. They are or may be calculated programmatically to feed corresponding values in the StationXML file or for other purposes.

Name Type Default Equivalent StationXML Remarks
stage_sequence_number integer 0 number  
correction number 0.0 Decimation.Correction This value is calculated as a function of delay_correction in class Datalogger. If delay.correction exists correction=0 for all stages but the last, which has value = delay.correction. If it does not exist, correction = delay.
output_sample_rate number 0.0 None  

Methods

  • output_sample_rate()
"""
Returns calculated attribute output_sample_rate

"""

  • calculate_delay()
"""

Calculates delay as a function of object for digital filters if delay not specified Otherwise, uses delay as passed in the arguments Also applies delay_correction in the following way:

  • correct is a dict with two keys, "apply" and "value".
  • If apply == False, correct is not applied and self.correction values are made equal to delay values
  • If apply == True, self.correction will be 0 except for the last stage, which will be correct.value but is set elsewhere (in Response_stages).

"""

  • to_obspy()
"""
Returns equivalent obspy response stage. This is the first level where this is invoked.

"""

JSON schema

/larean/obsinfo/blob/V0.108/obsinfo/data/schemas/stage.schema.json

/larean/obsinfo/blob/master/obsinfo/data/schemas/definitions.schema.json

Example

Stage information file /larean/obsinfo/blob/V0.108/obsinfo/_examples/Information_Files/instrumentation/dataloggers/responses/CS5321_FIR3.stage.yaml .

---
format_version: "0.108"
revision:
   date: "2017-11-30"
   authors:
       -   $ref: "../../authors/Wayne_Crawford.author.yaml#author"

notes: ["From CS5322_Filter.pdf"]
stage:
   decimation_factor : 2
   gain :         {value: 1, frequency: 0}
   input_units :  { name : "counts", description: "Digital Counts"}

   description : "DECIMATION - CS5322 FIR3 (linear phase)"
   filter:
       $ref: "FIR/CirrusLogic_CS5322_FIR3.filter.yaml#filter"
   extras:
       DBIRD_response_type : "THEORETICAL"

Class Navigation

Class ResponseStages <==> Class Filter

Clone this wiki locally