-
Notifications
You must be signed in to change notification settings - Fork 0
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
Nshm organisational refactor #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decent work! Not that strong on some of the math side for some of the fault calculations but I'm sure it works. Just a few minor comments.
Love the documentation
aa9f1ff
we can probably merge this after @claudio525 and @sungeunbae approve. |
Sorry @claudio525, just had to switch to optional so it works on nesi 🫤 |
This PR requires ucgmsim/qcore#305 and ucgmsim/qcore#303.
This pull request represents my current vision for how I think the nshmdb should work going forward. The purpose of this tool is as follows:
To this end we now have three modules and one script.
The script has also been improved. It now uses the Python
zipfile
module to read the CRU solution zip file directly (i.e. without the user specifying the paths of the individial files). It does not extract need an extracted zip either, it's all read in binary. This means that the user does not need to understand the CRU solution zip's many undocumented files to generate the database. It is as simple as downloading the CRU solution zip file and running:$ python nshmdb/scripts/nshm_db_generator.py ~/Downloads/CRU_fault_system_solution.zip nshmdb.db
or if they've installed the package the script lives in their path so this also works
$ nshm-db-generator ~/Downloads/CRU_fault_system_solution.zip nshmdb.db
The script now gives live updates via tqdm on the database build progress (which varies from 5 minutes on my home desktop, to 15 minutes on my work desktop).
Here is an example of how you can use the new API:
The above code produces the following plot of the faults involved in the rupture.