Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Output from PH5toStationxml does not match resp store in PH5 Pole:PlusError== Pole:minusError==Pole:Value #471

Open
timronan opened this issue Jul 22, 2021 · 2 comments
Labels

Comments

@timronan
Copy link
Collaborator

timronan commented Jul 22, 2021

Describe the bug
PH5tostationxml is outputting stationxml files where Pole:Real:PlusError== Pole:Real:minusError==Pole:Real:Value and
Pole:Imaginary:PlusError== Pole:Imaginary:minusError==Pole:Imaginary:Value.

Here is an example:

              <Pole number="0">
                <Real minusError="-21.99" plusError="-21.99">-21.99</Real>
                <Imaginary minusError="22.43" plusError="22.43">22.43</Imaginary>
              </Pole>
              <Pole number="1">
                <Real minusError="-21.99" plusError="-21.99">-21.99</Real>
                <Imaginary minusError="-22.43" plusError="-22.43">-22.43</Imaginary>
              </Pole>
            </PolesZeros>

This is definitively occurring ph5tostationxml because if the statement print(response_file_das_a) is added to line 470 in ph5tostationxml the output from the store response file is returned to the screen which shows:

#		Complex poles:
#		  i  real          imag          real_error    imag_error
B053F15-18    0 -2.199000E+01  2.243000E+01  0.000000E+00  0.000000E+00
B053F15-18    1 -2.199000E+01 -2.243000E+01  0.000000E+00  0.000000E+00

and is what we expected based on the input response.

Environment (please complete the following information):

  • Program Version 2021.47

To Reproduce
Steps to reproduce the behavior:
Run PH5toStationxml on any PH5 experiment that has poles and zeros. Inspect the output from the Poles and zeros.

Expected behavior

#		=======================================
#		+               +--------------------------------------------+                +
#		+               |   Response (Poles & Zeros),  N301 ch DPZ   |                +
#		+               +--------------------------------------------+                +
#		
B053F03     Transfer function type:                A [Laplace Transform (Rad/sec)]
B053F04     Stage sequence number:                 1
B053F05     Response in units lookup:              M/S - velocity in meters per second
B053F06     Response out units lookup:             V - emf in volts
B053F07     A0 normalization factor:               0.999813
B053F08     Normalization frequency:               40
B053F09     Number of zeroes:                      2
B053F14     Number of poles:                       2
#		Complex zeroes:
#		  i  real          imag          real_error    imag_error
B053F10-13    0  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
B053F10-13    1  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
#		Complex poles:
#		  i  real          imag          real_error    imag_error
B053F15-18    0 -2.199000E+01  2.243000E+01  0.000000E+00  0.000000E+00
B053F15-18    1 -2.199000E+01 -2.243000E+01  0.000000E+00  0.000000E+00

Should accurately be reflected in output stationxml document.

@timronan timronan added the bug label Jul 22, 2021
@timronan timronan changed the title [BUG] [BUG] PH5toStationxml does not match embedded resp file Pole:PlusError== Pole:minusError==Pole:Value Jul 22, 2021
@timronan timronan changed the title [BUG] PH5toStationxml does not match embedded resp file Pole:PlusError== Pole:minusError==Pole:Value [BUG] Output from PH5toStationxml does not match resp store in PH5 Pole:PlusError== Pole:minusError==Pole:Value Jul 22, 2021
@timronan timronan assigned gbbofh and unassigned gbbofh Jul 27, 2021
@timronan
Copy link
Collaborator Author

dl_resp = read_inventory(buf, format="RESP")

Creates this issue and it is very likely occurring in the Obspy read_inventory.

If response_file_das_a, referenced on line 465, is printed the result is as expected:

#		=======================================
#		+               +--------------------------------------------+                +
#		+               |   Response (Poles & Zeros),  N401 ch DPZ   |                +
#		+               +--------------------------------------------+                +
#		
B053F03     Transfer function type:                A [Laplace Transform (Rad/sec)]
B053F04     Stage sequence number:                 1
B053F05     Response in units lookup:              M/S - velocity in meters per second
B053F06     Response out units lookup:             V - emf in volts
B053F07     A0 normalization factor:               0.999813
B053F08     Normalization frequency:               40
B053F09     Number of zeroes:                      2
B053F14     Number of poles:                       2
#		Complex zeroes:
#		  i  real          imag          real_error    imag_error
B053F10-13    0  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
B053F10-13    1  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
#		Complex poles:
#		  i  real          imag          real_error    imag_error
B053F15-18    0 -2.199000E+01  2.243000E+01  0.000000E+00  0.000000E+00
B053F15-18    1 -2.199000E+01 -2.243000E+01  0.000000E+00  0.000000E+00

When print(dl_resp.get_paz()) is added after line 470 and before line 471 the content below is returned:

Response type: PolesZerosResponseStage, Stage Sequence Number: 1
	From M/S (Velocity in Meters per Second) to V (Volts)
	Stage gain: 76.7144, defined at 40.00 Hz
	Transfer function type: LAPLACE (RADIANS/SECOND)
	Normalization factor: 0.999813, Normalization frequency: 40.00 Hz
	Poles: (-21.99+22.43j), (-21.99-22.43j)
	Zeros: 0j, 0j

These are inconsistent pole and zero representations.

There does not seem to be an easy method for changing the plusError and minusError for obspy_types.ComplexWithUncertainties. Please correct me if I am wrong so this issue can be overridden.

@timronan
Copy link
Collaborator Author

timronan commented Aug 10, 2021

This issue is originating in, and has been posted in Obspy, with seemingly no way to directly correct it in PH5.

obspy/obspy#2864

I am unsure how to move forwards with this issue at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants