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-config inset.

tutorials/case_e/config.yml
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.

tutorials/case_e/config.yml
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()

tutorials/case_e/config.yml
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.

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: 10

The .xml format is automatically detected and parsed by floatcsep readers.

Important

The forecasts are defined in [Earthquakes / 10-years], which is specified with the forecast_unit option (The default is forecast_unit: 1).

Post-Process

Additional options for post-processing can set using the postprocess option. 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: 14

The forecasts are plotted and stored in tutorials/case_e/results/{timewindow}/forecasts/. See plot_spatial_dataset() for forecast plotting options and plot_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.yml

This 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.yml

This 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 the config.yml file.

postprocess:
  plot_forecasts:
    colormap: magma

and re-run with the plot command. A forecast figure will re-appear in results/{window}/forecasts with a different colormap. Additional forecast and catalog plotting options can be found in the csep.utils.plots.plot_spatial_dataset() and csep.utils.plots.plot_catalog() pycsep functions.

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

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