ziyixi / pyfk

PyFK is the python implementation of FK used to calculate the Green's function and the synthetic waveforms for the 1D Earth model.
https://pyfk.ziyixi.science
Apache License 2.0
50 stars 13 forks source link

Issue regarding multiplying 1e-19 to make the input moment tensor components equal to the gcmt solution. #2

Closed VioletaSeo closed 3 years ago

VioletaSeo commented 3 years ago

Hi. While using the function _update_source_mechanism of the class SourceModel to update given source mechanism with desired input values, I found that you used the formula below for the conversion to gcmt format.

            m_zz = tensor.m_rr * 1e-19
            m_xx = tensor.m_tt * 1e-19
            m_yy = tensor.m_pp * 1e-19
            m_xz = tensor.m_rt * 1e-19
            m_yz = -tensor.m_rp * 1e-19
            m_xy = -tensor.m_tp * 1e-19

In fact, I wondered if it is the general formula that works for every EQ in the gcmt catalog. Obviously, this conversion rule works for the test sample given in the tutorial, but when I tried it with the other earthquakes with different exponents, it seemed the resulting amplitude of synthetics differed by exponent of 10 when compared to the result computed by FK. If it's okay, can you check this? Or is there any references regarding such a conversion (I had no luck finding any)?

Also, I think the convenience of original FK code is that it accepts the input in the format of (strike, dip, rake) when computing the synthetics. It is just my recommendation but it would be super nice if pyfk also accepts such format.

ziyixi commented 3 years ago

Hi Lucas,

Thanks for your comment. Based on your description, there is some bug over there, and I need to have some tests to figure out the correct way to do the conversion. In FK, the way to use the moment tensor is:

-Mmag/Mxx/Mxy/Mxz/Myy/Myz/Mzz

mag is in dyne-cm, which should be implemented correctly. The problem is that I don't know what is actually the unit of Mxx, as it's not clear in FK's description. Previously for the test CMT solution, I tried different scaling values and choose 1e-19, maybe it does not work for all the cases.

As for using (strike, dip, rake), for the source_mechanism in _update_source_mechanism, you can use a list as [Mw, strike, dip, rake], similar to -Mmag/Strike/Dip/Rake in FK. The only difference is that you have to provide (strike, dip, rake) at the same time. This implementation should be correct, as we don't do any conversion here.

VioletaSeo commented 3 years ago

Thanks for your kind explanation. I think it would be better if the way to use (strike, dip, rake) is explicitly mentioned in the documentation. Regarding the first issue, I came into mind that I probably poorly understood what the components of object tensor look like. I was originally using the pyrocko function MomentTensor to do conversion from (strike, dip, rake) to NED components and subsequently to XYZ components, but realized that the conversion is not that obvious (https://pyrocko.org/docs/current/library/examples/moment_tensor.html). So may be your conversion law is correct. However, this will not be the problem for me at this moment since I know that there is an option to directly use (strike, dip, rake).