Skip to content

Commit 48bddff

Browse files
authored
v0.6.1 release branch (#185)
* Quadtree csv reader (#186) * New plotting routines (#190) * Non poissonian tests (#189, #202, #205, #208, #209) * Fix region border plot (#199) * Added support for BSI catalog (#201) * Fix consistency plots (#206)
1 parent bb299b2 commit 48bddff

26 files changed

+993
-166
lines changed

Diff for: CHANGELOG.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
# v0.6.1 (12/12/2022)
2+
3+
# Change-log
4+
Added quadtree csv reader ([#186](https://github.com/SCECcode/pycsep/pull/186))
5+
Non-Poissonian tests
6+
([#189](https://github.com/SCECcode/pycsep/pull/189),
7+
[#205](https://github.com/SCECcode/pycsep/pull/205),
8+
[#208](https://github.com/SCECcode/pycsep/pull/208),
9+
[#209](https://github.com/SCECcode/pycsep/pull/209))
10+
Added plots for p-values, and confidence ranges for consistency tests ([#190](https://github.com/SCECcode/pycsep/pull/190))
11+
Added NZ testing and collection regions ([#198](https://github.com/SCECcode/pycsep/pull/198))
12+
Fixed region border plotting issue ([#199](https://github.com/SCECcode/pycsep/pull/199))
13+
Added documentation for non-Poissonian tests ([#202](https://github.com/SCECcode/pycsep/pull/202))
14+
Support for BSI catalog ([#201](https://github.com/SCECcode/pycsep/pull/201))
15+
Fixed compatibility with new version of matplotlib ([#206](https://github.com/SCECcode/pycsep/pull/206))
16+
17+
## Credits
18+
Pablo Iturrieta (@pabloitu)
19+
Jose Bayona (@bayonato89)
20+
Khawaja Asim (@khawajasim)
21+
William Savran (@wsavran)
22+
123
# v0.6.0 (02/04/2022)
224

325
## Change-log
4-
Adds support for quadtree regions [#184](https://github.com/SCECcode/pycsep/pull/184)
26+
Adds support for quadtree regions ([#184])(https://github.com/SCECcode/pycsep/pull/184)
527

628
## Credits
729
Khawaja Asim (@khawajasim)

Diff for: CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ authors:
1414
given-names: Philip J.
1515
orcid: 0000-0002-9221-7068
1616
title: "pyCSEP - Tools for Earthquake Forecast Developers"
17-
version: 0.4.1
17+
version: 0.6.1
1818
repository: https://github.com/SCECcode/pycsep
1919
date-released: 2021-04-20

Diff for: codemeta.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"downloadUrl": "https://github.com/SCECcode/pycsep",
1010
"issueTracker": "https://github.com/SCECcode/pycsep/issues",
1111
"name": "pyCSEP",
12-
"version": "v0.6.0",
12+
"version": "v0.6.1",
1313
"description": "The pyCSEP Toolkit helps earthquake forecast model developers evaluate their forecasts with the goal of understanding earthquake predictability.",
1414
"applicationCategory": "Seismology",
1515
"developmentStatus": "active",
@@ -30,7 +30,7 @@
3030
"NumPy 1.21.3 or later (https://numpy.org)",
3131
"SciPy 1.7.1 or later (https://scipy.org)",
3232
"pandas 1.3.4 or later (https://pandas.pydata.org)",
33-
"cartopy 0.20.0 or later (https://scitools.org.uk/cartopy/docs/latest)",
33+
"cartopy 0.21.5 or later (https://scitools.org.uk/cartopy/docs/latest)",
3434
"GEOS 3.7.2 or later (https://trac.osgeo.org/geos/)",
3535
"PROJ 8.0.0 or later (https://proj.org/)"
3636
],

Diff for: csep/__init__.py

+60-4
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ def load_catalog(filename, type='csep-csv', format='native', loader=None, apply_
188188

189189
def query_comcat(start_time, end_time, min_magnitude=2.50,
190190
min_latitude=31.50, max_latitude=43.00,
191-
min_longitude=-125.40, max_longitude=-113.10, verbose=True,
191+
min_longitude=-125.40, max_longitude=-113.10,
192+
max_depth=1000,
193+
verbose=True,
192194
apply_filters=False, **kwargs):
193195
"""
194196
Access Comcat catalog through web service
@@ -201,19 +203,20 @@ def query_comcat(start_time, end_time, min_magnitude=2.50,
201203
max_latitude: max latitude of bounding box
202204
min_longitude: min latitude of bounding box
203205
max_longitude: max longitude of bounding box
204-
region: :class:`csep.core.regions.CartesianGrid2D
206+
max_depth: maximum depth of the bounding box
205207
verbose (bool): print catalog summary statistics
206208
207209
Returns:
208-
:class:`csep.core.catalogs.ComcatCatalog
210+
:class:`csep.core.catalogs.CSEPCatalog
209211
"""
210212

211213
# Timezone should be in UTC
212214
t0 = time.time()
213215
eventlist = readers._query_comcat(start_time=start_time, end_time=end_time,
214216
min_magnitude=min_magnitude,
215217
min_latitude=min_latitude, max_latitude=max_latitude,
216-
min_longitude=min_longitude, max_longitude=max_longitude)
218+
min_longitude=min_longitude, max_longitude=max_longitude,
219+
max_depth=max_depth)
217220
t1 = time.time()
218221
comcat = catalogs.CSEPCatalog(data=eventlist, date_accessed=utc_now_datetime(), **kwargs)
219222
print("Fetched ComCat catalog in {} seconds.\n".format(t1 - t0))
@@ -234,6 +237,59 @@ def query_comcat(start_time, end_time, min_magnitude=2.50,
234237

235238
return comcat
236239

240+
241+
def query_bsi(start_time, end_time, min_magnitude=2.50,
242+
min_latitude=32.0, max_latitude=50.0,
243+
min_longitude=2.0, max_longitude=21.0,
244+
max_depth=1000,
245+
verbose=True,
246+
apply_filters=False, **kwargs):
247+
"""
248+
Access BSI catalog through web service
249+
250+
Args:
251+
start_time: datetime object of start of catalog
252+
end_time: datetime object for end of catalog
253+
min_magnitude: minimum magnitude to query
254+
min_latitude: maximum magnitude to query
255+
max_latitude: max latitude of bounding box
256+
min_longitude: min latitude of bounding box
257+
max_longitude: max longitude of bounding box
258+
max_depth: maximum depth of the bounding box
259+
verbose (bool): print catalog summary statistics
260+
261+
Returns:
262+
:class:`csep.core.catalogs.CSEPCatalog
263+
"""
264+
265+
# Timezone should be in UTC
266+
t0 = time.time()
267+
eventlist = readers._query_bsi(start_time=start_time, end_time=end_time,
268+
min_magnitude=min_magnitude,
269+
min_latitude=min_latitude, max_latitude=max_latitude,
270+
min_longitude=min_longitude, max_longitude=max_longitude,
271+
max_depth=max_depth)
272+
t1 = time.time()
273+
bsi = catalogs.CSEPCatalog(data=eventlist, date_accessed=utc_now_datetime(), **kwargs)
274+
print("Fetched BSI catalog in {} seconds.\n".format(t1 - t0))
275+
276+
if apply_filters:
277+
try:
278+
bsi = bsi.filter().filter_spatial()
279+
except CSEPCatalogException:
280+
bsi = bsi.filter()
281+
282+
if verbose:
283+
print("Downloaded catalog from Bollettino Sismico Italiano (BSI) with following parameters")
284+
print("Start Date: {}\nEnd Date: {}".format(str(bsi.start_time), str(bsi.end_time)))
285+
print("Min Latitude: {} and Max Latitude: {}".format(bsi.min_latitude, bsi.max_latitude))
286+
print("Min Longitude: {} and Max Longitude: {}".format(bsi.min_longitude, bsi.max_longitude))
287+
print("Min Magnitude: {}".format(bsi.min_magnitude))
288+
print(f"Found {bsi.event_count} events in the BSI catalog.")
289+
290+
return bsi
291+
292+
237293
def load_evaluation_result(fname):
238294
""" Load evaluation result stored as json file
239295

Diff for: csep/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.6.0"
1+
__version__ = "0.6.1"
22

0 commit comments

Comments
 (0)