-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
3b6919f
commit 1332051
Showing
5 changed files
with
24 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,44 @@ | ||
# importing general Python libraries | ||
import pandas as pd | ||
import datetime as dt | ||
import os | ||
|
||
import matplotlib.pyplot as plt | ||
import pytz | ||
import pandas as pd | ||
import plotly.graph_objects as go | ||
import pytz | ||
from orcasound_noise.pipeline.acoustic_util import plot_bb, plot_spec | ||
|
||
# importing orcasound_noise libraries | ||
from orcasound_noise.pipeline.pipeline import NoiseAnalysisPipeline | ||
from orcasound_noise.utils import Hydrophone | ||
from orcasound_noise.pipeline.acoustic_util import plot_spec, plot_bb | ||
|
||
|
||
# Set Location and Resolution | ||
# Port Townsend, 1 Hz Frequency, 60-second samples | ||
if __name__ == '__main__': | ||
pipeline = NoiseAnalysisPipeline(Hydrophone.PORT_TOWNSEND, | ||
delta_f=10, bands=None, | ||
delta_t=60, mode='safe') | ||
|
||
|
||
if __name__ == "__main__": | ||
pipeline = NoiseAnalysisPipeline( | ||
Hydrophone.PORT_TOWNSEND, delta_f=10, bands=None, delta_t=60, mode="safe" | ||
) | ||
|
||
|
||
# Generate parquet dataframes with noise levels for a time period | ||
|
||
now = dt.datetime.now(pytz.timezone('US/Pacific')) | ||
psd_path, broadband_path = pipeline.generate_parquet_file(now - dt.timedelta(hours = 6), | ||
now - dt.timedelta(hours = 1), | ||
upload_to_s3=False) | ||
now = dt.datetime.now(pytz.timezone("US/Pacific")) | ||
psd_path, broadband_path = pipeline.generate_parquet_file( | ||
now - dt.timedelta(hours=6), now - dt.timedelta(hours=1), upload_to_s3=False | ||
) | ||
|
||
# Read the parquet files | ||
psd_df = pd.read_parquet(psd_path) | ||
bb_df = pd.read_parquet(broadband_path) | ||
|
||
# Create a new directory if it does not exist | ||
if not os.path.exists('img'): | ||
os.makedirs('img') | ||
if not os.path.exists("img"): | ||
os.makedirs("img") | ||
|
||
# Create and save psd plot | ||
# Create and save psd plot | ||
fig = plot_spec(psd_df) | ||
fig.write_image('img/psd.png') | ||
fig.write_image("img/psd.png") | ||
|
||
# Create and save bb plot | ||
fig = plot_bb(bb_df) | ||
fig.savefig('img/broadband.png') | ||
fig.savefig("img/broadband.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
matplotlib | ||
scipy | ||
m3u8 | ||
matplotlib | ||
scipy | ||
m3u8 | ||
git+https://github.com/kkroening/ffmpeg-python | ||
orcasound_noise@git+https://github.com/orcasound/ambient-sound-analysis@plotting_update | ||
kaleido |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Unit tests for OOI workflow""" | ||
|
||
import datetime | ||
import os | ||
import shutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters