Learn R Programming

⚠️There's a newer version (1.12.4) of this package.Take me there.

PAMmisc

PAMmisc is a collection of random utility functions that might be useful for anyone working in passive acoustics. If you have any useful tools you'd like to add, please contact Taiki Sakai: taiki.sakai@noaa.gov.

Installation

Install the latest version from GitHub:

# make sure you have Rtools installed
if(!require('devtools')) install.packages('devtools')
# install from GitHub
devtools::install_github('TaikiSan21/PAMmisc')

Functions

  • writeClickWave - Create synthetic delphinid click wav files

  • writeAMWave - Create synthetic amplitude modulated wav files

  • decimateWavFiles - Decimate .wav files to a new sample rate and write them

to a new folder. Works on either a single .wav file or an entire folder. Currently only works with single channel data, if multi-channel wav files are fed in it will only process and output the first channel.

  • squishList - A utility for compressing a list that has elements with the same

name. See examples.

  • peakTrough - Find multiple peaks and the troughs / valleys between those peaks

in the spectrum of a click. Also has a plotting feature so that you can easily see the values being chosen as peaks / troughs in the spectrum and adjust the search parameters. See help file for algorithm details.

  • wignerTransform - Compute the Wigner-Ville transform of a signal, and optionally

plot the result. This will zero-pad the input signal to the next power of two, and the result is an NxN matrix where N is the zero-padded length. Returns a list with the NxN matrix, as well as the values for the time and frequency axes.

  • addPgEvent - Add a new Event to a Pamguard database. Provide the database to

add the event to, the UIDs of the individual detections for this event, the binary files that these detections are found in, and an "eventType" name for the event. Existing events cannot be added to, so all detections for an event must be added at the same time. This function should only add to an existing database, it will not modify or remove existing entries in the database.

  • addPgGps - Add a gpsData table to a Pamguard database. Gps source can either be

a dataframe, SPOT csv file, or SPOT gpx file, or csv file with UTC, Longitude, and Latitude

  • Environmental data fetching functions to be described later

TODO

Rework decimateWavFiles to work with multi-channel data.

Copy Link

Version

Install

install.packages('PAMmisc')

Monthly Downloads

540

Version

1.12.3

License

GNU General Public License

Maintainer

Taiki Sakai

Last Published

December 11th, 2024

Functions in PAMmisc (1.12.3)

dataToRanges

Create List of the Ranges of Coordinates
ncToData

Match Data From a Netcdf File
erddapToEdinfo

Create an edinfo Object from an ERDDAP Dataset Id
fastReadWave

Load Wave File
peakTrough

Find Peaks and Troughs in a Spectrum
straightPath

Mark Straight Path Segments in GPS Track
addPgAnno

Add Spectrogram Annotations to Pamguard Database
trainSplitPermute

trainSplitPermute
addPgEvent

Add Pamguard Event to Database
getFigshareInfo

getFigshareInfo
plotPresBar

plotPresBar
plotPresGrid

plotPresGrid
readGPXTrack

Read Tracks from a GPX File
readSpecAnno

Read Pamguard Spectrogram Annotation Table
findEchoTimes

Find Estimated Echo Times
pwelch

Estimate Power Spectral Density Using Welch's Method
wignerTransform

Calculate the Wigner-Ville Transform of a Signal
raytrace

Raytrace Through a Soundspeed Profile
formatURL

Format URL for Environmental Data Download
writeClickWave

Write Click Waveform
writeAMWave

Write Amplitude Modulated Waveform
hycomList

A list of edinfo objects from HYCOM data sources
varSelect

Utility for Selecting Variables to Download
updateUID

Update Detection UIDs
matchEnvData

Match Data From an Existing Netcdf File or Download and Match
soundtrapQAQC

Perform QA/QC on Soundtrap Files
squishList

Compress a List by Name
decimateWavFiles

Decimate Wave Files
browseEdinfo

Browse a List of Environmental Datasets
createSSP

Create Sound Speed Profiles
downloadEnv

Download Environmental Data
erddapList

A list of edinfo objects from ERDDAP data sources
addPgGps

Add GPS to a Pamguard Database
edinfoToURL

Create a URL for Downloading Data from a edinfo Object
getEdinfo

Browse a List of Curated Environmental Datasets