Compute Power Spectral Densities
Compute Power Spectral Densities and save results as NetCDF files.
This step processes psd workflow jobs — one job per station per day — and writes a single NetCDF file per station-channel-day containing all individual PSD window estimates. The file layout is:
<output_folder>/<psd_step_name>/_output/daily/<NET.STA.LOC.CHAN>/<YYYY-MM-DD>.nc
The NetCDF file has two dimensions: times (UTC datetimes of each PPSD
window used) and periods (period bin centres in seconds). The single
data variable is PSD with units dB.
Concurrency is safe: each worker processes a different (station, day) job selected atomically from the database, and each worker writes to a distinct file path.
Configuration Parameters (from psd config set)
psd_componentspsd_ppsd_lengthpsd_ppsd_overlappsd_ppsd_period_smoothing_width_octavespsd_ppsd_period_step_octavespsd_ppsd_period_limitspsd_ppsd_db_bins
To run this step:
$ msnoise qc compute_psd
Parallel execution:
$ msnoise -t 4 qc compute_psd
Configuration Parameters
psd.psd_components: Components to process for PSD, defaults to [E,N,Z], but can be any comma separated list (e.g. ‘Z,E,N’) (default=E,N,Z)psd.psd_ppsd_length: Length of data segments passed to psd in seconds. In the paper by McNamara et al (2004) a value of 3600 (1 hour) was chosen. Longer segments increase the upper limit of analyzed periods but decrease the number of analyzed segments. (default=3600.0)psd.psd_ppsd_overlap: Overlap of segments passed to psd. Overlap may take values between 0 and 1 and is given as fraction of the length of one segment, e.g. psd_ppsd_length=3600 and psd_ppsd_overlap=0.5 result in an overlap of 1800s of the segments. (default=0.0)psd.psd_ppsd_period_smoothing_width_octaves: Determines over what period/frequency range the psd is smoothed around every central period/frequency. Given in fractions of octaves (default of1means the psd is averaged over a full octave at each central frequency). (default=0.125)psd.psd_ppsd_period_step_octaves: Step length on frequency axis in fraction of octaves (default of0.125means one smoothed psd value on the frequency axis is measured every 1/8 of an octave). (default=0.0125)psd.psd_ppsd_period_limits: Set custom lower and upper end of period range (e.g.(0.01, 100)seconds). The specified lower end of period range will be set as the central period of the first bin (geometric mean of left/right edges of smoothing interval). At the upper end of the specified period range, no more additional bins will be added after the bin whose center frequency exceeds the given upper end for the first time. (default=(0.01,100))psd.psd_ppsd_db_bins: Specify the lower and upper boundary and the width of the db bins. The bin width might get adjusted to fit a number of equally spaced bins in between the given boundaries. (default=(-200, -50, 1.))global.hpc: Is MSNoise going to run on an HPC? (default=N)
New in version 2.0.
See also
Reading these results in Python — use MSNoiseResult:
from msnoise.results import MSNoiseResult
from msnoise.core.db import connect
db = connect()
r = MSNoiseResult.from_ids(db, ...) # include the steps you need
# then call r.get_psd(...)
See Reading outputs with MSNoiseResult for the full guide and all available methods.