E - A Time-Independent Experiment
This example shows how to run a realistic testing experiment (based on https://doi.org/10.4401/ag-4844) while summarizing the concepts from the previous tutorials.
TL; DR
In a terminal, navigate to floatcsep/tutorials/case_e
and type:
$ floatcsep run config.yml
After the calculation is complete, the results will be summarized in results/report.md
.
Experiment Components
The source code can be found in the tutorials/case_e
folder or in GitHub. The input structure of the experiment is:
case_e
└── models
├── gulia-wiemer.ALM.italy.10yr.2010-01-01.xml
├── meletti.MPS04.italy.10yr.2010-01-01.xml
└── zechar.TripleS-CPTI.italy.10yr.2010-01-01.xml
├── config.yml
├── models.yml
└── tests.yml
Note
This experiment has only a subset of the original models and evaluations.
Configuration
Time
The time configuration is manifested in the
time-config
inset.time_config: start_date: 2010-1-1T00:00:00 end_date: 2022-1-1T00:00:00 intervals: 4 growth: cumulative
Region
The testing region is the official Italy CSEP Region obtained from
csep.core.regions.italy_csep_region
.region_config: region: italy_csep_region mag_min: 5.0 mag_max: 9.0 mag_bin: 0.1 depth_min: -2 depth_max: 30
Catalog
The catalog is obtained from an authoritative source, namely the Bollettino Sismico Italiano (http://terremoti.ingv.it/en/bsi ), using the function
csep.query_bsi()
catalog: query_bsi
Models
The models are set in
models.yml
. For simplicity, there are only three of the nineteen models originally submitted to the Italy Experiment.- ALM: path: models/gulia-wiemer.ALM.italy.10yr.2010-01-01.xml forecast_unit: 10 store_db: True - MPS04: path: models/meletti.MPS04.italy.10yr.2010-01-01.xml forecast_unit: 10 store_db: True - TripleS-CPTI: path: models/zechar.TripleS-CPTI.italy.10yr.2010-01-01.xml forecast_unit: 10 store_db: TrueThe
.xml
format is automatically detected and parsed byfloatcsep
readers.Important
The forecasts are defined in
[Earthquakes / 10-years]
, which is specified with theforecast_unit
option (The default is forecast_unit: 1).Note
The
use_db
flag allowsfloatcsep
to transform the forecasts into a database (HDF5), which speeds up the calculations.
Post-Process
Additional options for post-processing can set using the
postprocess
option. Here, we customize the forecasts plotting with:postprocess: plot_forecasts: cmap: magma region_border: True basemap: stock_img clabel_fontsize: 14 cticks_fontsize: 12 alpha_exp: 0.8 catalog: legend: True legend_loc: 1 legend_fontsize: 14 legend_titlesize: 16 markersize: 7The forecasts are plotted and stored in
tutorials/case_e/results/{timewindow}/forecasts/
. Seeplot_spatial_dataset()
for forecast plotting options andplot_catalog()
for the catalog placed on top of those plots.
Running the experiment
The experiment can be run by navigating to the
tutorials/case_e
folder in the terminal and typing.$ floatcsep run config.ymlThis will automatically set all the calculation paths (testing catalogs, evaluation results, figures) and will create a summarized report in
results/report.md
.
Plot command
If only the result plots are desired when the calculation was already completed before, you can type:
$ floatcsep plot config.ymlThis can be used, for example, when an additional plot is desired without re-running the entire experiment. Try adding the following line to the
postprocess
inset of theconfig.yml
file.postprocess: plot_forecasts: colormap: magmaand re-run with the
plot
command. A forecast figure will re-appear inresults/{window}/forecasts
with a different colormap. Additional forecast and catalog plotting options can be found in thecsep.utils.plots.plot_spatial_dataset()
andcsep.utils.plots.plot_catalog()
pycsep
functions.