Skip to content

Commit

Permalink
cleaning and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLecocq committed Nov 25, 2024
1 parent 40899bf commit 7901e5d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dist
msnoise.egg-info
/.idea
/msnoise/RELEASE-VERSION
/data/
32 changes: 16 additions & 16 deletions msnoise/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,9 @@ def add_corr(session, station1, station2, filterid, date, time, duration,
:param session: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`connect`
:type station1: str
:param station1: The name of station 1 (formatted NET.STA)
:param station1: The name of station 1 (formatted NET.STA.LOC)
:type station2: str
:param station2: The name of station 2 (formatted NET.STA)
:param station2: The name of station 2 (formatted NET.STA.LOC)
:type filterid: int
:param filterid: The ID (ref) of the filter
:type date: datetime.date or str
Expand Down Expand Up @@ -1377,9 +1377,9 @@ def get_ref(session, station1, station2, filterid, components, params=None):
:param session: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`connect`
:type station1: str
:param station1: The name of station 1 (formatted NET.STA)
:param station1: The name of station 1 (formatted NET.STA.LOC)
:type station2: str
:param station2: The name of station 2 (formatted NET.STA)
:param station2: The name of station 2 (formatted NET.STA.LOC)
:type filterid: int
:param filterid: The ID (ref) of the filter
:type components: str
Expand Down Expand Up @@ -1416,9 +1416,9 @@ def get_results(session, station1, station2, filterid, components, dates,
:param session: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`connect`
:type station1: str
:param station1: The name of station 1 (formatted NET.STA)
:param station1: The name of station 1 (formatted NET.STA.LOC)
:type station2: str
:param station2: The name of station 2 (formatted NET.STA)
:param station2: The name of station 2 (formatted NET.STA.LOC)
:type filterid: int
:param filterid: The ID (ref) of the filter
:type components: str
Expand Down Expand Up @@ -1518,9 +1518,9 @@ def get_results_all(session, station1, station2, filterid, components, dates,
:param session: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`connect`
:type station1: str
:param station1: The name of station 1 (formatted NET.STA)
:param station1: The name of station 1 (formatted NET.STA.LOC)
:type station2: str
:param station2: The name of station 2 (formatted NET.STA)
:param station2: The name of station 2 (formatted NET.STA.LOC)
:type filterid: int
:param filterid: The ID (ref) of the filter
:type components: str
Expand Down Expand Up @@ -1952,21 +1952,21 @@ def make_same_length(st):

def preload_instrument_responses(session, return_format="dataframe"):
"""
This function preloads all instrument responses from ``response_format``
This function preloads all instrument responses from ``response_path``
and stores the seed ids, start and end dates, and paz for every channel
in a DataFrame.
.. warning::
This function only works for ``response_format`` being "inventory"
or "dataless".
in a DataFrame. Any file readable by obspy's read_inventory will be processed.
:type session: :class:`sqlalchemy.orm.session.Session`
:param session: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`connect`
:rtype: pandas.DataFrame
:type return_format: str
:param return_format: The format of the returned object, either
``dataframe`` or ``inventory``.
:rtype: :class:`~pandas.DataFrame` or :class:`~obspy.core.inventory.inventory.Inventory`
:returns: A table containing all channels with the time of operation and
poles and zeros.
poles and zeros (DataFrame), or an obspy Inventory object.
"""
from obspy.core.inventory import Inventory
Expand Down
8 changes: 4 additions & 4 deletions msnoise/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def preprocess(stations, comps, goal_day, params, responses=None, loglevel="INFO
:param db: A :class:`~sqlalchemy.orm.session.Session` object, as
obtained by :func:`msnoise.api.connect`.
:type stations: list of str
:param stations: a list of station names, in the format NET.STA.
:param stations: a list of station names, in the format NET.STA.LOC
:type comps: list of str
:param comps: a list of component names, in Z,N,E,1,2.
:type goal_day: str
Expand Down Expand Up @@ -201,11 +201,11 @@ def preprocess(stations, comps, goal_day, params, responses=None, loglevel="INFO
stream[i] = check_and_phase_shift(trace, params.preprocess_taper_length)

logger.debug("%s Checking Gaps" % stream[0].id)
if len(getGaps(stream)) > 0:
logger.debug(" found %i gaps" % len(getGaps(stream)))
gaps = getGaps(stream)
if len(gaps) > 0:
logger.debug(" found %i gaps" % len(gaps))
max_gap = params.preprocess_max_gap*stream[0].stats.sampling_rate

gaps = getGaps(stream)
while len(gaps):
too_long = 0
for gap in gaps:
Expand Down

0 comments on commit 7901e5d

Please sign in to comment.