SeismicData / pyasdf

Python Interface to ASDF based on ObsPy
http://seismicdata.github.io/pyasdf/
BSD 3-Clause "New" or "Revised" License
52 stars 30 forks source link

unit issue #17

Closed wjlei1990 closed 8 years ago

wjlei1990 commented 8 years ago

Hi @krischer @jas11

I think we now need to make the unit in asdf file uniform.

Two things I have noticed in quakeml:

1) depth unit is meter in standard quakeml file but in CMTSOLUTION file(and specfem3d_globe) is km(kilometer) 2) For moment tensor, I think CMTSOLUTION(specfem3d_globe) is dyne/m(or something) but in standarnd quakeml file it is N/m.

By "standard quakeml" I mean the quakeml you gave me(convert from NDK file), Lion.

So do we need to keep the unit same or we add another attribute in quakeml to specify the unit?

krischer commented 8 years ago

Heyhey,

within ASDF it is uniform - QuakeML uses sane metric SI units and one cannot specify other units. When saving to or reading from ASDF one just needs to be aware of the units and convert if necessary.

The CMTSOLUTIONS files use km for the depth and dyne * cm for the moment tensor components which I always assumed are a relic from another time.

So yea - nothing to change in ASDF - one just has to be careful when converting.

Cheers

Lion

ghost commented 8 years ago

OK, I will check the writer and fix it as I think I don't convert to SI and leave SPECFEM3D units in the QuakeML.

wjlei1990 commented 8 years ago

OK. We will fix it at our side.

@jas11 Give me some time to think about how to do it in a clean way. Our calculation is heavily based on CMT files.

krischer commented 8 years ago

If you read the NDK or CMTSOLUTIONS files with ObsPy it will take care of all conversion issues - thus just adding them to ASDF with pyasdf should work without having to do anything. You only have to be careful on the side of SPECFEM.

Might also be important for the source inversion workflow.

wjlei1990 commented 8 years ago

I just checked obspy and found it supports CMTSOLUTION files now. Cool :)

I can now start using obspy instead of my own code.

krischer commented 8 years ago

If there is anything ObsPy does not read - please let me know. We want it all ;-)