Skip to content

Commit

Permalink
Merge pull request #30 from EarthScope/0.1.41
Browse files Browse the repository at this point in the history
0.1.41
  • Loading branch information
mikegottlieb84 authored Jun 19, 2024
2 parents 62aef3e + fb64a97 commit aad8f2b
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 174 deletions.
300 changes: 177 additions & 123 deletions docs/source/notebooks/level2.ipynb

Large diffs are not rendered by default.

71 changes: 37 additions & 34 deletions docs/source/notebooks/plot_event.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "earthscopestraintools"
version ="0.1.40"
version ="0.1.41"
authors = [
{ name="Mike Gottlieb", email="[email protected]" },
]
Expand Down
18 changes: 11 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
numpy==1.24.1
pandas==1.5.3
requests==2.28.2
tiledb==0.20.0
obspy==1.4.0
es_datasources_client==0.3.1
pyarrow==7.0.0
scipy>=1.10.1
numpy>=1.24.1
pandas[performance]>=2.1.0
requests>=2.28.2
geopy>=2.3.0
numexpr>=2.8.4
obspy>=1.4.0
tiledb==0.23.0
pyarrow==13.0.0
ipympl>=0.9.3

2 changes: 1 addition & 1 deletion src/earthscopestraintools/event_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def plot_coseismic_offset(
# if self.units:
# axs[i][0].set_ylabel(self.units)
if coseismic_offset:
label = f"Co-seismic offset: {round(coseismic_offsets[i], 3)} ustrain"
label = f"Co-seismic offset: {round(coseismic_offsets.iloc[i], 3)} ustrain"
axs[i][0].text(
0.85,
0.2,
Expand Down
18 changes: 10 additions & 8 deletions src/earthscopestraintools/gtsm_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def __init__(self, network, station, gauge_weights=None):
matrices["lab"] = self.get_lab_strain_matrix()
matrices["ER2010"] = self.get_er2010_strain_matrix()
matrices["KH2013"] = self.get_kh2013_strain_matrix()
matrices["CH_prelim"] = self.get_ch_prelim_strain_matrix()
matrices["CH2024"] = self.get_ch2024_strain_matrix()
#still support using deprecated name for CH calibrations
matrices["CH_prelim"] = matrices["CH2024"]
matrices["EM2024"] = self.get_em2024_strain_matrix()
self.strain_matrices = {k: v for k, v in matrices.items()}
self.atmp_response = self.get_atmp_response()
Expand Down Expand Up @@ -340,11 +342,11 @@ def get_kh2013_strain_matrix(self):
logger.error("Could not load KH2013 strain matrix")
return None

def get_ch_prelim_strain_matrix(self):
"""parse CH preliminary strain matrix from station metadata if available.
Calibrations of TABOO-STAR stations performed by Cassie Hanagan in 2023.
def get_ch2024_strain_matrix(self):
"""parse CH 2024 strain matrix from station metadata if available.
Calibrations of TABOO-STAR stations performed by Cassie Hanagan in 2024.
:return: CH_PRELIM calibration matrix
:return: CH2024 calibration matrix
:rtype: np.array
"""
url = f"http://bsm.unavco.org/bsm/level2/{self.station}/{self.station}.README.txt"
Expand All @@ -354,17 +356,17 @@ def get_ch_prelim_strain_matrix(self):
for i, line in enumerate(lines):
line = line.decode("utf-8").rstrip()
if line.startswith(" CH Preliminary Tidal Calibration"):
ch_prelim = np.array(
ch2024 = np.array(
[
lines[i + 3].decode("utf-8").rstrip().split()[1:],
lines[i + 4].decode("utf-8").rstrip().split()[1:],
lines[i + 5].decode("utf-8").rstrip().split()[1:],
]
)
return ch_prelim.astype(float)
return ch2024.astype(float)
return None
except Exception as e:
logger.exception("Could not load ch_prelim strain matrix")
logger.exception("Could not load CH2024 strain matrix")
return None

def get_em2024_strain_matrix(self):
Expand Down

0 comments on commit aad8f2b

Please sign in to comment.