Skip to content

Commit b1f4473

Browse files
committed
documentation updates for catalog ascii format
1 parent 14be6eb commit b1f4473

File tree

5 files changed

+67
-13
lines changed

5 files changed

+67
-13
lines changed

csep/core/catalogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def read_float(val):
935935
return val
936936

937937
def is_header_line(line):
938-
if line[0] == 'lon':
938+
if line[0].lower() == 'lon':
939939
return True
940940
else:
941941
return False

docs/concepts/catalogs.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ PyCSEP data model.
7272
Going between a DataFrame and CSEPCatalog is a lossy transformation. It essentially only retains the essential event
7373
attributes that are defined by the ``dtype`` of the class.
7474

75-
76-
7775
****************
7876
Loading catalogs
7977
****************

docs/concepts/evaluations.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ Consistency tests
109109
Publication reference
110110
=====================
111111

112-
1. Number test (:ref:`Savran et al., 2020`<savran-2020>`)
113-
2. Spatial test (:ref:`Savran et al., 2020`<savran-2020>`)
114-
3. Magnitude test (:ref:`Savran et al., 2020`<savran-2020>`)
115-
4. Pseudolikelihood test (:ref:`Savran et al., 2020`<savran-2020>`)
116-
5. Calibration test (:ref:`Savran et al., 2020`<savran-2020>`)
112+
1. Number test (:ref:`Savran et al., 2020<savran-2020>`)
113+
2. Spatial test (:ref:`Savran et al., 2020<savran-2020>`)
114+
3. Magnitude test (:ref:`Savran et al., 2020<savran-2020>`)
115+
4. Pseudolikelihood test (:ref:`Savran et al., 2020<savran-2020>`)
116+
5. Calibration test (:ref:`Savran et al., 2020<savran-2020>`)
117117

118118
****************************
119119
Preparing evaluation catalog

docs/concepts/forecasts.rst

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,70 @@ they are trying to model. A grid-based forecast can be easily computed from a ca
8787
space-magnitude region and counting events within each bin from each catalog in the forecast. There can be issues with
8888
under sampling, especially for larger magnitude events.
8989

90-
9190
Working with catalog-based forecasts
9291
####################################
9392

9493
.. autosummary:: csep.core.forecasts.CatalogForecast
9594

9695
Please see visit :ref:`this<catalog-forecast-evaluation>` example for an end-to-end tutorial on how to evaluate a catalog-based
9796
earthquake forecast. An example of a catalog-based forecast stored in the default PyCSEP format can be found
98-
`here<https://github.com/SCECcode/csep2/blob/dev/csep/artifacts/ExampleForecasts/CatalogForecasts/ucerf3-landers_1992-06-28T11-57-34-14.csv>_`.
97+
`here<https://github.com/SCECcode/pycsep/blob/dev/csep/artifacts/ExampleForecasts/CatalogForecasts/ucerf3-landers_1992-06-28T11-57-34-14.csv>`_.
98+
99+
100+
The standard format for catalog-based forecasts a comma separated value ASCII format. This format was chosen to be
101+
human-readable and easy to implement in all programming languages. Information about the format is shown below.
102+
103+
.. note::
104+
Custom formats can be supported by writing a custom function or sub-classing the
105+
:ref:`AbstractBaseCatalog<csep.core.forecasts.AbstractBaseCatalog>`.
106+
107+
The event format matches the follow specfication: ::
108+
109+
LON, LAT, MAG, ORIGIN_TIME, DEPTH, CATALOG_ID, EVENT_ID
110+
-125.4, 40.1, 3.96, 1992-01-05T0:40:3.1, 8, 0, 0
111+
112+
Each row in the catalog corresponds to an event. The catalogs are expected to be placed into the same file and are
113+
differentiated through their `catalog_id`. Catalogs with no events can be handled in a couple different ways intended to
114+
save storage.
115+
116+
The events within a catalog should be sorted in time, and the *catalog_id* should be increasing sequentially. Breaks in
117+
the *catalog_id* are interpreted as missing catalogs.
118+
119+
The following two examples show how you represent a forecast with 5 catalogs each containing zero events.
120+
121+
**1. Including all events (verbose)** ::
122+
123+
LON, LAT, MAG, ORIGIN_TIME, DEPTH, CATALOG_ID, EVENT_ID
124+
,,,,,0,
125+
,,,,,1,
126+
,,,,,2,
127+
,,,,,3,
128+
,,,,,4,
129+
130+
**2. Short-hand** ::
131+
132+
LON, LAT, MAG, ORIGIN_TIME, DEPTH, CATALOG_ID, EVENT_ID
133+
,,,,,4,
134+
135+
The following three example show how you could represent a forecast with 5 catalogs. Four of the catalogs contain zero events
136+
and one catalog contains one event.
137+
138+
**3. Including all events (verbose)** ::
139+
140+
LON, LAT, MAG, ORIGIN_TIME, DEPTH, CATALOG_ID, EVENT_ID
141+
,,,,,0,
142+
,,,,,1,
143+
,,,,,2,
144+
,,,,,3,
145+
-125.4, 40.1, 3.96, 1992-01-05T0:40:3.1, 8, 4, 0
146+
147+
**4. Short-hand** ::
148+
149+
LON, LAT, MAG, ORIGIN_TIME, DEPTH, CATALOG_ID, EVENT_ID
150+
-125.4, 40.1, 3.96, 1992-01-05T0:40:3.1, 8, 4, 0
151+
152+
The simplest way to orient the file follow (3) in the case where some catalogs contain zero events. The zero oriented
153+
catalog_id should be assigned to correspond with the total number of catalogs in the forecast. In the case where every catalog
154+
contains zero forecasted events, you would specify the forecasting using (2). The *catalog_id* should be assigned to
155+
correspond with the total number of catalogs in the forecast.
99156

100-
We will be adding more to these documentation pages, so stay tuned for updated.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
html_show_sphinx = False
2929

3030
# The short X.Y version
31-
version = 'v0.2'
31+
version = 'v0.4'
3232
# The full version, including alpha/beta/rc tags
33-
release = 'v0.2.0'
33+
release = 'v0.4.0'
3434

3535

3636
# -- General configuration ---------------------------------------------------

0 commit comments

Comments
 (0)