Skip to content

Commit

Permalink
Merge pull request #7 from uwescience/exporting_results
Browse files Browse the repository at this point in the history
Exporting results
  • Loading branch information
valentina-s authored Jun 22, 2024
2 parents c0f12b5 + 11380cd commit 2a82306
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/noise_processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Ambient Sound Processing
on:
# To run manually
workflow_dispatch:
push:
branches:
- main
- exporting_results

# schedule:
# - cron: '9 * * * *'

Expand Down Expand Up @@ -33,7 +38,22 @@ jobs:
run: |
python ambient_sound_analysis/noise_processing.py
- uses: stefanzweifel/git-auto-commit-action@v5
- name: Upload to GitHub repo
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit to Github
file_pattern: 'ambient_sound_analysis/img/*.png'

- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
name: ambient_sound_plots
path: ambient_sound_analysis/img/*.png

- name: Upload to Google Drive
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: ${{secrets.RCLONE_CONFIG}}

- run: |
rclone copy ambient_sound_analysis/img/broadband.png mydrive:rclone_uploads/
26 changes: 26 additions & 0 deletions .github/workflows/test_rclone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test Rclone

on:
# To run manually
workflow_dispatch:
# push:
# branches:
# - main
# - exporting_results

# schedule:
# - cron: '9 * * * *'

jobs:
process:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Upload to Google Drive
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: ${{secrets.RCLONE_CONFIG}}

- run: |
rclone copy ambient_sound_analysis/img/broadband.png mydrive:rclone_uploads/
Binary file modified ambient_sound_analysis/img/broadband.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ambient_sound_analysis/img/psd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ambient_sound_analysis/noise_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Set Location and Resolution
# Port Townsend, 1 Hz Frequency, 60-second samples
if __name__ == '__main__':
pipeline = NoiseAnalysisPipeline(Hydrophone.PORT_TOWNSEND,
pipeline = NoiseAnalysisPipeline(Hydrophone.ORCASOUND_LAB,
delta_f=10, bands=None,
delta_t=60, mode='safe')

Expand All @@ -25,8 +25,8 @@
# 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),
psd_path, broadband_path = pipeline.generate_parquet_file(now - dt.timedelta(hours = 9),
now - dt.timedelta(hours = 8),
upload_to_s3=False)

# Read the parquet files
Expand Down

0 comments on commit 2a82306

Please sign in to comment.