Skip to content

Commit

Permalink
v0.6.1 release branch (#185)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
wsavran authored Dec 12, 2022
1 parent bb299b2 commit 48bddff
Show file tree
Hide file tree
Showing 26 changed files with 993 additions and 166 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
# v0.6.1 (12/12/2022)

# Change-log
Added quadtree csv reader ([#186](https://github.com/SCECcode/pycsep/pull/186))
Non-Poissonian tests
([#189](https://github.com/SCECcode/pycsep/pull/189),
[#205](https://github.com/SCECcode/pycsep/pull/205),
[#208](https://github.com/SCECcode/pycsep/pull/208),
[#209](https://github.com/SCECcode/pycsep/pull/209))
Added plots for p-values, and confidence ranges for consistency tests ([#190](https://github.com/SCECcode/pycsep/pull/190))
Added NZ testing and collection regions ([#198](https://github.com/SCECcode/pycsep/pull/198))
Fixed region border plotting issue ([#199](https://github.com/SCECcode/pycsep/pull/199))
Added documentation for non-Poissonian tests ([#202](https://github.com/SCECcode/pycsep/pull/202))
Support for BSI catalog ([#201](https://github.com/SCECcode/pycsep/pull/201))
Fixed compatibility with new version of matplotlib ([#206](https://github.com/SCECcode/pycsep/pull/206))

## Credits
Pablo Iturrieta (@pabloitu)
Jose Bayona (@bayonato89)
Khawaja Asim (@khawajasim)
William Savran (@wsavran)

# v0.6.0 (02/04/2022)

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

## Credits
Khawaja Asim (@khawajasim)
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ authors:
given-names: Philip J.
orcid: 0000-0002-9221-7068
title: "pyCSEP - Tools for Earthquake Forecast Developers"
version: 0.4.1
version: 0.6.1
repository: https://github.com/SCECcode/pycsep
date-released: 2021-04-20
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"downloadUrl": "https://github.com/SCECcode/pycsep",
"issueTracker": "https://github.com/SCECcode/pycsep/issues",
"name": "pyCSEP",
"version": "v0.6.0",
"version": "v0.6.1",
"description": "The pyCSEP Toolkit helps earthquake forecast model developers evaluate their forecasts with the goal of understanding earthquake predictability.",
"applicationCategory": "Seismology",
"developmentStatus": "active",
Expand All @@ -30,7 +30,7 @@
"NumPy 1.21.3 or later (https://numpy.org)",
"SciPy 1.7.1 or later (https://scipy.org)",
"pandas 1.3.4 or later (https://pandas.pydata.org)",
"cartopy 0.20.0 or later (https://scitools.org.uk/cartopy/docs/latest)",
"cartopy 0.21.5 or later (https://scitools.org.uk/cartopy/docs/latest)",
"GEOS 3.7.2 or later (https://trac.osgeo.org/geos/)",
"PROJ 8.0.0 or later (https://proj.org/)"
],
Expand Down
64 changes: 60 additions & 4 deletions csep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def load_catalog(filename, type='csep-csv', format='native', loader=None, apply_

def query_comcat(start_time, end_time, min_magnitude=2.50,
min_latitude=31.50, max_latitude=43.00,
min_longitude=-125.40, max_longitude=-113.10, verbose=True,
min_longitude=-125.40, max_longitude=-113.10,
max_depth=1000,
verbose=True,
apply_filters=False, **kwargs):
"""
Access Comcat catalog through web service
Expand All @@ -201,19 +203,20 @@ def query_comcat(start_time, end_time, min_magnitude=2.50,
max_latitude: max latitude of bounding box
min_longitude: min latitude of bounding box
max_longitude: max longitude of bounding box
region: :class:`csep.core.regions.CartesianGrid2D
max_depth: maximum depth of the bounding box
verbose (bool): print catalog summary statistics
Returns:
:class:`csep.core.catalogs.ComcatCatalog
:class:`csep.core.catalogs.CSEPCatalog
"""

# Timezone should be in UTC
t0 = time.time()
eventlist = readers._query_comcat(start_time=start_time, end_time=end_time,
min_magnitude=min_magnitude,
min_latitude=min_latitude, max_latitude=max_latitude,
min_longitude=min_longitude, max_longitude=max_longitude)
min_longitude=min_longitude, max_longitude=max_longitude,
max_depth=max_depth)
t1 = time.time()
comcat = catalogs.CSEPCatalog(data=eventlist, date_accessed=utc_now_datetime(), **kwargs)
print("Fetched ComCat catalog in {} seconds.\n".format(t1 - t0))
Expand All @@ -234,6 +237,59 @@ def query_comcat(start_time, end_time, min_magnitude=2.50,

return comcat


def query_bsi(start_time, end_time, min_magnitude=2.50,
min_latitude=32.0, max_latitude=50.0,
min_longitude=2.0, max_longitude=21.0,
max_depth=1000,
verbose=True,
apply_filters=False, **kwargs):
"""
Access BSI catalog through web service
Args:
start_time: datetime object of start of catalog
end_time: datetime object for end of catalog
min_magnitude: minimum magnitude to query
min_latitude: maximum magnitude to query
max_latitude: max latitude of bounding box
min_longitude: min latitude of bounding box
max_longitude: max longitude of bounding box
max_depth: maximum depth of the bounding box
verbose (bool): print catalog summary statistics
Returns:
:class:`csep.core.catalogs.CSEPCatalog
"""

# Timezone should be in UTC
t0 = time.time()
eventlist = readers._query_bsi(start_time=start_time, end_time=end_time,
min_magnitude=min_magnitude,
min_latitude=min_latitude, max_latitude=max_latitude,
min_longitude=min_longitude, max_longitude=max_longitude,
max_depth=max_depth)
t1 = time.time()
bsi = catalogs.CSEPCatalog(data=eventlist, date_accessed=utc_now_datetime(), **kwargs)
print("Fetched BSI catalog in {} seconds.\n".format(t1 - t0))

if apply_filters:
try:
bsi = bsi.filter().filter_spatial()
except CSEPCatalogException:
bsi = bsi.filter()

if verbose:
print("Downloaded catalog from Bollettino Sismico Italiano (BSI) with following parameters")
print("Start Date: {}\nEnd Date: {}".format(str(bsi.start_time), str(bsi.end_time)))
print("Min Latitude: {} and Max Latitude: {}".format(bsi.min_latitude, bsi.max_latitude))
print("Min Longitude: {} and Max Longitude: {}".format(bsi.min_longitude, bsi.max_longitude))
print("Min Magnitude: {}".format(bsi.min_magnitude))
print(f"Found {bsi.event_count} events in the BSI catalog.")

return bsi


def load_evaluation_result(fname):
""" Load evaluation result stored as json file
Expand Down
2 changes: 1 addition & 1 deletion csep/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.6.0"
__version__ = "0.6.1"

Loading

0 comments on commit 48bddff

Please sign in to comment.