Skip to content

Commit

Permalink
name change updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sfregosi committed Aug 15, 2024
1 parent b807b90 commit fd9d12e
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 36 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/acknowledgements.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(fontawesome)
```

Development of this toolbox was funded by:
Expand Down
10 changes: 5 additions & 5 deletions docs/configuration.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Running __*agate*__ requires a few configuration files. Each of these are plain

## Mission configuration file

An example configuration file is located in the `agate/settings` folder: [`agate_config_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/agate_config_example.cnf)
An example configuration file is located in the `agate/settings` folder: [`agate_config_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/agate_config_example.cnf)

The configuration file has settings for the glider and mission, paths to relevant input and output folders, map extent and plotting settings, and acoustic system settings. Lines starting with `%` are comments.

The top section is [required](#required-configuration-settings) to initialize __*agate*__ and use the most basic functions. The remaining sections are optional depending on what __*agate*__ functionality is desired, including interfacing with the [basestation](), working with [acoustic]() data outputs, and [plotting maps](). Save this file with a unique name for each glider and mission. Descriptions of each configuration item are included in the example file as comments.

To suggest additional configuration items, please open an [issue](https://github.com/sfregosi/agate-public/issues/new){target='_blank'}.
To suggest additional configuration items, please open an [issue](https://github.com/sfregosi/agate/issues/new){target='_blank'}.

<sub>[Back to top](#)</sub>

Expand Down Expand Up @@ -146,7 +146,7 @@ CONFIG.plots.figNumList = CONFIG.plots.figSeed + [0 1 2 3 4 5 6 7 8 9];

## Basestation configuration file

The path and filename for basestation configuration file is specified in the mission configuration file. An example is located in the `agate/settings` folder: [`basestation_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/basestation_example.cnf).
The path and filename for basestation configuration file is specified in the mission configuration file. An example is located in the `agate/settings` folder: [`basestation_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/basestation_example.cnf).

This is a separate configuration file that typically does not change between missions and gliders, and contains potentially sensitive information for the SSH connection to a research group's basestation. This file should be stored somewhere central and safe, preferably outside of the GitHub repository for security reasons. This file must contain the following lines, with the inputs updated for a particular basestation:

Expand All @@ -165,7 +165,7 @@ A conversion configuration file is necessary for converting raw acoustic data to

### PMAR conversion configuration file

An example configuration file is located in the `agate/settings` folder: [`pmarConvert_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/pmarConvert_example.cnf)
An example configuration file is located in the `agate/settings` folder: [`pmarConvert_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/pmarConvert_example.cnf)

Lines starting with `%` are comments. All parameters are added to the existing `CONFIG` structure, under a nested `pm` structure. All the changeable parameters are listed/grouped at the top, but there is additional detail about each parameter as comments below. These detailed descriptions include some additional example inputs and the default settings.

Expand All @@ -186,7 +186,7 @@ Lines starting with `%` are comments. All parameters are added to the existing `

**UNDER CONSTRUCTION**

An example configuration file is located in the `agate/settings` folder: [`wisprConvert_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/wisprConvert_example.cnf)
An example configuration file is located in the `agate/settings` folder: [`wisprConvert_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/wisprConvert_example.cnf)

Lines starting with `%` are comments. All parameters are added to the existing `CONFIG` structure, under a nested `ws` structure. All the changeable parameters are listed/grouped at the top,but there is additional detail about each parameter as comments below. These detailed descriptions include some additional example inputs and the default settings.

Expand Down
6 changes: 3 additions & 3 deletions docs/contribute.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ We welcome contributions from the passive acoustic glider community! If you woul

### If you find a bug...

Please [report an issue on GitHub](https://github.com/sfregosi/agate-public/issues/new){target='_blank'}. Please use the 'Bug report' template.
Please [report an issue on GitHub](https://github.com/sfregosi/agate/issues/new){target='_blank'}. Please use the *Bug report* template.

### If you'd like to request a feature or suggest an enhancement...

Please [report an issue on GitHub](https://github.com/sfregosi/agate-public/issues/new){target='_blank'}. There is a 'Feature request' template just for this purpose.
Please [report an issue on GitHub](https://github.com/sfregosi/agate/issues/new){target='_blank'}. There is a *Feature request* template just for this purpose.

### If you'd like to add a feature or fix a bug yourself...

[Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the `agate-public` repository. This will create a copy of the repository in your own GitHub account. You can clone this fork to your local machine to work with the toolbox and make changes directly to the code, but also continue to pull changes from the primary repository to stay up to date. Then, when you have a feature you'd like to contribute back to the main repository, you can use a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) to incorporate those changes.
[Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the `agate` repository. This will create a copy of the repository in your own GitHub account. You can clone this fork to your local machine to work with the toolbox and make changes directly to the code, but also continue to pull changes from the primary repository to stay up to date. Then, when you have a feature you'd like to contribute back to the main repository, you can use a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) to incorporate those changes.

We are happy to help get folks set up with this process, so please reach out with any questions!

Expand Down
14 changes: 7 additions & 7 deletions docs/convert-acoustics.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ knitr::opts_chunk$set(
library(fontawesome)
```

The Seaglider can be equipped with a variety of acoustic systems. Two - the PMARXL and WISPR systems - both record raw data as .dat files that need to be converted to `.wav` or `.flac` for analysis. __*agate*__ includes tools to do this for both of these two systems. All conversion code is located in the `convertAcoustics` folder.
The Seaglider can be equipped with a variety of acoustic systems. Two - the PMARXL and WISPR systems - both record raw data as .dat files that need to be converted to `.wav` or `.flac` for analysis. __*agate*__ includes tools to do this for both of these two systems. All conversion code is located in the `agate\convertAcoustics` folder.

Additionally, following a mission in Spring 2023, a bug in the WISPR firmware was discovered that led to variable gain over the duration of the deployment. We developed a systematic way to 'fix' this gain in an attempt to standardize it across all files. The code needed to apply this fix is in the `convertAcoustics/fixWispr` folder.
Additionally, following a mission in Spring 2023, a bug in the WISPR firmware was discovered that led to variable gain over the duration of the deployment. We developed a systematic way to 'fix' this gain in an attempt to standardize it across all files. The code needed to apply this fix is in the `agate\convertAcoustics\fixWispr` folder.


<sub>[Back to top](#)</sub>

## Convert PMAR raw files

See [`workflow_convertPMAR.m`](https://github.com/sfregosi/agate-public/blob/main/agate/example_workflows/workflow_convertPMAR.m) in the `example_workflows` folder for a simple example workflow for converting a mission's PMAR `.dat` files to `.wav`.
See [`workflow_convertPMAR.m`](https://github.com/sfregosi/agate/blob/main/agate/example_workflows/workflow_convertPMAR.m) in the `example_workflows` folder for a simple example workflow for converting a mission's PMAR `.dat` files to `.wav`.

Like other workflows in __*agate*__ it must first be initialized with a mission-level configuration file (*e.g.*, [`agate_config_example.cnf`]( https://github.com/sfregosi/agate-public/blob/main/agate/settings/agate_config_example.cnf)). Only the top `REQUIRED` and `CONFIG.pm` settings in the `OPTIONAL - acoustics` sections of the configuration file are needed for file conversion.
Like other workflows in __*agate*__ it must first be initialized with a mission-level configuration file (*e.g.*, [`agate_config_example.cnf`]( https://github.com/sfregosi/agate/blob/main/agate/settings/agate_config_example.cnf)). Only the top `REQUIRED` and `CONFIG.pm` settings in the `OPTIONAL - acoustics` sections of the configuration file are needed for file conversion.

Additionally, a PMAR conversion configuration file (*e.g.*, [`pmarConvert_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/pmarConvert_example.cnf)) is needed. This contains the specific paths and is where you can set your desired conversion settings. Detailed descriptions of each parameter setting are in the example configuration file or can be found on the [Configuration - PMAR conversion](./configuration.html#pmar-conversion-configuration-file) page.
Additionally, a PMAR conversion configuration file (*e.g.*, [`pmarConvert_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/pmarConvert_example.cnf)) is needed. This contains the specific paths and is where you can set your desired conversion settings. Detailed descriptions of each parameter setting are in the example configuration file or can be found on the [Configuration - PMAR conversion](./configuration.html#pmar-conversion-configuration-file) page.



Expand All @@ -46,13 +46,13 @@ The general workflow was to work on one dive's worth of files at a time. That di

A MATLAB script is run for that dive's worth of files, where `.dat` files are read in and the noise levels in a specified band are compared. If they are within a similar level, then the gain is assumed to *not* change and the files are written to `.wav` as is. If the second file is louder, then it's gain is adjusted down and this adjusted file is written to `.wav` format. There are special catches in the script for instances where the noise level between the two files is not a clear 1:1 or 1:2 ratio. In those cases, the script prompts the user to manually assess and specify an adjustment. The user can use the script-generated plots and the spectrograms of the 'bad' files to make this decision.

All code needed to apply the fix is located in the `agate/processAcoustics/fixWispr` folder.
All code needed to apply the fix is located in the `agate\convertAcoustics\fixWispr` folder.

### Included files

`fix_gain.m`: This is the primary script to apply the fix. The user must update a few paths and settings and then run this script on a folder of acoustic files. More on running it below

`my_psd.m`: Function to calculate power spectral densities. Should be similar to `pwelch` but provides outputs normalized by frequency bin size
`my_psd.m`: Function to calculate power spectral densities. Results are similar to `pwelch` but provides outputs normalized by frequency bin size

`plotRMSSpec.m`: Function to plot RMS level for two files being compared

Expand Down
30 changes: 18 additions & 12 deletions docs/get-started.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,35 @@ It page is not a detailed list of all available functions and their specific doc

## Installation

*See the [Dependencies](https://sfregosi.github.io/agate-public/#dependencies) section of the home page for more info on the required Mathworks File Exchange packages (copies of these come packaged with __agate__) and MATLAB Toolbox requirements.*
*See the [Dependencies](https://sfregosi.github.io/agate/#dependencies) section of the home page for more info on the required Mathworks File Exchange packages (copies of these come packaged with __agate__) and MATLAB Toolbox requirements.*

- Download __*agate*__ from [GitHub](https://github.com/sfregosi/agate-public)
- Download __*agate*__ from [GitHub](https://github.com/sfregosi/agate)
- **Option 1:** Download the latest release
- This option ensures a stable release and removes the requirement of working with GitHub but will need manual updating
- Visit the [Releases](https://github.com/sfregosi/agate-public/releases) page and download the latest release source code as a zip or tar.gz file
- Visit the [Releases](https://github.com/sfregosi/agate/releases) page and download the latest release source code as a zip or tar.gz file
- Unzip the downloaded folder and place within the default MATLAB directory (*e.g.*, `C:\Users\User.Name\Documents\MATLAB\`). You only need the `agate` folder (the `docs` folder contains the files for this website so they can be deleted).
- **Option 2:** Clone the repository using GitHub or GitHub Desktop
- This package is actively being developed and the easiest way stay up to date with the latest improvements is to regularly check for updates from GitHub, but this comes with risks as it may be buggy
- Click on the green *Code* button and select *Open with GitHub Desktop*
- Specify where to clone the cloned local copy. Suggest the default MATLAB directory (*e.g.*, `C:\Users\User.Name\Documents\MATLAB\`)
- For more help with GitHub see this [Git Started Doc](https://github.com/PIFSC-Protected-Species-Division/PSDOS/blob/main/files/git_started.md)
- **Option 3:** Download the repository as a zip file
- **Option 3:** Fork the repository using GitHub, then clone your fork via the **Option 2** steps above
- This is the best option if you would like to modify the tools and contribute to **agate** but also stay up to date with the latest developer changes
- Click on the grey *Fork* button in the upper right and follow the prompts to create a copy of the repository in your personal GitHub account
- Follow the **Option 2** steps to clone your fork to your local computer
- In the future, use the *Sync fork* button on GitHub to update your fork with any changes in the main repository, while maintaining any of your own modification and use the *Contribute* button to create pull requests so contribute your modifications to the package
- **Option 4:** Download the repository as a zip file
- This provides the latest functionality before an official release and removes requirement of working with GitHub but will need manual updating
- Click the green *Code* button at the landing page of the repository and choose *Download ZIP*
- Unzip the downloaded folder and place within the default MATLAB directory (*e.g.*, `C:\Users\User.Name\Documents\MATLAB\`)
- Add __*agate*__ to the MATLAB path
- Open MATLAB and click on *Set Path* in the Environment section of the Home tab (@fig-screenshot-matlab-setpath)
- In the Set Path dialog box, choose *Add with Subfolders...*, select the `agate-public` folder, and click *Save*, then *Close* (@fig-screenshot-matlab-setpath-save)
- In the Set Path dialog box, choose *Add with Subfolders...*, select the `agate` folder, and click *Save*, then *Close* (@fig-screenshot-matlab-setpath-save)
- This will now be saved for future MATLAB sessions, but would need to be repeated for any installation on a new computer

[![Screenshot of MATLAB Home Tab showing where to click to Set Path](images/screenshot_matlab_setpath.png){#fig-screenshot-matlab-setpath fig-align="center" width='700'}](https://github.com/sfregosi/agate-public/blob/main/img/screenshot_matlab_setpath.png)
[![Screenshot of MATLAB Home Tab showing where to click to Set Path](images/screenshot_matlab_setpath.png){#fig-screenshot-matlab-setpath fig-align="center" width='700'}](https://github.com/sfregosi/agate/blob/main/docs/images/screenshot_matlab_setpath.png)

[![Example screenshot of the Set Pat dialog box showing the 'Add with Subfolders\...' and 'Save' buttons.](images/screenshot_matlab_setpath_save.png){#fig-screenshot-matlab-setpath-save fig-align="center" width='400'}](https://github.com/sfregosi/agate-public/blob/main/img/screenshot_matlab_setpath.png)
[![Example screenshot of the Set Path dialog box showing the *Add with Subfolders\...* and *Save* buttons.](images/screenshot_matlab_setpath_save.png){#fig-screenshot-matlab-setpath-save fig-align="center" width='400'}(https://github.com/sfregosi/agate/blob/main/docs/images/screenshot_matlab_setpath_save.png)


<sub>[Back to top](#)</sub>
Expand All @@ -51,21 +57,21 @@ Running __*agate*__ requires a few configuration files. Both of these are plain

#### Mission configuration file

An example configuration file is located in the `agate/settings` folder: [`agate_config_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/agate_config_example.cnf)
An example configuration file is located in the `agate/settings` folder: [`agate_config_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/agate_config_example.cnf)

The configuration file has settings for the glider and mission, paths to relevant input and output folders, map extent and plotting settings, and acoustic system settings. The top section is required to initialize __*agate*__ and use the most basic functions. The remaining sections are optional depending on what __*agate*__ functionality is desired. Make a copy and save this file with a unique name for each glider and mission. Descriptions of each configuration item are included in the example file as comments that start with `%`.

Additional info on setting up configuration files can be found in the [Configuration file guide](https://sfregosi.github.io/agate-public/configuration.html).
Additional info on setting up configuration files can be found in the [Configuration file guide](https://sfregosi.github.io/agate/configuration.html).

To suggest additional configuration items, please open an [issue](https://github.com/sfregosi/agate-public/issues/new){target='_blank'}.
To suggest additional configuration items, please open an [issue](https://github.com/sfregosi/agate/issues/new){target='_blank'}.

#### Basestation configuration file

The path and filename for a basestation configuration file is specified in the mission configuration file. An example is located in the `agate/settings` folder: [`basestation_example.cnf`](https://github.com/sfregosi/agate-public/blob/main/agate/settings/basestation_example.cnf).
The path and filename for a basestation configuration file is specified in the mission configuration file. An example is located in the `agate/settings` folder: [`basestation_example.cnf`](https://github.com/sfregosi/agate/blob/main/agate/settings/basestation_example.cnf).

This is a separate configuration file that typically does not change between missions and gliders, and contains potentially sensitive information for the SSH connection to a research group's basestation. *This file should be stored somewhere central and safe, preferably outside of the GitHub repository for security reasons.*

Additional info on setting up configuration files can be found in the [Configuration file guide](https://sfregosi.github.io/agate-public/configuration.html).
Additional info on setting up configuration files can be found in the [Configuration file guide](https://sfregosi.github.io/agate/configuration.html).

<sub>[Back to top](#)</sub>

Expand Down
Loading

0 comments on commit fd9d12e

Please sign in to comment.