|
1 | 1 | # Hamlet: Hazard Model Evaluation and Testing |
2 | 2 |
|
3 | | -Hamlet (`openquake.hme`) is a Python package developed (OK, in |
4 | | -development) for qualitative and quantitative evaluation of |
5 | | -Probabilistic Seismic Hazard Analysis (PSHA) models, with the intention |
6 | | -of providing feedback to modelers during the model construction process, |
7 | | -to aid model development. Hamlet is developed by the [GEM |
| 3 | +Hamlet (`openquake.hme`) is a Python package for qualitative and quantitative |
| 4 | +evaluation of Probabilistic Seismic Hazard Analysis (PSHA) models, with the |
| 5 | +intention of providing feedback to modelers during the model construction |
| 6 | +process, to aid model development. Hamlet is developed by the [GEM |
8 | 7 | Foundation](https://www.globalquakemodel.org), and uses the |
9 | 8 | [OpenQuake](https://github.com/GEM/oq-engine) software extensively. |
10 | 9 |
|
11 | | -Hamlet will incorporate several model test frameworks, including those |
12 | | -developed by GEM and some of those developed outside of GEM such as the |
13 | | -[RELM](http://cseptesting.org/documents/relm.php) tests. Currently, and |
14 | | -likely in the future, the model files will be required to be in the |
15 | | -[OpenQuake](https://github.com/GEM/oq-engine) format, regardless of the |
16 | | -format of their original implementation. |
17 | | - |
18 | | -Most of the Hamlet evaluations are spatial in nature; the model domain |
19 | | -is discretized into grid cells, and comparisons between observations and |
20 | | -model predictions are performed in each grid cell, to highlight where in |
21 | | -the domain the model matches the observations, and where it might need |
22 | | -some refinement. |
23 | | - |
24 | | -Additionally, unlike some other hazard model testing frameworks, Hamlet |
25 | | -is designed to operate on separate components of a hazard model, so that |
26 | | -each component can be evaluated against its corresponding data. For |
27 | | -example, each branch of a source model logic tree can be tested |
28 | | -independently, and each type of source (e.g., subduction megathrust, |
29 | | -crustal, in-slab) can be tested independently as well, in the spatial |
30 | | -framework described above. |
| 10 | +Hamlet incorporates several model test frameworks, including those developed by |
| 11 | +GEM and some of those developed outside of GEM such as the |
| 12 | +[RELM/CSEP](http://cseptesting.org/documents/relm.php) tests. The model files |
| 13 | +must be in the [OpenQuake](https://github.com/GEM/oq-engine) format. |
| 14 | + |
| 15 | +Most of the Hamlet evaluations are spatial in nature; the model domain is |
| 16 | +discretized into grid cells, and comparisons between observations and model |
| 17 | +predictions are performed in each grid cell, to highlight where in the domain |
| 18 | +the model matches the observations, and where it might need some refinement. |
| 19 | + |
| 20 | +Additionally, unlike some other hazard model testing frameworks, Hamlet is |
| 21 | +designed to operate on separate components of a hazard model, so that each |
| 22 | +component can be evaluated against its corresponding data. For example, each |
| 23 | +branch of a source model logic tree can be tested independently, and each type |
| 24 | +of source (e.g., subduction megathrust, crustal, in-slab) can be tested |
| 25 | +independently as well, in the spatial framework described above. |
31 | 26 |
|
32 | 27 | ## Quickstart |
33 | 28 |
|
34 | 29 | ### Installation |
35 | 30 |
|
36 | | -Hamlet requires installation Python v.3.7+, the |
37 | | -[OpenQuake](https://github.com/GEM/oq-engine) engine, and some |
38 | | -additional dependencies as well. These are specified in the |
39 | | -`requirements.txt` file. |
40 | | - |
41 | | -(*Note:* A few of the dependencies might be challenging to install. |
42 | | -These are [Rtree](https://toblerity.org/rtree/) and |
43 | | -[h3-py](https://github.com/uber/h3-py). You may have to install |
44 | | -`libspatialindex` or `libspatialindex-dev` on Linux or MacOS first, |
45 | | -depending on your system, for `Rtree`. `h3-py` requires `cc` and `make`, |
46 | | -but then on Linux/MacOS can be installed easily. Please see the |
47 | | -documentation for each.) |
48 | | - |
49 | | -First, install the [OpenQuake](https://github.com/GEM/oq-engine) engine, |
50 | | -following directions on that website. You probably want to install it |
51 | | -into a virtual environment, and you may even want to have a separate |
52 | | -virtual environment for running Hamlet than the |
53 | | -[OpenQuake](https://github.com/GEM/oq-engine) virtual environment that |
54 | | -you normally use (this is up to you). |
| 31 | +Hamlet requires Python 3.11+ and the |
| 32 | +[OpenQuake](https://github.com/GEM/oq-engine) engine. |
| 33 | + |
| 34 | +First, install the OpenQuake engine, following directions on that website. You |
| 35 | +probably want to install it into a virtual environment. |
55 | 36 |
|
56 | 37 | Then, clone the Hamlet repository, and from that directory, install the |
57 | 38 | requirements: |
58 | 39 |
|
59 | 40 | ```bash |
60 | | - pip install -r requirements.txt |
| 41 | +pip install -r requirements.txt |
61 | 42 | ``` |
62 | 43 |
|
63 | 44 | and then install Hamlet: |
64 | 45 |
|
65 | 46 | ```bash |
66 | | - pip install -e . |
| 47 | +pip install -e . |
67 | 48 | ``` |
68 | 49 |
|
69 | 50 | ### Running Hamlet |
70 | 51 |
|
71 | | -Hamlet only requires a seismic hazard model (implemented in |
72 | | -[OpenQuake](https://github.com/GEM/oq-engine)) and a processed seismic |
73 | | -catalog (declustered, and ideally classified by source type) to run. |
74 | | -Once installed, Hamlet can be run from the command line: |
| 52 | +Hamlet requires a seismic hazard model (implemented in OpenQuake) and a |
| 53 | +processed seismic catalog (declustered, and ideally classified by source type) |
| 54 | +to run. Once installed, Hamlet can be run from the command line: |
75 | 55 |
|
76 | 56 | ```bash |
77 | | - hamlet test_model.yml |
| 57 | +hamlet test_model.yml |
78 | 58 | ``` |
79 | 59 |
|
80 | | -`test_model.yml` is a configuration file in |
81 | | -[YAML](https://yaml.org) format that specifies the source model, seismic |
82 | | -catalog, tests to be run, and other variables and parameters. |
| 60 | +`test_model.yml` is a configuration file in [YAML](https://yaml.org) format |
| 61 | +that specifies the source model, seismic catalog, tests to be run, and other |
| 62 | +variables and parameters. |
83 | 63 |
|
84 | 64 | ## Documentation |
85 | 65 |
|
86 | | -Hamlet documentation can currently be found at |
87 | | -https://cossatot.gitlab.io/hamlet/ . |
| 66 | +Hamlet documentation can be found at |
| 67 | +https://gemsciencetools.github.io/hamlet/ . |
0 commit comments