SeismicSource / sourcespec

Earthquake source parameters from P- and S-wave displacement spectra
https://sourcespec.seismicsource.org
Other
50 stars 12 forks source link

SourceSpec Event Format #36

Closed claudiodsf closed 1 year ago

claudiodsf commented 1 year ago

This pull request adds both user-facing and internal modifications.

For the user

A new file format for entering event information: the SourceSpec Event File, based on YAML. See the documentation here.

This is introduced to help users who are not familiar with QuakeML and who are limited by entering event information in the SAC header (e.g., they want to provide a focal mechanism). See this discussion and this question.

Internal modifications

I introduced a SSPEvent() class: https://github.com/SeismicSource/sourcespec/blob/274f2704f6e17a0e20b3b02f6fcb301325f6cec6/sourcespec/ssp_event.py#L285

This class matches the SourceSpec Event File structure and replaces the Hypo() class used before. All the file parsers (e.g., from QuakeML or from Hypo71) will create objects of this class.

Also, for consistency, the Pick() class has been renamed to SSPPick() (but it's otherwise the same): https://github.com/SeismicSource/sourcespec/blob/274f2704f6e17a0e20b3b02f6fcb301325f6cec6/sourcespec/ssp_pick.py#L14

I'm calling again @krisvanneste, for revieweing this PR, since it might break your code. Please note that I bumped the minimum requirements: https://github.com/SeismicSource/sourcespec/commit/d45671b24528efac51645bb916871d4f0244e217

Thanks!

claudiodsf commented 1 year ago

I'm going to merge this.

@krisvanneste, feel free to open an issue in case you experience problems 😉.

krisvanneste commented 1 year ago

Claudio,

Sorry for my late reaction. I had a busy week and from the title I thought I would not be affected. However, when I read the full description, I realize my code will be broken. I will update my code and report back if I find any issues.

claudiodsf commented 1 year ago

No problem. Thanks!

krisvanneste commented 1 year ago

After updating my code to the new SSPEvent class, I obtain the same results as before.

claudiodsf commented 1 year ago

Great! Thanks Kris!