-
Notifications
You must be signed in to change notification settings - Fork 23
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
SPECFEM3D_SAC client support depth gridsearch #237
Conversation
I modified the SPECFEM3D clients to support grid searches in depth. So far, the GFs path pointed to the SAC files GFs directly. Now, similarly as the FK client, the GFs path has to point to a directory where there are many subdirectory each of them storing the GFs for a given depth: PATH_GF/evdp/SAC_FILES. I modified the data directory and the tests scripts to work in agreement to the clients modifications.
Add event depth to EXT_FORCE GFs path.
Felix, Very useful, I think this is a big improvement. I was thinking of trying the following--
Is it alright if I make changes to your fork? thanks, |
Sure! Be my guest. Is enough Clicking in the box 'Allow edits by maintainers' to allow you to work my fork? If so, go ahead, and thanks for the help. I would like to add that to allow shallow searches, the naming of the subdirectories also had to be adjusted in the FK client that is in km so far. |
Sounds good, I will go ahead. |
Agreed, shallow searches can be helpful for underground explosions, implosions, etc. I was thinking choosing between m or km via an optional keyword argument. I believe the newly modified tgz files should continue to work fine. |
I've tried revising SPECFEM3D_SAC.py. Could you glance at it? |
I don't understand the proposed changes to SPECFEM3D_SGT.py. Doesn't the existing name convention already include depth? (see line 118) |
You are right Ryan, sorry. The SGT modifications are unnecessary since the name convention already includes the depth. I put the SGT codes (SPECFEM3D_SGT.py, test_greens_SPECFEM3D_SGT.py, and the SGT GFs directory) in their original form. |
The modification proposed to SPECFEM3D_SAC client does not apply to SGT since the latter already includes the depth in the GFs names. So, the proposed modifications to the client and test scripts, and the directory with the GFs were undone.
Sounds great, thanks Felix. Please feel free to merge whenever ready. |
SPECFEM3D_SAC.py client script was changed to support depth grid searches. In the MTUQ current version, when SPECFEM3D format is used, the path to the Green Functions (GFs) leads directly to the SAC files. Therefore, it is not possible to implement a moment tensor estimation, allowing a depth grid search. For instance, when using FK GFs, the path does not lead immediately to the SAC files but a manifold of directories named after the GFs database depth. To be consistent with the FK client, if this pull request is approved, the SPECFEM3D (SAC and SGT) GFs have to be saved in a directory named after the earthquake depth (e.g., /User/SpecfemGFs/6/*.sac if the depth of the earthquake is 6km).
The SPECMFEM3D examples data tgz files were modified (SAC and SGT) to include the earthquake depth in the directory name. For instance: SPECFEM3D_SAC/20090407201255351 would be now SPECFEM3D_SAC/20090407201255351/33
The test_greens_SPECFEM3D_SAC.py and test_greens_SPECFEM3D_SGT.py scripts were modified for setting earthquake depths rounded to the nearest integer. This is for making the creation of the corresponding GFs directory easier (e.g., for a depth of 33033.599853515625, the GFs directory had to end in 33.0335... So, for simplicity, the depth was rounded to 33000)
The setup/code_generator.py script remains unmodified since (so far) it does not write test_greens_SPECFEM3D_SAC.py and test_greens_SPECFEM3D_SGT.py.
With these modifications, the implementation of GridSearch.DoubleCouple+Magnitude+Depth.py for SPECFEM3D GFs is straightforward and was already tested.