swiss-seismological-service / scdetect

A computationally efficient earthquake detection module for SeisComP
https://scdetect.readthedocs.io
GNU Affero General Public License v3.0
15 stars 6 forks source link

Magnitudes with nan #93

Closed mmesim closed 2 years ago

mmesim commented 2 years ago

Sometimes magnitudes cannot be calculated and the scml file looks like

      <stationMagnitude publicID="StationMagnitude/20220223105303.993555.18443">
        <magnitude>
          <value>nan</value>
        </magnitude>
        <type>MRelative</type>

When I convert the scml to xml (obspy friendly version) I receive

ValueError: On StationMagnitude object: Value 'nan' for 'mag' is not a finite floating point value.

Perhaps that will cause problems in the future? I'm not sure about that, just a thought. One suggestion would be to add a crazy value like -99.99 for the magnitudes that cannot be calculated. I don't suggest -9 because if scdetecct-cc is going to be used for labquakes then -9 is a possible magnitude.

@damb thoughts?

damb commented 2 years ago

@mmesim, thanks for spotting the issue.

Instead of adding a value like -99.99, I'm in favor of not adding a station magnitude at all. What do you think?

damb commented 2 years ago

Also, could you provide your configuration in order to reproduce the issue. Thanks.

mmesim commented 2 years ago

@mmesim, thanks for spotting the issue.

Instead of adding a value like -99.99, I'm in favor of not adding a station magnitude at all. What do you think?

It is a good idea if it works in the end.

mmesim commented 2 years ago

Also, could you provide your configuration in order to reproduce the issue. Thanks.

of course. 19.test.zip

damb commented 2 years ago

Thanks @mmesim. I need to look into it and will come back.