You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/experiment_config.rst
+28-18Lines changed: 28 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,26 @@
1
+
.. _experiment_config:
2
+
1
3
Experiment Configuration
2
4
========================
3
5
4
-
**floatCSEP** provides a standardized workflow for forecasting experiments, whose instructions can be set in a configuration file. Here, we need to define the Experiments' temporal settings, geographic region, seismic catalogs, forecasting models, evaluation tests and post-process.
6
+
**floatCSEP** provides a standardized workflow for forecasting experiments, the instructions of which can be set in a configuration file. Here, we need to define the Experiments' temporal settings, geographic region, seismic catalogs, forecasting models, evaluation tests and any post-process options.
5
7
6
8
7
9
Configuration Structure
8
10
-----------------------
9
-
Configuration files are written in ``YAML`` format and is divided into different aspects of the Experiment setup:
11
+
Configuration files are written in ``YAML`` format and are divided into different aspects of the experiment setup:
10
12
11
-
1. **Experiment Metadata**: Experiment's information such as its ``name``, ``authors``, ``doi``, ``URL``, etc.
13
+
1. **Metadata**: Experiment's information such as its ``name``, ``authors``, ``doi``, ``URL``, etc.
12
14
2. **Temporal Configuration** (``time_config``): Temporal characteristics of the experiment, such as the start and end dates, experiment class (time-independent or time-dependent), the testing intervals, etc.
13
-
3. **Spatial and Magnitude Configuration** (``region_config``): Describes testing region, such as its geographic bounds, magnitude ranges, and depth ranges.
15
+
3. **Spatial and Magnitude Configuration** (``region_config``): Describes the testing region, such as its geographic bounds, magnitude ranges, and depth ranges.
14
16
4. **Seismic Catalog** (``catalog``): Defines the seismicity data source to test the models. It can either link to a seismic network API, or an existing file in the system.
15
17
5. **Models** (``models``): Configuration of forecasting models. It can direct to an additional configuration file with ``model_config`` for readability. See :ref:`model_config`.
16
18
6. **Evaluation Tests** (``tests``): Configuration of the statistical tests to evaluate the models. It can direct to an additional configuration file with ``test_config`` for readability. See :ref:`evaluation_config`.
17
19
7. **Postprocessing** (``postprocess``): Instructions on how to process and visualize the experiment's results, such as plotting forecasts or generating reports. See :ref:`postprocess`.
18
20
19
21
.. note::
20
22
21
-
YAML (Yet Another Markup Language) is a human-readable format used for configuration files. It uses **key: value** pairs to define settings, and indentation to represent nested structures. Lists are denoted by hyphens (`-`).
23
+
`YAML` (Yet Another Markup Language) is a human-readable format used for configuration files. It uses **key: value** pairs to define settings, and indentation to represent nested structures. Lists are denoted by hyphens (`-`).
22
24
23
25
24
26
**Example Basic Configuration** (``config.yml``):
@@ -74,7 +76,7 @@ Any non-parsed parameter (e.g., not specified in the documentation) will be stor
74
76
Temporal Definition
75
77
-------------------
76
78
77
-
Configuring the temporal definition of the experiment is indicated with the ``time_config`` option, followed by an indented block of admissible parameters. The purpose of this configuration section is to set a testing **time-window**, or a sequence of **time-windows**. Each time-window is then defined by ``datetime`` strings representing its lower and upper edges.
79
+
Configuring the experiment temporal definition is indicated with the ``time_config`` option, followed by an indented block of admissible parameters. The purpose of this configuration section is to set a testing **time-window**, or a sequence of **time-windows**. Each time-window is defined by two ``datetime`` strings representing its lower and upper edges.
78
80
79
81
Time-windows can be defined from different combination of the following parameters:
80
82
@@ -86,13 +88,13 @@ Time-windows can be defined from different combination of the following paramete
86
88
* - **end_date**
87
89
- The end date of the experiment in UTC and ISO8601 format (``%Y-%m-%dT%H:%M:%S``)
88
90
* - **intervals**
89
-
- An integer amount of testing intervals (time windows).
91
+
- An integer amount of testing intervals (time windows). If **horizon** is given, each time-window has a length equal to **horizon**. Else, the range between **start_date** and **end_date** is equally divided into the amount of **intervals**.
90
92
* - **horizon**
91
93
- Indicates the time windows `length`. It is written as a number, followed by a hyphen (`-`) and a time unit (``days``, ``weeks``, ``months``, ``years``). e.g.: ``1-days``, ``2.5-years``.
92
-
* - **offset**
93
-
- Offset between consecutive time-windows. If none given or ``offset=horizon``, time-windows are non-overlapping. It is written as a number, followed by a hyphen (`-`) and a time unit (``days``, ``weeks``, ``months``, ``years``). e.g.: ``1-days``, ``2.5-years``.
94
94
* - **growth**
95
95
- How to discretize the time-windows between ``start_date`` and ``end_date``. Options are: **incremental** (The end of a time window matches the beginning of the next) or **cumulative** (All time-windows have a start at the experiment ``start_date``).
96
+
* - **offset**
97
+
- Offset between consecutive time-windows. If none given or ``offset=horizon``, time-windows are non-overlapping. It is written as a number, followed by a hyphen (`-`) and a time unit (``days``, ``weeks``, ``months``, ``years``). e.g.: ``1-days``, ``2.5-years``.
Alternatively, time windows can be defined explicitly as a **list** of timewindow (which are a **list** of ``datetimes``):
156
+
Alternatively, time windows can be defined explicitly as a **list** of time-windows (each of which is a **list** of ``datetimes``):
155
157
156
158
.. code-block:: yaml
157
159
@@ -165,7 +167,7 @@ Alternatively, time windows can be defined explicitly as a **list** of timewindo
165
167
Spatial and Magnitude Definition
166
168
--------------------------------
167
169
168
-
Configuring the spatial and magnitude definitions is done through the ``region_config`` option, followed by an indented block of admissible parameters. Here, we need to define the spatial region (check the `Region <https://docs.cseptesting.org/concepts/regions.html>`_ concept from **pyCSEP**), the magnitude `bins` (i.e., discretization) and the `depth` extent (used mostly to filter out seismicity outside this range):
170
+
Configuring the spatial and magnitude definitions is done through the ``region_config`` option, followed by an indented block of admissible parameters. Here, we need to define the spatial region (check the `Region <https://docs.cseptesting.org/concepts/regions.html>`_ documentation from **pyCSEP**), the magnitude `bins` (i.e., discretization) and the `depth` extent.
169
171
170
172
.. list-table::
171
173
:widths: 20 80
@@ -177,7 +179,7 @@ Configuring the spatial and magnitude definitions is done through the ``region_c
177
179
* - **mag_max**
178
180
- The maximum magnitude of the experiment.
179
181
* - **mag_bin**
180
-
- The size of a magnitude bin.
182
+
- The size of the magnitude bin.
181
183
* - **depth_min**
182
184
- The minimum depth (in `km`) of the experiment.
183
185
* - **depth_max**
@@ -187,15 +189,22 @@ Configuring the spatial and magnitude definitions is done through the ``region_c
187
189
1. The ``region`` parameter can be defined from:
188
190
189
191
190
-
* A **CSEP** region: This correspond to pre-established testing regions for highly seismic areas. This parameter is linked to **pyCSEP** functions, and can be either ``italy_csep_region``, ``nz_csep_region``, ``california_relm_region`` or ``global_region``.
191
-
* A `txt` file with the spatial cells collection , where each cell is defined by its origin (e.g., the x (lon) and y (lat) of the lower-left corner). See the **pyCSEP** `documentation <https://docs.cseptesting.org/concepts/regions.html#cartesian-grid>`_ on Regions, the class :class:`~csep.core.regions.CartesianGrid2D` and its method :meth:`~csep.core.regions.CartesianGrid2D.from_origins`. For example, for a region consisting of three cells, their origins can be written as:
192
+
* A **CSEP** region: They correspond to pre-established testing regions for seismic areas. This parameter is linked to **pyCSEP** functions, and can be one of the following values:
193
+
194
+
* ``italy_csep_region``
195
+
* ``nz_csep_region``
196
+
* ``california_relm_region``
197
+
* ``global_region``.
198
+
199
+
* A text file with the spatial cells collection. Each cell is defined by its origin (e.g., the x (lon) and y (lat) of the lower-left corner). For example, for a region consisting of three cells, their origins can be written as:
192
200
193
201
.. code-block::
194
202
195
203
10.0 40.0
196
204
10.0 40.1
197
205
10.1 40.0
198
206
207
+
See the **pyCSEP** `Region documentation <https://docs.cseptesting.org/concepts/regions.html#cartesian-grid>`_, the class :class:`~csep.core.regions.CartesianGrid2D` and its method :meth:`~csep.core.regions.CartesianGrid2D.from_origins` for more info.
199
208
2. Magnitude definition: We need to define a magnitude discretization or `bins`. The parameters **mag_min**, **mag_max**, **mag_bin** allows to create an uniformly distributed set of bins. For example, the command:
200
209
201
210
.. code-block:: yaml
@@ -204,7 +213,7 @@ Configuring the spatial and magnitude definitions is done through the ``region_c
204
213
mag_max: 5.0
205
214
mag_bin: 0.5
206
215
207
-
would result in two magnitude bins with ranges ``[4.0, 4.5)`` and ``[4.5, 5.0)``. Alternatively, magnitudes can be written explicitly by their bin edges. For example:
216
+
would result in two magnitude bins with ranges ``[4.0, 4.5)`` and ``[4.5, 5.0)``. Alternatively, magnitudes can be written explicitly by their bin `left` edge. For example:
208
217
209
218
.. code-block:: yaml
210
219
@@ -213,7 +222,8 @@ Configuring the spatial and magnitude definitions is done through the ``region_c
213
222
- 4.1
214
223
- 4.2
215
224
216
-
resulting in the ``[4.0, 4.1)`` and ``[4.1, 4.2)``
225
+
resulting in the ``[4.0, 4.1)``, ``[4.1, 4.2)`` and ``[4.2, 4.3)``.
226
+
217
227
218
228
3. Depths: The minimum and maximum depths are just required to filter out seismicity outside those ranges.
219
229
@@ -253,8 +263,8 @@ The seismicity catalog can be defined with the ``catalog`` parameter. It represe
253
263
254
264
**floatCSEP** can retrieve the catalog from a seismic network API. The possible options are:
255
265
256
-
- ``query_gcmt``: Global Centroid Moment Tensor Catalog (https://www.globalcmt.org/) - via the API of the ISC (https://www.isc.ac.uk/)
0 commit comments