Skip to content
Merged

V021 #50

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3545ddd
more verbose output and small bug fixes
paudetseis May 27, 2025
ce90cbf
cosmetic and code style changes
paudetseis May 27, 2025
5bdd19f
cosmetic, code style changes and fix tilt calculation
paudetseis May 27, 2025
c4105cc
fix tilt figure
paudetseis May 27, 2025
f085968
Correct tilt orientation calculations; plot trf components; code cleanup
paudetseis May 29, 2025
84b5ed8
add tilt ang to saved file
paudetseis May 29, 2025
0d1da61
moved fig_trf to plotting; now making daily tilt plots and 'clean' ti…
paudetseis May 31, 2025
f8f8b47
show only good days in tilt vs time figure
paudetseis Jun 3, 2025
94f6ad7
robust statistics on tilt plot vs time
paudetseis Jun 3, 2025
a59f209
add tilt figure in polar projection; add script arguments to clean_sp…
paudetseis Jun 3, 2025
e691bfe
added docstring for robust function
paudetseis Jun 3, 2025
e3c4ea6
add 'bad' day estimates in grey in tilt figure vs time
paudetseis Jun 4, 2025
97ee624
scripts now accept station XML files instead of StDb
paudetseis Jun 4, 2025
485ed37
stashing a bunch of bug fixes
paudetseis Jun 6, 2025
fcc39eb
added more options in compliance plot
paudetseis Jul 2, 2025
4e90aff
changed default arguments to empty lists in inv-to-stdb functions
paudetseis Jul 2, 2025
615188c
include phase information in compliance output results
paudetseis Jul 2, 2025
536713d
clean up atacr_daily_spectra
paudetseis Jul 2, 2025
cdfd4dc
moved stdb xml to stdb package
paudetseis Jul 8, 2025
279c925
updated documentation for tilt
paudetseis Jul 9, 2025
8c63a3b
updated installation instructions and local (SDS) database
paudetseis Jul 9, 2025
f99706c
renamed --local-data to --SDS-path
paudetseis Jul 9, 2025
849aaba
updated and added tilt figures
paudetseis Jul 9, 2025
a9e8aca
fixed script docs for input database to include xml
paudetseis Jul 9, 2025
ce0cde1
fixed type in station XML description
paudetseis Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 48 additions & 34 deletions docs/atacr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ Usage
are processed one by one and the data are stored to disk.

positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

options:
-h, --help show this help message and exit
Expand All @@ -247,7 +248,7 @@ Usage
Specify the Vertical Component Channel Identifier. [Default Z].

Server Settings:
Settings associated with which datacenter to log into.
Settings associated with FDSN datacenters for archived data.

--server SERVER Base URL of FDSN web service compatible server (e.g.
“http://service.iris.edu”) or key string for recognized server (one
Expand All @@ -268,16 +269,13 @@ Usage
PGP message in it. [Default None]

Local Data Settings:
Settings associated with defining and using a local data base of pre-downloaded day-long
SAC or MSEED files.

--local-data LOCALDATA
Specify absolute path to a SeisComP Data Structure (SDS) archive
containing day-long SAC or MSEED files(e.g., --local-
data=/Home/username/Data/SDS). See
https://www.seiscomp.de/seiscomp3/doc/applications/slarchive/SDS.html
for details on the SDS format. If this option is used, it takes
precedence over the --server-wf settings.
Settings associated with a SeisComP database for locally archived data.

--SDS-path LOCALDATA Specify absolute path to a SeisComP Data Structure (SDS) archive containing
day-long SAC or MSEED files(e.g., --SDS-path=/Home/username/Data/SDS). See
https://www.seiscomp.de/seiscomp3/doc/applications/slarchive/SDS.html for
details on the SDS format. If this option is used, it takes precedence over
the --server settings.
--dtype DTYPE Specify the data archive file type, either SAC or MSEED. Note the
default behaviour is to search for SAC files. Local archive files
must have extensions of '.SAC' or '.MSEED'. These are case dependent,
Expand Down Expand Up @@ -340,7 +338,8 @@ Usage
look for data saved in the previous steps and use all available components.

positional arguments:
indb Station Database to process from
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -445,7 +444,8 @@ Usage
stations are processed one by one and the data are stored to disk.

positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -536,7 +536,8 @@ Usage
processed one by one and the data are stored to disk.

positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -616,7 +617,8 @@ Usage
stations are processed one by one and the data are stored to disk.

positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

options:
-h, --help show this help message and exit
Expand All @@ -629,7 +631,7 @@ Usage
--zcomp ZCOMP Specify the Vertical Component Channel Identifier. [Default Z].

Server Settings:
Settings associated with which datacenter to log into.
Settings associated with FDSN datacenters for archived data.

--server SERVER Base URL of FDSN web service compatible server (e.g.
“http://service.iris.edu”) or key string for recognized server (one
Expand All @@ -650,16 +652,13 @@ Usage
PGP message in it. [Default None]

Local Data Settings:
Settings associated with defining and using a local data base of pre-downloaded day-long
SAC or MSEED files.

--local-data LOCALDATA
Specify absolute path to a SeisComP Data Structure (SDS) archive
containing day-long SAC or MSEED files(e.g., --local-
data=/Home/username/Data/SDS). See
https://www.seiscomp.de/seiscomp3/doc/applications/slarchive/SDS.html
for details on the SDS format. If this option is used, it takes
precedence over the --server-wf settings.
Settings associated with a SeisComP database for locally archived data.

--SDS-path LOCALDATA Specify absolute path to a SeisComP Data Structure (SDS) archive containing
day-long SAC or MSEED files(e.g., --SDS-path=/Home/username/Data/SDS). See
https://www.seiscomp.de/seiscomp3/doc/applications/slarchive/SDS.html for
details on the SDS format. If this option is used, it takes precedence over
the --server settings.
--dtype DTYPE Specify the data archive file type, either SAC or MSEED. Note the
default behaviour is to search for SAC files. Local archive files
must have extensions of '.SAC' or '.MSEED'. These are case dependent,
Expand Down Expand Up @@ -743,7 +742,8 @@ Usage
folder.

positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)

optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -1020,6 +1020,20 @@ pass the quality control are colored red.

Figure 3b: Daily average PSD of bad (red) and good (black) windows.

You can also choose to plot the tilt estimate for DayNoise objects. For intance, you can run:

.. code-block::

$ atacr_daily_spectra -O --fig-tilt --tilt-freqs=0.,0.005 --start=2012-03-04 --end=2012-03-05 M08A.pkl > logfile

which will produce the figure:

.. figure:: ../obstools/examples/figures/Figure_tilt_064.png
:align: center

Figure 3c: Estimates of tilt direction (degrees clockwise from H1) and tilt angle. Top: coherence, phase and admittance spectra from the daily average spectra. Orange dots show the narrow bandwidth (``tilt-freqs``) used to calculate mean values (bottom row). The plots on the top row are shown at the tilt direction. Bottom: Mean coherence, phase and admittance as a function ot the tilt direction. The correct coherence peak is selected as the direction for which the phase is within +/- 90 degrees from 0. The admittance is used to calculate the tilt angle.


3. QC for clean station averages
++++++++++++++++++++++++++++++++

Expand Down Expand Up @@ -1098,15 +1112,15 @@ Several figures are also produced, including Figures 4, 6-9.
.. figure:: ../obstools/examples/figures/Figure_4.png
:align: center

Figure 4: The orientation of maximum coherence between the vertical and the two
horizontal components for M08A during March 2012. (Left) Coherence as a function
of angle from the H1 component. (Right) Phase as a function of the angle.
(Bottom) Tilt direction measured from the H1 component as a function of time.
In this example, the coherence is low indicating low tilt noise.
Figure 4: Tilt orientation estimates for M08A during March 2012. (Left) Coherence as a function
of azimuth measured clockwise from the H1 component. (Middle) Phase as a function of the azimuth.
(Right) Admittance and related tilt angle as a function of the azimuth. Dotted lines indicate estimates for "bad" days (i.e., with too few good windows).
(Bottom) Tilt direction, tilt angle and maximum coherence as a function of time. Symbols marked by an "x" indicate estimates for "bad" days.
The legends show the mean and 2-sigma error on the "good" estimates.

.. note ::

In the MATLAB version of ``ATaCR``, the "Angle from H1" (Figure 4 in the manual) corresponds to a counter-clockwise rotation of H1 and H2, and the orientation is chosen at the lowest phase. Here, the angle corresponds to a clockwise rotation and the estimate is chosen to lie between 0 and 180 degrees. There is therefore a 225-degree difference between those two estimates, and the plots are mirrored.
In the MATLAB version of ``ATaCR``, the "Angle from H1" (Figure 4 in the manual) corresponds to a counter-clockwise rotation of H1 and H2. Here, the angle corresponds to a clockwise rotation and the estimate is chosen to lie within +/- 90 degrees from a phase value of 0. Furthermore, we use a circular mean (as opposed to a linear mean) to calculate the phase, and consider a narrower range of tilt frequencies closer to 0 Hz, where tilt effects are most pronounced. This results in a different plot between the ``OBStools`` version and the MATLAB ``ATaCR`` version, but these differences should not affect the tilt noise removal process.

.. figure:: ../obstools/examples/figures/Figure_6.png
:align: center
Expand Down
3 changes: 2 additions & 1 deletion docs/comply.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ Usage
are stored to disk.
positional arguments:
indb Station Database to process from.
indb Station Database to process from. Available formats are:
StDb (.pkl or .csv) or stationXML (.xml)
optional arguments:
-h, --help show this help message and exit
Expand Down
3 changes: 1 addition & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Documentation

OBStools is a package containing Python tools for processing broadband
ocean-bottom seismic (OBS) data. Current functionalities include removing
vertical component noise from tilt and compliance effects, and calculating
compliance functions from vertical displacement and pressure data. The code uses
vertical component noise from tilt and compliance effects, calculating tilt orientation from three-component seismic data, and calculating compliance functions from vertical displacement and pressure data. The code uses
the ``StDb`` package for querying and building a station database and
can be used through command-line scripts.

Expand Down
18 changes: 9 additions & 9 deletions obstools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
Dependencies
++++++++++++

- `stdb <https://github.com/schaefferaj/StDb>`_
- `obspy <https://github.com/obspy/obspy>`_
- `StDb <https://github.com/schaefferaj/StDb>`_
- `ObsPy <https://github.com/obspy/obspy>`_

Conda environment
+++++++++++++++++
Expand All @@ -69,7 +69,7 @@

conda activate obs

Install dependency:
Install StDb:

.. sourcecode:: bash

Expand Down Expand Up @@ -107,7 +107,7 @@
that reads a `SeisComP Data Structure
<https://docs.obspy.org/packages/autogen/obspy.clients.filesystem.sds.html>`_
archive containing SAC or miniSEED waveform data. Check out the scripts
``bng_calc`` and ``dl_calc`` below and the argument ``--local-data`` and
``bng_calc`` and ``dl_calc`` below and the argument ``--SDS-path`` and
``--dtype`` for more details.

Station Metadata
Expand All @@ -118,11 +118,11 @@
containing the metadata. The corresponding ObsPy documentation is
`here <https://docs.obspy.org/packages/obspy.core.inventory.html>`_.

To convert the station `XML` file to an input that can be read by
``OrientPy``, you run the command ``gen_stdb station.xml`` (only
available on StDb version 0.2.7), which will create the file
``station.pkl``. If you don't have a station `XML` file but you have
a dataless SEED file, you can convert it first to `XML` using `this
You can now use a stationXML (`.xml`) file instead of the StDb `.pkl` format.
Alternatively, you can convert the stationXML file to an StDb `.pkl` file
by running the command ``gen_stdb station.xml`` (these options are only
available on StDb version 0.2.7. If you don't have a station `XML` file but you have
a dataless SEED file, you can convert it first to XML using `this
tools <https://seiscode.iris.washington.edu/projects/stationxml-converter>`_.

Waveform Data
Expand Down
Loading
Loading