D - Catalog Queries and Model Repositories


In a terminal, navigate to floatcsep/examples/case_d and type:

$ floatcsep run config.yml

After the calculation is complete, the results will be summarized in results/report.md.


The following example shows an experiment whose forecasts are retrieved from a repository (Zenodo - https://zenodo.org) and the testing catalog from an authoritative source web service (namely the gCMT catalog from the ISC - http://www.isc.ac.uk). The initial structure is:

    ├── config.yml
    ├── models.yml
    └── tests.yml

Once the catalog and models have been downloaded, the experiment structure will look like this:

    └──  models
        └──  team
            ├── TEAM=N10L11.csv
            ├── TEAM=N25L11.csv
        └──  wheel
            ├── WHEEL=N10L11.csv
            ├── WHEEL=N25L11.csv
    ├── config.yml
    ├── catalog.json
    ├── models.yml
    └── tests.yml


In this experiment no region file is needed, because the region is encoded in the forecasts themselves (QuadTree models, see https://zenodo.org/record/6289795 and https://zenodo.org/record/6255575 ).



The catalog inset from config.yml now makes reference to a catalog query function, in this case query_isc_gcmt().

catalog: query_gcmt

floatcsep will automatically filter the catalog to the experiment time, spatial and magnitude windows of the experiment.


Query functions exist in both pycsep and floatcsep (e.g. csep.query_comcat(), csep.query_bsi(), query_gcmt(), query_gns()). Only the name of the function is needed to retrieve the catalog. Refer to csep and floatcsep.accessors.


The model configuration is set in models.yml.

    zenodo_id: 6289795
    path: models/team
      N10L11: TEAM=N10L11.csv
      N25L11: TEAM=N25L11.csv
      N50L11: TEAM=N50L11.csv
      N100L11: TEAM=N100L11.csv
      SN10L11: TEAM=SN10L11.csv
      SN25L11: TEAM=SN25L11.csv
      SN50L11: TEAM=SN50L11.csv
      SN100L11: TEAM=SN100L11.csv
    zenodo_id: 6255575
    path: models/wheel
      N10L11: WHEEL=N10L11.csv
      N25L11: WHEEL=N25L11.csv
      N50L11: WHEEL=N50L11.csv
      N100L11: WHEEL=N100L11.csv
      SN10L11: WHEEL=SN10L11.csv
      SN25L11: WHEEL=SN25L11.csv
      SN50L11: WHEEL=SN50L11.csv
      SN100L11: WHEEL=SN100L11.csv
  • The option zenodo_id makes reference to the zenodo record id. The model team is found in https://zenodo.org/record/6289795, whereas the model wheel in https://zenodo.org/record/6255575.

  • The option flavours allows multiple model sub-classes to be quickly instantiated.

  • The zenodo (or git) repositories could contain multiple files, each of which can be assigned to a flavour.

  • When multiple flavours are passed, path refers to the folder where the models would be downloaded.

  • If a single file of the repository is needed (without specifying model flavours), path can reference to the file itself. For example, you can try replacing the whole WHEEL inset in models.yml to:

    - WHEEL:
        zenodo_id: 6255575
        path: models/WHEEL=N10L11.csv

Running the experiment

The experiment can be run by simply navigating to the examples/case_d 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.