E - A Time-Independent Experiment
This example shows how to run a realistic testing experiment (based on Schorlemmer et al. 2010) 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.
The experiment region, catalog, forecasts and results can be viewed in the Experiment Dashboard with:
$ floatcsep view config.yml
Experiment Components
The source code can be found in the tutorials/case_e folder or in the GitHub repository. 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-configinset.tutorials/case_e/config.ymltime_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.tutorials/case_e/config.ymlregion_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()tutorials/case_e/config.ymlcatalog: 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.tutorials/case_e/models.yml- ALM: path: models/gulia-wiemer.ALM.italy.10yr.2010-01-01.xml forecast_unit: 10 - MPS04: path: models/meletti.MPS04.italy.10yr.2010-01-01.xml forecast_unit: 10 - TripleS-CPTI: path: models/zechar.TripleS-CPTI.italy.10yr.2010-01-01.xml forecast_unit: 10The
.xmlformat is automatically detected and parsed byfloatcsepreaders.Important
The forecasts are defined in
[Earthquakes / 10-years], which is specified with theforecast_unitoption (The default is forecast_unit: 1).
Post-Process
Additional options for post-processing can set using the
postprocessoption. Here, we customize the forecasts plotting with:postprocess: plot_catalog: markercolor: blue plot_forecasts: cmap: magma region_border: True basemap: ESRI_terrain clabel_fontsize: 14 cticks_fontsize: 12 alpha_exp: 0.8 catalog: legend: True legend_loc: 1 legend_fontsize: 14The 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_efolder 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
postprocessinset of theconfig.ymlfile.postprocess: plot_forecasts: colormap: magmaand re-run with the
plotcommand. A forecast figure will re-appear inresults/{window}/forecastswith a different colormap. Additional forecast and catalog plotting options can be found in thecsep.utils.plots.plot_spatial_dataset()andcsep.utils.plots.plot_catalog()pycsepfunctions.Note
For further details on how to configure the post-process of an experiment, see:
pyCSEP under the hood
This tutorial uses floatCSEP as the orchestrator, but relies on pyCSEP for functions and objects.
Classes and functions used in this tutorial
Catalog:
csep.core.catalogs.CSEPCatalogRegion:
csep.core.regions.italy_csep_regionForecast class:
csep.core.forecasts.GriddedForecastTest functions:
Result plotting functions:
csep.utils.plots.plot_poisson_consistency_test()Where to learn pyCSEP further:
References
Schorlemmer, D., Christophersen, A., Rovida, A., Mele, F., Stucchi, M. and Marzocchi, W. (2010). Setting up an earthquake forecast experiment in Italy. Annals of Geophysics, 53(3), 1–9. doi: 10.4401/ag-4844