Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acoustics module update #34

Open
wants to merge 124 commits into
base: main
Choose a base branch
from

Conversation

tnelson-integral
Copy link
Collaborator

Start of Acoustics Module update for weighting and exposure level.

@tnelson-integral
Copy link
Collaborator Author

Just starting this. Still have work to do on updating the calculations, but this will be the next large update.

@tnelson-integral tnelson-integral added the enhancement New feature or request label Jul 30, 2024
@tnelson-integral tnelson-integral self-assigned this Jul 30, 2024
@ssolson
Copy link
Collaborator

ssolson commented Sep 25, 2024

@tnelson-integral I fixed the installation issues in IntegralEnvision#17

But I am having trouble with the tutorials. Did the cases change/ is there a new shared Drive?

@tnelson-integral
Copy link
Collaborator Author

@ssolson There is a new set of files for the tutorial. I just sent you the invite to the files. Probably an enhancement for a future time is to allow .ini files with missing fields.
-Tim

@ssolson
Copy link
Collaborator

ssolson commented Sep 25, 2024

@ssolson There is a new set of files for the tutorial. I just sent you the invite to the files. Probably an enhancement for a future time is to allow .ini files with missing fields. -Tim

All the default files in the Tanana river folder have been deleted and replace with aelleson .ini file paths.

@tnelson-integral
Copy link
Collaborator Author

tnelson-integral commented Sep 25, 2024

@ssolson Should be updated now

@ssolson
Copy link
Collaborator

ssolson commented Sep 25, 2024

@ssolson Should be updated now

Same problem with the style files.

Could you just confirm that you can get the tutorials to work and update the files as needed?

@tnelson-integral
Copy link
Collaborator Author

tnelson-integral commented Sep 25, 2024

@ssolson Everything should be updated and working with the recent changes.

@ssolson
Copy link
Collaborator

ssolson commented Sep 26, 2024

@ssolson Everything should be updated and working with the recent changes.

Tim I don't know how this is working for you.

image

style_layer takes a path not a dataframe.

image

Again, could you just confirm that you can get the tutorials to work and update the files as needed?

@tnelson-integral
Copy link
Collaborator Author

tnelson-integral commented Sep 26, 2024

I can get everything to run with the last change and a small updated to the .default files

Copy link
Collaborator

@ssolson ssolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tim apologies for my delayed review on this from the Hurricane/ Conference. I am finally catching up on everything. I am having a couple of issues/ questions with this module:

I think most importantly we need to address the crashing of QGIS/ SEAT and make sure the example results are up to date in the documentation. I am not going to address all the coding issues due to budget constraints.

SEAT causes QGIS to crash if:

  1. If I click "weighting" or "Acoustic Metric" before anything else
  2. If I type a non numeric value into "Acoustic Threshold Value"
  3. If I run the acoustics module via a Load GUI then click the SEAT plugin again to run a different simulation

SEAT will crash:

  1. If I click Save GUI Inputs then cancel

Tanana River Issues

  1. After running the Tanana river example I cannot see the QuickMapService
    a. QuickMap will work before running the Tanana River example
    b. QuickMap works on the Pacwave Example
    c. Can you see QuickMap after running the example?

Pacwave Issues

  1. The Acoustics Results in PacWave example
    a. The Results are unruly due to the results being shown for 14 Sea-states. Anyway you can think of to simplify?
    b. Most of the results are a single solid color. Is this the correct output?
    c. It looks like you guys updated the acoustics documentation inputs but not the outputs. Can you update the outputs you expect so I can be sure I am matching. Currently mine are very different from the previous results.
    d. This example is really slow now on the order of 5 minutes to run. Is this expected?

@@ -386,15 +385,25 @@ def select_and_load_in(self) -> None:
self.test_exists(self.dlg.paracousti_device_not_present, fin, "Directory")
fin = config.get("Input", "paracousti probabilities file")
self.test_exists(self.dlg.paracousti_probabilities_file, fin, "File")
fin = config.get("Input", "paracousti threshold file")
self.test_exists(self.dlg.paracousti_threshold_file, fin, "File")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the tests is failing because you paracousti_threshold_value no longer comes from a file so we do not check for file existence any longer

.. _01_paracousti_preprocessing:
Paracousti Pre-Processing
-------------------------
Several metrics can be calculated from ParAcousti output that are useful in determining impacts to marine species. These include the weighted and unweighted sound pressure level (SPL) and sound exposure level (SEL). Due to the resource and time-intensive calculations, a stand-alone python routine is included within the SEAT package. This routine calculates the user selected metrics and weights form the existing Paracousti metrics. The calculated metrics are saved to a netcdf variable with the same dimensions as the original Paracousti netcdf.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

form => from

Comment on lines +27 to +34
To run the Paracousti pre-processing routine,

.. code-block:: python

from utils import paracousti_fxns
paracousti_path = r'./Path/to/Paracousti/netCDF'
save_path = r'./Path/to/save/updated/netCDF'
calc_paracousti_metrics(paracousti_path, save_path, weights="All")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really unclear on top of being a disjointed user experience. These functions should be accessible from the normal Paracousti or SEAT workflow, not some in between random function.

There is no budget to fix this at this point so going with this version:

For this to work the user will need to activate their qgis python environment. That has to be mentioned.

Is the paracousti_path and save_path above a file or a folder?

It is unclear to me if this is required to use the SEAT acoustics modules or not. Do I always need to run this pre-processing routine?

- **Geotiff Details**:
- Must have the same projection and datum as the model files.
- Will be nearest-neighbor interpolated to align with the model files' grid points (structured/unstructured).
- Must be integer classified, e.g., (0 = 'Kelp', 1 = 'Rock')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the "Depth Averaging" input?

Comment on lines +87 to +101
Depth Averaging
^^^^^^^^^^^^^^^^

The Depth Averaging drop down box serves as an option to determine the depth sampling of the model results.

.. figure:: ../../media/depth_avg.webp
:scale: 100 %
:alt: Temporal Averaging

The depth selection options for acoustics are:

1. **Depth Maximum**: Maximum value over depth.
2. **Depth Average**: Mean value over depth.
3. **Bottom Bin**: Value from bottom bin.
4. **Top Bin**: Value from top bin.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the GUI Depth Averaging is currently in inputs not the Species Properties sub Tab. Lets fix either the location in the GUI or location in the docs.

Comment on lines +13 to +17
To run this demonstration, use the **Load GUI Inputs** button located at the bottom left of the SEAT GUI, navigate to :file:`DEMO_acoustics/pacwave/`, and there will be three files available to choose from:

- `acoustics_module_SEL_199db_threshold.ini`: Sound exposure level with a 199db threshold
- `acoustics_module_SEL_HFC_173db_threshold.ini`: Sound exposure level for high frequency creteceans with a 173db threshold
- `acoustics_module_SEL_LFC_199db_threshold.ini`: Sound exposure level for low frequency creteceans with a 199db threshold
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the definition of what each demo is. We need to say which demo we are going to run for the outputs below and update the outputs to match.


.. Note::
Your paths will differ than the ones shown in the example below. If you get an error double check the paths making sure the files exist at the specified location.
Your paths will differ than the ones shown in the example below. If you get an error double check the paths making sure, or make sure that the `.ini` files are pointing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You paths will differ "from" the ones shown...

@tnelson-integral
Copy link
Collaborator Author

tnelson-integral commented Oct 31, 2024 via email

@ssolson
Copy link
Collaborator

ssolson commented Oct 31, 2024

Tim your response is puzzling. I think you are replying to maybe the least important issue.

Most important:

  • Using the SEAT version in this PR is causing QGIS to crash
  • The outputs to the documentation are outdated and I do not know what is correct.

@tnelson-integral
Copy link
Collaborator Author

tnelson-integral commented Oct 31, 2024 via email

@tnelson-integral
Copy link
Collaborator Author

This is still undergoing review. I will send you an email once this is ready.

@ssolson
Copy link
Collaborator

ssolson commented Nov 11, 2024

Thanks Tim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants