nfsi-canada / OBStools

Tools for processing broadband ocean-bottom seismic data
https://nfsi-canada.github.io/OBStools/
MIT License
52 stars 35 forks source link

download_event script modified for more verbosity #36

Closed paudetseis closed 2 years ago

paudetseis commented 2 years ago

PR to clear up the scripts and add verbosity.

codecov-commenter commented 2 years ago

Codecov Report

Merging #36 (8836e42) into master (f4ee834) will decrease coverage by 0.58%. The diff coverage is 83.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
- Coverage   89.82%   89.23%   -0.59%     
==========================================
  Files          22       22              
  Lines        3615     3614       -1     
==========================================
- Hits         3247     3225      -22     
- Misses        368      389      +21     
Impacted Files Coverage Δ
obstools/tests/test_2_b_scripts_noP.py 100.00% <ø> (ø)
obstools/scripts/atacr_download_event.py 79.10% <72.13%> (-0.61%) :arrow_down:
obstools/scripts/atacr_daily_spectra.py 82.51% <75.00%> (+0.20%) :arrow_up:
obstools/__init__.py 100.00% <100.00%> (ø)
obstools/atacr/classes.py 95.04% <100.00%> (+0.29%) :arrow_up:
obstools/scripts/atacr_clean_spectra.py 88.88% <100.00%> (-0.10%) :arrow_down:
obstools/scripts/atacr_download_data.py 70.35% <100.00%> (-0.35%) :arrow_down:
obstools/scripts/atacr_transfer_functions.py 84.27% <100.00%> (-0.20%) :arrow_down:
obstools/scripts/comply_calculate.py 79.32% <100.00%> (-0.23%) :arrow_down:
obstools/tests/test_1_args.py 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f4ee834...8836e42. Read the comment docs.

paudetseis commented 2 years ago

This PR started as a simple script cleanup exercise, but failing automated tests were also uncovered and fixed. This PR also addresses an issue #35 where the scipy.signal.spectrogram function did not return the same number of windows as the ~atacr.utils.calculate_windowed_fft function. This fix involved using the SciPy function scipy.signal.stft and the frequency axis defined by scipy.fft.rfftfreq and removal of all previous calls to ~atacr.utils.calculate_windowed_fft.