kujaku11 / mt_metadata

Tools for standardizing metadata, geared towards magnetotelluric (MT) data but is general enough to accommodate "any" type of metadata.
https://mt-metadata.readthedocs.io/en/latest/
MIT License
19 stars 5 forks source link

Calibrations extractable from Parkfield data #34

Closed kkappler closed 3 years ago

kkappler commented 3 years ago

Blocked by #33 #32

kkappler commented 3 years ago

32 is solved and #33 is hacked around so this issue is ready to attack.

kkappler commented 3 years ago

This is done except for the effect of the FIR filters.

We need to be careful here, because the FIR filters operate on data at differing sampling rates.

Likely we will want to compute the response for each of these filters but do so as if the filter was applied to data of the "input_sampling rate" of that stage. Which means that we need to propage the input sampling rate attribute from the obspy stage to the FIR filter.

kkappler commented 3 years ago

Adding a property to the FIR filter called decimation_input_sample_rate This property is in the obspy.core.inventory.response.FIRResponseStage that is read in from the inventory

To make this property appear in the mt_metadata filter instance we need to do the following things:

  1. We add the property to the relevant standards.json. In this case fir_filter.json
  2. We add a reference in the obspy_mapping which associates the obspy property name with the mt_metadata property name
  3. We add the property to the FIRFilter() class Technically, you only need to do (2) above. (1) is best practice and (3) may add clarity to someone reading the code.

Also, when you are working on this,

kkappler commented 3 years ago

@kujaku11 When using the json standards model for populating the filters, I couldn't find an example of how to instantiate a property to a default value. I am thinking about adding a property "decimation_active" to filters_base.py. I suppose I would make it required, and basically the behaviour I would like is that it is false unless when reading from obspy stage I observe something like stage.decimation_factor is not None, in which case I would set it to True... Something to discuss Thursday most likely

hmm, I guess the way to do it is to put "decimation_factor" into the obspy mapping and then make the @property return bool(self.decimation_factor). I'll code it on a branch and see how it goes

kkappler commented 3 years ago

Filters seem to come with symmetry "None" or "EVEN" This issue relates to #35

FIR_AD32M FIR_F96C FIR_FS2D5

kkappler commented 3 years ago

The next step here is to get clarity on symmetry. Most likely we just hstack(x, fliplr(x)) to get the whole filter.

There is ambiguity if these filters are applied from the left or the right as well. For symmetric filters it probably doesn;t matter but for the non-symmetric compare the time series and spectra of data filtered with lfilter and rfilter

Pausing to work on TFs

kkappler commented 3 years ago

symmetery handled with the help of the fdsn online manual and the pdf of the seed manual.

All calibrations now work.