krischer / instaseis

Instant high-frequency seismograms from an AxiSEM database
http://instaseis.net
Other
51 stars 23 forks source link

Add CMPINC and CMPAZ SAC header parameters to the server routes #56

Closed krischer closed 7 years ago

krischer commented 7 years ago

See https://github.com/iris-edu/irisws-syngine/issues/39

Can some please review and see if I got the conventions right? I interpreted CMPINC as the angle from vertical up.

manoch-iris commented 7 years ago

Lion, thanks for the fix. I tried it and using the following definitions, the values look correct to me.

CMPAZ component azimuth clockwise from north CMPINC component the angle the component makes with vertical up

IU.ANMO.SE.LXZ.sac

   CMPAZ = 0.000000e+00
  CMPINC = 0.000000e+00

IU.ANMO.SE.LXN.sac

   CMPAZ = 0.000000e+00
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXE.sac

   CMPAZ = 9.000000e+01
  CMPINC = 9.000000e+01
krischer commented 7 years ago

Great :) I'm merging - can you please also check the radial and transverse components? Then I'll cut a new release and you can incorporate it into syngine.

manoch-iris commented 7 years ago

OK, I got ZNE and ZRT from Instaseis and used SAC to convert NE to RT. The headers for R are close but the ones for T appear to be 180 degrees shifted (assuming my conversion is correct). Below is a summary of what I did:

  1. Request ZNE for an event

  2. Check CMPAZ and CMPINC (look correct)

IU.ANMO.SE.LXN.sac

   CMPAZ = 0.000000e+00
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXE.sac

   CMPAZ = 9.000000e+01
  CMPINC = 9.000000e+01
  1. Rotate to GCP

SAC> r IU.ANMO.SE.LXN.sac IU.ANMO.SE.LXE.sac SAC> rotate to GCP SAC> w IU.ANMO.SE.LXR.sac IU.ANMO.SE.LXT.sac

IU.ANMO.SE.LXR.sac

   CMPAZ = 1.520344e+02
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXT.sac

   CMPAZ = 2.420344e+02
  CMPINC = 9.000000e+01
  1. Requested ZRT for the same event

IU.ANMO.SE.LXR.sac

   CMPAZ = 1.520694e+02
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXT.sac

   CMPAZ = 6.206937e+01
  CMPINC = 9.000000e+01
krischer commented 7 years ago

Oh yea you are right - silly me - I for some reason assumed that it has to form a right-handed coordinate system with ZRT. The actual definition is right handed in ZTR - I'm not sure why that is but I fixed it in the master branch. Can please try again?

manoch-iris commented 7 years ago

Thank you Lion for the fix, looks good

  1. Installed Instaseis

  2. Requested ZRT for the same event as before

IU.ANMO.SE.LXR.sac

   CMPAZ = 1.520694e+02
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXT.sac

   CMPAZ = 2.420694e+02
  CMPINC = 9.000000e+01
  1. Previous results using SAC rotation

IU.ANMO.SE.LXR.sac

   CMPAZ = 1.520344e+02
  CMPINC = 9.000000e+01

IU.ANMO.SE.LXT.sac

   CMPAZ = 2.420344e+02
  CMPINC = 9.000000e+01
krischer commented 7 years ago

There is a new release out: https://pypi.org/project/instaseis/

The conda packages might take a while to get built.