Skip to content

Commit

Permalink
change feature so that 'syn_wildcard' defaults to 'wildcard' unless e…
Browse files Browse the repository at this point in the history
…xplicitely provided
  • Loading branch information
bch0w committed Nov 20, 2023
1 parent d6b6b4c commit 7a11b63
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pysep/recsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ def __init__(self, pysep_path=None, syn_path=None,
geometric_spreading_ymax=None, geometric_spreading_save=None,
figsize=(9, 11), show=True, save="./record_section.png",
overwrite=False, log_level="DEBUG", synsyn=False, srcfmt=None,
obs_wildcard="*", syn_wildcard="*", **kwargs):
wildcard="*", syn_wildcard=None, **kwargs):
"""
.. note::
Used for reading in Pysep-generated waveforms
:type pysep_path: str
:param pysep_path: path to Pysep output, which is expected to contain
trace-wise SAC waveform files which will be read in. See
`obs_wildcard` for how to find files
:type obs_wildcard: str
:param obs_wildcard: wildcard fed to glob to determine which files to
`wildcard` for how to find files
:type wildcard: str
:param wildcard: wildcard fed to glob to determine which files to
read from `pysep_path`. Defaults to '*', read ALL files inside the
directory.
Expand All @@ -162,8 +162,8 @@ def __init__(self, pysep_path=None, syn_path=None,
for how to find files
:type syn_wildcard: str
:param syn_wildcard: wildcard fed to glob to determine which files to
read from `syn_path`. Defaults to '*', read ALL files inside the
directory.
read from `syn_path`. Defaults to `wildcard` unless explicitely
provided.
:type stations: str
:param stations: full path to STATIONS file used to define the station
coordinates. Format is dictated by SPECFEM
Expand Down Expand Up @@ -426,11 +426,12 @@ def __init__(self, pysep_path=None, syn_path=None,
_obs_data_type = ["data", "syn"][bool(synsyn)] # 'syn' if syssyn
st = self.read_data(path=pysep_path, data_type=_obs_data_type,
source=source, stations=stations,
srcfmt=srcfmt, wildcard=obs_wildcard)
srcfmt=srcfmt, wildcard=wildcard)
if syn_path is not None:
st_syn = self.read_data(path=syn_path, data_type="syn",
source=source, stations=stations,
srcfmt=srcfmt, wildcard=syn_wildcard)
srcfmt=srcfmt,
wildcard=syn_wildcard or wildcard)

# Allow plotting ONLY synthetics and no data, which means the synthetic
# Stream occupies the main `st` variable
Expand Down

0 comments on commit 7a11b63

Please sign in to comment.