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

MRelative: Use Network Magnitude (event magnitude) instead of Station Magnitude #118

Open
mmesim opened this issue Jul 13, 2022 · 19 comments · May be fixed by #121
Open

MRelative: Use Network Magnitude (event magnitude) instead of Station Magnitude #118

mmesim opened this issue Jul 13, 2022 · 19 comments · May be fixed by #121
Labels
enhancement New feature or request magnitude Refers to magnitude related topics

Comments

@mmesim
Copy link
Collaborator

mmesim commented Jul 13, 2022

When we compared MRelative magnitudes from scdetec-cc with other methods we observed that magnitudes are systematically overestimated. The problem was that we used StationMAgnitudes and the nearest to the source station. Recently SED introduced MLhc, which, if applied, in principle could correct this issue.

Issue 01: there is no correction for events prior to 2021 (in the database) and it is not clear when this would be done.
Issue 02: What if we deploy a station right after a Mainshock and there is no station specific correction?
Issue 03: MLhc is introduced at SED but it is network dependent and perhaps other networks do not use similar station corrections.

I think it should be good to use the network magnitude instead of station magnitude when computing MRealtive.

@damb Is it doable?

@damb
Copy link
Collaborator

damb commented Jul 13, 2022

I'm not sure whether I fully understand the issue raised.

The problem was that we used StationMagnitudes and the nearest to the source station.

It is correct that scdetect-cc uses StationMagnitudes. Whether it is the nearest to the source station depends on the detector configuration. I.e. scdetect-cc computes a StationMagnitude for each sensor location listed in the detector configuration (taking into account the corresponding StationMagnitudes from the template origin). StationMagnitudes of type MLhc are preferred of StationMagnitudes of type MLh. Finally, all StationMagnitudes are reduced to a single (Network)Magnitude.

So I see that under certain circumstances it might be preferable to take the (Network)Magnitude into account. For instance, in case the template origin is associated with N sensor locations which contributed to the final (Network)Magnitude. However, due to e.g. performance reasons a scdetect-cc detector was set up using < N sensor locations. In this case I would expect the final MRelative (network) magnitude to be biased.

@mmesim
Copy link
Collaborator Author

mmesim commented Jul 13, 2022

As I mentioned before, site corrections for specific stations are not applied routinely everywhere. In addition, in our case MLh is not corrected for events before starting using MLhc. All these result in large discrepancies between the "true" magnitude and the calculated one.

Using the network magnitude would provide a better estimate of the "true" magnitude and also we will avoid false alarms, especially in cases of induced seismicity.

@damb
Copy link
Collaborator

damb commented Jul 13, 2022

So from your description, ideally a user of scdetect-cc could configure whether to use the StationMagnitude or the template origin's (Network)Magnitude when it comes to computing MRelative. Would this help?

However, it is still not clear to me why this is only relevant for MLhc-MLh magnitudes. As far as I understand, this is a general issue.

@damb damb added the magnitude Refers to magnitude related topics label Jul 13, 2022
@mmesim
Copy link
Collaborator Author

mmesim commented Jul 13, 2022

I think the ideal would be to calculate Mrelative using only the network magnitude.

However, which is the most feasible and faster solution? To have the option to choose between station and network magnitude or use by default only the network magnitude?

@damb
Copy link
Collaborator

damb commented Jul 13, 2022

I'd opt for configurable solution with the NetworkMagnitude as the default.

@mmesim
Copy link
Collaborator Author

mmesim commented Jul 13, 2022

Agreed.

@damb damb added the enhancement New feature or request label Jul 13, 2022
@damb
Copy link
Collaborator

damb commented Jul 18, 2022

@mmesim, a question regarding the NetworkMagnitude to be used:

In the SeisComP datamodel DataModel::Magnitude is a child object of DataModel::Origin. The multiplicity is N<->1 i.e. multiple NetworkMagnitudes may be associated with a single origin. However, the preferred magnitude is defined by DataModel::Event. When it comes to selecting the NetworkMagnitude, using the event's preferred magnitude to me seems not intuitive, since this particular origin may be unrelated to the origin which is actually used for detector configuration. So, which NetworkMagnitude should be used when estimating MRelative?

@damb
Copy link
Collaborator

damb commented Jul 18, 2022

As a nother side-effect, using the DataModel::Event's preferred magnitude would involve that the DataModel::EventParameters must include

  • the DataModel::Event the template origin belongs to, and
  • the DataModel::Origin the preferred magnitude belongs to.

This is definitely a disadvantage, compared to the current implementation, which is more intuitive when it comes to EventParameters configuration.

@damb damb linked a pull request Jul 19, 2022 that will close this issue
@mmesim
Copy link
Collaborator Author

mmesim commented Jul 21, 2022

@mmesim, a question regarding the NetworkMagnitude to be used:

In the SeisComP datamodel >DataModel::Magnitude is a child object of DataModel::Origin. The multiplicity is N<->1 i.e. multiple NetworkMagnitudes >may be associated with a single origin. However, the preferred magnitude is defined by DataModel::Event. When it comes >to selecting the NetworkMagnitude, using the event's preferred magnitude to me seems not intuitive, since this particular >origin may be unrelated to the origin which is actually used for detector configuration. So, which NetworkMagnitude should >be used when estimating MRelative?

I understand that might be confusing, however, the preferred manual solution should contain the "preferred " magnitude for the given seismic network. Another issue that I see is that in case a network doesn't use MLh or MLhc, as we do. Then what magnitude is going to be selected as the reference magnitude? If we apply scdetect-cc internally then by default the preferred magnitude would be MLhc (or MLh for earlier earthquakes). Does this answer your question?

@mmesim
Copy link
Collaborator Author

mmesim commented Jul 21, 2022

As a nother side-effect, using the DataModel::Event's preferred magnitude would involve that the DataModel::EventParameters must include

  • the DataModel::Event the template origin belongs to, and
  • the DataModel::Origin the preferred magnitude belongs to.

This is definitely a disadvantage, compared to the current implementation, which is more intuitive when it comes to EventParameters configuration.

Does this mean that we have to include the EventID in the template configuration instead of the OriginID?

@damb
Copy link
Collaborator

damb commented Jul 21, 2022

Does this mean that we have to include the EventID in the template configuration instead of the OriginID?

No. This wouldn't help at all. DataModel::Event references multiple DataModel::Origins by means of DataModel::OriginReference. Optionally, it defines the preferred origin. Again, DataModel::Magnitudes are child objects of DataModel::Origin, while the preferred magnitude may be defined by the DataModel::Event.

Therefore, the lookup path is as follows:

  1. Use the origin identifier from the template configuration in order to lookup the parent DataModel::Event event.
  2. Then, query the preferred magnitude identifier from event.
  3. Loop over all child origins of event in order to fetch the preferred DataModel::Magnitude magnitude (compare with the event's preferred magnitude identifier). magnitude refers to the preferred NetworkMagnitude.

With the current implementation (#121) the type of the NetworkMagnitude is not taken into account. It is even possible to mix MRelative magnitudes estimated based on StationMagnitudes with MRelative magnitudes estimated based on the NetworkMagnitudes.

While I understand why under certain circumstances it might be better to estimate MRelative based on the NetworkMagnitude the configuration is definitely not very intuitive.

@mmesim
Copy link
Collaborator Author

mmesim commented Jul 21, 2022

So, do you want to merge it or not?

@damb
Copy link
Collaborator

damb commented Jul 21, 2022

Actually I'm not sure, yet.

Besides, I'd like to avoid some user specific hacks in the codebase.

@mmesim
Copy link
Collaborator Author

mmesim commented Jul 24, 2022

@damb
Ok, I had an epiphany! 💡 One way to decide whether the Network or Station Magnitudes is the optimal solution is to compute for the same dataset magnitudes with the two different methods. I already have results from the Station Magnitude approach (master branch). I can re-run the dataset using the feature/iss-118 and compare (i) the Frequency Magnitude distribution, (ii) and the magnitudes for the common detections (SED catalog and scdetect-cc). I hope I can do it by Tuesday or Wednesday.

@mmesim
Copy link
Collaborator Author

mmesim commented Aug 15, 2022

@damb Question
I re-compiled scdetect-cc under https://github.com/swiss-seismological-service/scdetect/tree/feature/iss-118 but I cannot get Magnitudes.

11:31:23 [warning] [detector-08::95d7132b-770a-4be8-94bd-209a648b60af] Failed to create station magnitude: failed to create magnitude processor (failed to configure template magnitude)
11:31:23 [debug] [CH.EMING..HHE] Removing time window processor: id=detector-08::2dd9a59

Thoughts?

Perhaps I need events and not origins?

@damb
Copy link
Collaborator

damb commented Aug 16, 2022

Magnitudes of type MRelative require a template magnitude to be configured. However, as the log entry states, creating the magnitude processor failed (due to a missing template magnitude). As a consequence, the station magnitude could not be computed.

I guess you wanted to compute MRelative based on the event's (preferred) NetworkMagnitude. In this case you need the event including the origin containing the (preferred) NetworkMagnitude. (Though, without your configuration it is just a guess.)

Please, also make sure that you understand the SeisComP datamodel and read and understand my comment from #118 (comment).

@mmesim
Copy link
Collaborator Author

mmesim commented Aug 16, 2022

Yes, it work when I used an input file that contained the event and the preferred origin. Thanks a lot for the input.

@damb
Copy link
Collaborator

damb commented Aug 16, 2022

Yes, it work when I used an input file that contained the event and the preferred origin. Thanks a lot for the input.

Note that it is not the preferred origin which is taken into account. Instead, it is the preferred magnitude (which may be unrelated to the preferred origin). So in order to make things work, the user is required to provide

  • the event
  • the template origin
  • the origin which contains the event's preferred magnitude.

@mmesim
Copy link
Collaborator Author

mmesim commented Jan 5, 2023

@luca-s You can check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request magnitude Refers to magnitude related topics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants