Skip to content

Commit

Permalink
configs as per SRWG #2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbc committed Apr 21, 2022
1 parent 537798f commit e8d324c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
6 changes: 6 additions & 0 deletions doc/process/openquake_processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@
- see `run_oq_convert_solutionhazard.py` below


**Save an arbritrary file**

```
python3 runzi/automation/run_save_file_archive.py ~/Downloads/Floor_ADDTOT346ave-base.xml -t BG_Kiran_Floor_ADDTOT346ave-base
```



4 changes: 4 additions & 0 deletions docker/runzi-openquake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
FROM openquake/engine:latest

USER root

ADD nzshm-oq-engine-main/openquake/hazardlib/scalerel/cscaling.py /opt/openquake/lib/python3.8/site-packages/openquake/hazardlib/scalerel


RUN apt-get update
RUN apt-get install git -y
RUN apt-get install nano
Expand Down
1 change: 1 addition & 0 deletions docker/runzi-openquake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ docker run -u root -it --rm \

```
docker run -it --rm -u root \
--memory=52g --memory-swap=52g --oom-kill-disable \
--net=host --env-file environ \
-v $HOME/.aws/credentials:/home/openquake/.aws/credentials:ro \
-v $(pwd)/../../runzi/cli/config/saved_configs:/app/nzshm-runzi/runzi/cli/config/saved_configs \
Expand Down
20 changes: 10 additions & 10 deletions runzi/execute/util/oq_build_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def build_sources_xml(logic_tree_branches, source_file_mapping):

for branch in logic_tree_branches:
files = ""
branch_name = ", ".join([x[0] for x in branch])
branch_name = "|".join([x[0] for x in branch])
for source_tuple in branch:
#print(source_tuple)
name, src_id = source_tuple
Expand All @@ -99,7 +99,7 @@ def build_sources_xml(logic_tree_branches, source_file_mapping):
permutations = [
{
"CR": {
"CR_N2.3_b0.807_C4.2_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE4MA==",
"CR_N2.3_b0.807_C4.2_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE4MA=="
"CR_N8.0_b1.115_C4.1_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Nw==",
"CR_N2.3_b0.807_C4.1_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3OQ==",
"CR_N3.7_b0.929_C4.2_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE4MQ==",
Expand All @@ -114,11 +114,11 @@ def build_sources_xml(logic_tree_branches, source_file_mapping):
"HTL_b0.97_N11.6_C4_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Mw==",
"HTL_b1.3_N49.4_C4_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Mg=="
},
# "BG": {
# "floor_addtot346ave": "FILL IN THE BLANK"
# },
"BG": {
"BG_floor_addtot346ave": "RmlsZToxMDIyMzA="
},
"PY": {
"P_b0.75, N3.4_C3.9_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Ng=="
"PY_b0.75_N3.4_C3.9_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Ng=="
}
},
{
Expand All @@ -135,11 +135,11 @@ def build_sources_xml(logic_tree_branches, source_file_mapping):
"HTL_b1.3_N49.4_C4.1_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3NQ==",
"HTL_b0.97_N11.6_C4.1_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3NA=="
},
# "BG": {
# #"floor_addtot346ave": "FILL IN THE BLANK"
# },
"BG": {
"BG_floor_addtot346ave": "RmlsZToxMDIyMzA="
},
"PY": {
"P_b0.75_N3.4_C3.9_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Ng=="
"PY_b0.75_N3.4_C3.9_s1": "SW52ZXJzaW9uU29sdXRpb25Ocm1sOjEwMjE3Ng=="
}
}
]
Expand Down
8 changes: 5 additions & 3 deletions runzi/execute/util/oq_hazard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ def write(self, tofile):

nc = OpenquakeConfig(sample)\
.set_sites('NZ4')\
.set_disaggregation(True, {"num_rlz_disagg": 0})
.set_disaggregation(False, {"num_rlz_disagg": 0})

measures = ['PGA', 'SA(0.5)']
levels0 = [0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4, 4.5, 5.0]
levels1 = 'logscale(0.005, 4.00, 30)'
_4_sites_levels = [0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4, 4.5, 5.0]
_4_sites_measures = ['PGA',"SA(0.1)","SA(0.2)","SA(0.3)","SA(0.4)","SA(0.5)","SA(0.7)","SA(1.0)","SA(1.5)","SA(2.0)","SA(3.0)","SA(4.0)","SA(5.0)"]

nc.set_iml(measures, levels1)
nc.set_vs30(355)
nc.set_iml(_4_sites_measures, _4_sites_levels)
nc.set_vs30(250)

out = io.StringIO() #aother fake file
nc.write(out)
Expand Down

0 comments on commit e8d324c

Please sign in to comment.