diff --git a/quarto/.gitignore b/quarto/.gitignore index 075b254..0e3521a 100644 --- a/quarto/.gitignore +++ b/quarto/.gitignore @@ -1 +1,3 @@ /.quarto/ + +**/*.quarto_ipynb diff --git a/quarto/about.qmd b/quarto/about.qmd index df57788..f163bdd 100644 --- a/quarto/about.qmd +++ b/quarto/about.qmd @@ -4,6 +4,12 @@ title: "About PAMGuard" Marine mammals, whales and dolphins in particular, are highly vocal. This means that it's often easier to hear them, than it is to see them. This is particularly true at night or in poor weather. +If you've used PAMGuard in your research, please cite our most recent paper: +Gillespie, D., Macaulay, J., Oswald, M., and Roch, M. (2026). “PAMGuard: Application software for passive acoustic detection, classification, and localisation of animal sounds,” The Journal of the Acoustical Society of America, 159, 437–443. [doi.org/10.1121/10.0042245](https://doi.org/10.1121/10.0042245). + +You may also want to cite the specific PAMGuard release you're using using it's Zenodo DOI, e.g. +Gillespie, D., & Macaulay, J. (2025). PAMGuard (V2.02.17). Zenodo. [https://doi.org/10.5281/zenodo.15593810](https://doi.org/10.5281/zenodo.15593810) and any papers written about specific detectors or models you're using. + ## Vision The PAMGuard project started in 2006, intending to address the fundamental limitations of existing cetacean passive acoustic monitoring (PAM) software by creating an integrated software infrastructure that is open source and available to all PAM users for the benefit of the marine environment. diff --git a/quarto/admin/downloadstats.qmd b/quarto/admin/downloadstats.qmd index 5626d10..fe3af1f 100644 --- a/quarto/admin/downloadstats.qmd +++ b/quarto/admin/downloadstats.qmd @@ -101,6 +101,15 @@ https://github.com/pamguard/VisualAngles/
+ +

Goniometer (Fastloc GPS)

+ +::: pgdownload +https://github.com/douggillespie/pamgonio/ +::: + +
+

Plugin Demo

::: pgdownload diff --git a/quarto/devmodules.qmd b/quarto/devmodules.qmd index 7451f19..d410891 100644 --- a/quarto/devmodules.qmd +++ b/quarto/devmodules.qmd @@ -33,9 +33,7 @@ Available components of a PAMGuard module are - Graphic Overlays - Plug in display panels -All components of a PAMGuard module are optional except for the main PamControlledUnit class. -A good place to start is to look at the [Wild Haggis Detector](plugins/haggis.html) which is a -relatively simple detector and classifier that uses most of the above features. +All components of a PAMGuard module are optional except for the main PamControlledUnit class. A good place to start is to look at the [Wild Haggis Detector](plugins/haggis.html) which is a relatively simple detector and classifier that uses most of the above features. ### The Constructor diff --git a/quarto/devplugins.qmd b/quarto/devplugins.qmd index 4d3ea5c..50e7b8f 100644 --- a/quarto/devplugins.qmd +++ b/quarto/devplugins.qmd @@ -2,19 +2,39 @@ title: "Creating Plugin Modules" --- -There are two types of PAMGuard module. [Core modules](coremodules.html) which are built into the main PAMGuard code and [Plugin modules](pluginmodules.html) which are distributed separately. This page tells you how to prepare a [Plugin modules](pluginmodules.html) for PAMGuard. +## Introduction + +There are two types of PAMGuard module. [Core modules](coremodules.html) which are built into the main PAMGuard code and [Plugin modules](pluginmodules.html) which are distributed sparately. This page tells you how to prepare a [Plugin modules](pluginmodules.html) for PAMGuard. Before reading this page, make sure you've read up on how to [develop a core module](devmodules.html) -## Writing PAMGuard Plug-ins +## Setting up a PAMGuard Plugin + +The best way to create a PAMGuard, especially if it relies on external dependencies, is to set up a Java Maven project. + +Using [Eclipse IDE](https://eclipseide.org/) set up [PAMGuard as a project](sourcecode.qmd) in your workspace. Then create a separate Maven project in the same workspace. Right click on the Maven project, select *Properties* and in the *Java Build Path* section, select the *Projects* tab. Click on *Add* and select the PAMGuard project to add it as a dependency. + +![Adding the project as a dependency](images/pamguard_plugin_eclipse.png) + +*Add PAMGuard to the plugin project's classpath* + +Now your plugin project will know all the classes in PAMGuard and you can start developing your plugin module. There are multiple types of plugins and each has an example project which you can use as a starting point. + +- To develop a standard PAMGuard module refer to the [Detector for the Scottish Wild Haggis](https://github.com/PAMGuard/haggis) detector project. +- To develop a plugin for the SoundAcquisition module (e.g. to implement new type of sound card) refer to the [Windows Sound](https://github.com/douggillespie/WindowsSound) project as an example. +- To develop a plugin for the AnalogSensor module (e.g. to implement new type of analog sensor) refer to the [Dummy Analog Device plugin](https://github.com/PAMGuard/DummyAnalogDevice) project. -ARCHIVING PLUG-INS INTO A JAR FILE FOR DISTRIBUTION +Note that in all these plugins you must duplicate a PAMGaurd class in your plugin project. For example, in a standard module class oyu must create PamModel class with the same package name as in PAMGuard. Copy the PamModel class from PAMGaurd and then add your new module in the plugin version of your PamModel class. When you run your project, the PamModel class from your plugin project will be used instead of the PAMGuard version and your plugin will appear as a module. -Even if the plugin is intended as an External module, it is easiest to develop it as a Core module. In other words, create a new package in the PAMGuard code base to hold all of the new classes, and add a reference to the package classes in PamModel. This way, dependencies do not need to be explicitly managed and debugging is simplified. All development should be done within the new package, and the core PAMGuard classes should not be changed (if modifications are necessary, please contact the PAMGuard development team first). +To run the plugin from Eclipse simply run create a Run Configuration that launches the PAMGuard main class (pamguard.Pamguard). Ensure that the plugin project is the selected in the *Project:* field. When PAMGuard starts it will find the plugin classes in the classpath and load them as if they were part of the core PAMGuard code. -To make an external PAMGuard plug-in available to PAMGuard users once development is complete, it is necessary to archive the class files and support files (including help files, graphics, sound files, etc.) into a java archive (jar) file. +![Running the plugin prject from Eclipse](images/pamguard_plugin_eclipse_2.png) *Running a plugin project (in this called X3) from Eclipse.* -Prior to archiving, the developer must add a class to the project package which implements one of two interfaces: PamModel.PamPluginInterface (for standard plug-in modules) or Acquisition.DaqSystemInterface (for data acquisition modules such as sound cards, file streams, etc.). Override all of the Interface’s inherited methods, returning appropriate values as specified in the Javadoc comments. Create a String object to hold the jar file name. This parameter does not need to be initialized to anything specific; the value will be set by PAMGuard via the inherited setter method. The code could be as simple as +## Building a plugin + +Prior to building, you must ensure that your project implements the correct plugin interface e.g. PamModel.PamPluginInterface (for standard plug-in modules) or Acquisition.DaqSystemInterface (for data acquisition modules such as sound cards, file streams, etc.). + +Override all of the Interface’s inherited methods, returning appropriate values as specified in the Javadoc comments. Create a String object to hold the jar file name. This parameter does not need to be initialized to anything specific; the value will be set by PAMGuard via the inherited setter method. The code could be as simple as ``` java String jarFile; @@ -23,9 +43,49 @@ String jarFile; } ``` +If you have external dependencies, you will need to build as a Maven project. Maven does not consider Eclipse build settings and so the build will fail unless you add PAMGuard as dependency. In your pom.xml add PAMGuard as a dependency as follows. + +``` xml + + org.pamguard + pamguard + 2.02.18 + provided + +``` + +It is also important to exclude any of the duplicate classes from your build that have been used to run the Plugin. For example, if building a standard module, ensure the PamModel class is excluded from the build. + +``` xml + + maven-compiler-plugin + 3.13.0 + + 21 + + **/PamModel/PamModel.java + + + +``` + +Run `mvn clean install` for your PAMGuard prject (not the plugin) to make sure PAMGuard is added to your local Maven repository. Maven will then build the jar. It's very import to keep `provided` as this prevents from the entire PAMGuard source code being added to the jar file. `mvn clean package` run from your plugin project will then build the plugin. + +Note that sometimes Eclipse can get confused between the workspace PAMGuard and Maven dependency so it's best to keep the Maven dependency commented out until you are ready to build the jar. + +## Help files + It is strongly recommended that help files be included with the plug-in. PAMGuard uses Oracle’s JavaHelp 2.0 system (complete details can be found here). Each page in the help file is an HTML document. Create individual HTML pages (with links and images) to describe the setup and operation of the plug-in, and save all files in the same package folder that your java program is in. Once the pages are completed, create the helpset and support files (map, TOC, index, etc.). Programs like jhelpdev can greatly simplify the process of creating these files. -### Notes: +## Testing the Plugin jar file + +To test the jar file, move it to the plugins subfolder in the PAMGuard installation folder. If there is no plugins folder, create one. When PAMGuard is started, it should find the jar file and use the information in the interface class to dynamically load the code. Remember to rename/delete the package in the PAMGuard code first, to ensure that you are really testing the jar file contents and not the original code. + +## Tips and Notes + +Even if the plugin is intended as an External module, it can be more straightforward to develop it as a Core module. In other words, create a new package in the PAMGuard code base to hold all of the new classes, and add a reference to the package classes in PamModel. This way, dependencies do not need to be explicitly managed and debugging is simplified. All development should be done within the new package, and the core PAMGuard classes should not be changed (if modifications are necessary, please contact the PAMGuard development team first). + +If plug-in development has been done in the core PAMGuard code and then exported to a jar, the \*.class files may still exist in the PAMGuard project’s bin subfolder (even if the original package has been deleted). If testing the plug-in jar in the IDE, first look through the bin subfolder and delete any plug-in\* .class files that are stored. If PAMGuard finds the classes in both the bin folder and the jar file, it is unclear which would get loaded at runtime. The class files are replaced in the bin folder every time a build is completed. Also, remember to remove references to the new module from the PamModel class, as this will be taken care of by the jar file. To have the help files added to an existing category (i.e. Classifiers, Detectors, etc.) in the PAMGUARDhelp table of contents, the top-level tag text attribute in the plug-in’s TOC xml file must match the category name exactly. Some category names have a space character at the end. If in doubt, check the PAMGUARDTOC.xml file found in src/help for a list of the TOC entries. If the top-level tag text attribute in the plug-in’s TOC xml file does not match any of the category names in the table of contents, the item is simply appended to the bottom of the list. To match the existing table of contents look-and-feel, each tag in the plug-in’s TOC xml file should have image=”topic” added as an attribute. Copy the image.gif file found in src/help to the plug-in package folder. Ensure the line is in the plug-in’s map.jhm file @@ -34,7 +94,3 @@ Specify the name of the helpset file in the plug-in interface class. Look throug Follow these steps to bundle all files together into a single jar, ready for distribution. Note the following are specific to the Eclipse IDE. Other IDE’s will have similar functionality: Right-click on the project name in the Package Explorer view and select Export In the Export window, click on the Java folder and highlight JAR file. Hit Next In the window frame on the left, make sure the package and all necessary subfolders are selected to export (sometimes subfolders created by JavaHelp - such as JavaHelpSearch – are not included in the export list by default). Click on the box beside “Export generated class files and resources” and “Export Java source files and resources”. Enter the name of the exported jar file in the text box under “Select the export destination”. You can click on the box beside “Compress the contents of the JAR file”, though this is optional. The default values for the remainder of the windows can be used. Hit Finish to export the package to the location specified. - -To test the jar file, move it to the plugins subfolder in the PAMGuard installation folder. If there is no plugins folder, create one. When PAMGuard is started, it should find the jar file and use the information in the interface class to dynamically load the code. Remember to rename/delete the package in the PAMGuard code first, to ensure that you are really testing the jar file contents and not the original code. - -Final note: if plug-in development has been done in the core PAMGuard code and then exported to a jar, the \*.class files may still exist in the PAMGuard project’s bin subfolder (even if the original package has been deleted). If testing the plug-in jar in the IDE, first look through the bin subfolder and delete any plug-in\* .class files that are stored. If PAMGuard finds the classes in both the bin folder and the jar file, it is unclear which would get loaded at runtime. The class files are replaced in the bin folder every time a build is completed. Also, remember to remove references to the new module from the PamModel class, as this will be taken care of by the jar file. diff --git a/quarto/devsubplugins.qmd b/quarto/devsubplugins.qmd new file mode 100644 index 0000000..744ae2f --- /dev/null +++ b/quarto/devsubplugins.qmd @@ -0,0 +1,21 @@ +--- +title: "Creating Sub-module Plugins" +--- + +As well as [plugins that are complete PAMGuard modules](pluginmodules.qmd) is is possible to develop +sub modules for certain PAMGuard modules. Examples are additional types of acquisition device for +the [Sound Acquisition Module](https://www.pamguard.org/olhelp/sound_processing/AcquisitionHelp/docs/AcquisitionOverview.html) and new types of analog input device for the [Array Sensor module](https://www.pamguard.org/olhelp/sensors/analogarray/docs/analogarray.html). + +For example, you may have a bespoke data acquisition system for audio data, or a new method for reading other sensors. +e.g. we've recently developed a reader for a sensor that is only available for the Raspberry Pi. It wouldn't be appropriate +to include this in the PAMGuard core, but it's useful to us on one particular project. + +The PAMGuard framework allows for easy development of additional types of sub-module plugin as required. These must all be based around a sub-class of [CommonPluginInterface](https://www.pamguard.org/api/PamModel/CommonPluginInterface.html). Any plugin module found in the PAMGuard plugins folder will be loaded when PAMGuard starts and it's help files added to the PAMGuard online help. If it's a new sub-plugin type, you'll also have to add code to the module using the plugin in oder to use that plugin. Examples modules that use sub-module plugins are +[AnalolgDeviceManager](https://github.com/PAMGuard/PAMGuard/blob/main/src/analoginput/AnalogDevicesManager.java) +and +[AcquisitionControl](https://github.com/PAMGuard/PAMGuard/blob/main/src/Acquisition/AcquisitionControl.java) +for examples. + +An example analog sensor plugin is [here](https://github.com/PAMGuard/DummyAnalogDevice/tree/main) and +a sound acquisition plugin [here](https://github.com/douggillespie/WindowsSoundJNA). + diff --git a/quarto/images/pamguard_plugin_eclipse.png b/quarto/images/pamguard_plugin_eclipse.png new file mode 100644 index 0000000..95b12d2 Binary files /dev/null and b/quarto/images/pamguard_plugin_eclipse.png differ diff --git a/quarto/images/pamguard_plugin_eclipse_2.png b/quarto/images/pamguard_plugin_eclipse_2.png new file mode 100644 index 0000000..a5e7648 Binary files /dev/null and b/quarto/images/pamguard_plugin_eclipse_2.png differ diff --git a/quarto/news/250813_pypamguardv1.qmd b/quarto/news/250813_pypamguardv1.qmd index 4e36d06..5f44f6c 100644 --- a/quarto/news/250813_pypamguardv1.qmd +++ b/quarto/news/250813_pypamguardv1.qmd @@ -8,4 +8,4 @@ We're pleased to announce the availability of pypamguard version 1.0.0: a Google Scholar. +Below are some recent publications from [the PAMGuard team](team/team.qmd) and other researchers in St Andrews that are either about PAMGuard or used PAMGuard to conduct research. Many more articles using PAMGuard can be found by searching Google Scholar or [Web of Science](https://www.webofscience.com/wos/woscc/summary/65bcbaca-94e0-4fe9-b87b-b49387556e6b-018f6d325c/086f6a2a-8ebf-4563-9906-77b519f75b02-018f6d325a/relevance/1). -1. Motabaranom, J. et. al. Seals exhibit localised avoidance of operational tidal turbines. [Journal of Applied Ecology, 2025](https://doi.org/10.1111/1365-2664.14844). +1. Gillespie, D., Macaulay, J., Oswald, M., and Roch, M. (2026). “PAMGuard: Application software for passive acoustic detection, classification, and localisation of animal sounds,” The Journal of the Acoustical Society of America, 159, 437–443. [doi.org/10.1121/10.0042245](https://doi.org/10.1121/10.0042245). -2. Garrobé, L, et. al. Comparing neural networks against click train detectors to reveal temporal trends in passive acoustic sperm whale detections. [J. Acoust. Soc. Am. 156, 4073–4084 (2024)](https://doi.org/10.1121/10.0034602) +2. Motabaranom, J. et. al. Seals exhibit localised avoidance of operational tidal turbines. [Journal of Applied Ecology, 2025](https://doi.org/10.1111/1365-2664.14844). -3. Gillespie, D. et al. Automated detection and tracking of marine mammals in the vicinity of tidal turbines using multibeam sonar. [Journal of Marine Science and Engineering 11, 2095 (2023)](https://www.mdpi.com/2077-1312/11/11/2095). +3. Garrobé, L, et. al. Comparing neural networks against click train detectors to reveal temporal trends in passive acoustic sperm whale detections. [J. Acoust. Soc. Am. 156, 4073–4084 (2024)](https://doi.org/10.1121/10.0034602) -4. Webber, T. et al. Streamlining analysis methods for large acoustic surveys using automatic detectors with operator validation. [Methods in Ecology and Evolution 13, 1765–1777 (2022)](https://doi.org/10.1111/2041-210X.13907). +4. Gillespie, D. et al. Automated detection and tracking of marine mammals in the vicinity of tidal turbines using multibeam sonar. [Journal of Marine Science and Engineering 11, 2095 (2023)](https://www.mdpi.com/2077-1312/11/11/2095). -5. Macaulay, J. D. J. et al. Implications of porpoise echolocation and dive behaviour on passive acoustic monitoring. The [Journal of the Acoustical Society of America 154, 1982–1995 (2023)](https://doi.org/10.1121/10.0021163). +5. Webber, T. et al. Streamlining analysis methods for large acoustic surveys using automatic detectors with operator validation. [Methods in Ecology and Evolution 13, 1765–1777 (2022)](https://doi.org/10.1111/2041-210X.13907). -6. Brinkløv, S. M. M. et al. Open‐source workflow approaches to passive acoustic monitoring of bats. [Methods Ecol Evol 14, 1747–1763 (2023)](https://doi.org/10.1111/2041-210X.14131). +6. Macaulay, J. D. J. et al. Implications of porpoise echolocation and dive behaviour on passive acoustic monitoring. The [Journal of the Acoustical Society of America 154, 1982–1995 (2023)](https://doi.org/10.1121/10.0021163). -7. Macaulay, J. et al. Passive acoustic tracking of the three-dimensional movements and acoustic behaviour of toothed whales in close proximity to static nets. [Methods in Ecology and Evolution In Press, (2022)](https://doi.org/10.1111/2041-210X.13828). +7. Brinkløv, S. M. M. et al. Open‐source workflow approaches to passive acoustic monitoring of bats. [Methods Ecol Evol 14, 1747–1763 (2023)](https://doi.org/10.1111/2041-210X.14131). -8. Palmer, L. et al. Harbour porpoise (Phocoena phocoena) presence is reduced during tidal turbine operation. [Aquatic Conservation: Marine and Freshwater Ecosystems (2021)](https://doi.org/10.1002/aqc.3737). +8. Macaulay, J. et al. Passive acoustic tracking of the three-dimensional movements and acoustic behaviour of toothed whales in close proximity to static nets. [Methods in Ecology and Evolution In Press, (2022)](https://doi.org/10.1111/2041-210X.13828). -9. Gillespie, D., Palmer, L., Macaulay, J., Sparling, C. & Hastie, G. Harbour porpoises exhibit localized evasion of a tidal turbine. [Aquatic Conservation: Marine and Freshwater Ecosystems (2021)](https://doi.org/10.1002/aqc.3660). +9. Palmer, L. et al. Harbour porpoise (Phocoena phocoena) presence is reduced during tidal turbine operation. [Aquatic Conservation: Marine and Freshwater Ecosystems (2021)](https://doi.org/10.1002/aqc.3737). -10. Gillespie, D., Palmer, L., Macaulay, J., Sparling, C. & Hastie, G. Passive acoustic methods for tracking the 3D movements of small cetaceans around marine structures. [PLoS ONE 15 (5), 16pp (2020)](https://doi.org/10.1371/journal.pone.0229058). +10. Gillespie, D., Palmer, L., Macaulay, J., Sparling, C. & Hastie, G. Harbour porpoises exhibit localized evasion of a tidal turbine. [Aquatic Conservation: Marine and Freshwater Ecosystems (2021)](https://doi.org/10.1002/aqc.3660). + +11. Gillespie, D., Palmer, L., Macaulay, J., Sparling, C. & Hastie, G. Passive acoustic methods for tracking the 3D movements of small cetaceans around marine structures. [PLoS ONE 15 (5), 16pp (2020)](https://doi.org/10.1371/journal.pone.0229058). diff --git a/quarto/releases/download.qmd b/quarto/releases/download.qmd index b658e22..38d4b26 100644 --- a/quarto/releases/download.qmd +++ b/quarto/releases/download.qmd @@ -18,7 +18,7 @@ Built PAMGuard installers are released approximately every three to six months. Each release is tagged on [GitHub](https://github.com/PAMGuard/PAMGuard/releases) and for recent versions a snapshot copied to the [Zenodo research repository](https://doi.org/10.5281/zenodo.13378950) at [CERN](https://home.cern/about). -Zenodo provides a Digital Object Identifier (DOI) to each release which can be used to cite the software. e.g. Gillespie, D., & Macaulay, J. (2025). PAMGuard (V2.02.17). Zenodo. https://doi.org/10.5281/zenodo.15593810 +Zenodo provides a Digital Object Identifier (DOI) to each release which can be used to cite the software. e.g. Gillespie, D., & Macaulay, J. (2025). PAMGuard (V2.02.17). Zenodo. [https://doi.org/10.5281/zenodo.15593810](https://doi.org/10.5281/zenodo.15593810). [Go to Zenodo](https://zenodo.org/records/13951593) for more citation styles for different releases. diff --git a/quarto/tutorials/matlabrpython/ProcessingPGDFs.qmd b/quarto/tutorials/matlabrpython/ProcessingPGDFs.qmd index 01ead07..4bfbada 100644 --- a/quarto/tutorials/matlabrpython/ProcessingPGDFs.qmd +++ b/quarto/tutorials/matlabrpython/ProcessingPGDFs.qmd @@ -5,7 +5,7 @@ fileusage: notlisted ## Introduction -Various [modules in PAMGuard](https://www.pamguard.org/coremodules.html) produce [binary files](https://www.pamguard.org/olhelp/utilities/BinaryStore/docs/binarystore_overview.html). Custom libraries written in MATLAB, R and Python exist to help you further process these files. In this tutorial, we will process a folder of [Click Detector](https://www.pamguard.org/olhelp/detectors/clickDetectorHelp/docs/ClickDetector_clickDetector.html) binary files, count clicks per minute and create a concatenated string of porpoise detections. +Various [modules in PAMGuard](https://www.pamguard.org/coremodules.html) produce [binary files](https://www.pamguard.org/olhelp/utilities/BinaryStore/docs/binarystore_overview.html). Custom libraries written in MATLAB, R and Python exist to help you further process these files. In this tutorial, we will process a folder of [Click Detector](https://www.pamguard.org/olhelp/detectors/clickDetectorHelp/docs/ClickDetector_clickDetector.html) binary files, count clicks in a binary file, plot [Whistle and Moan Detector](https://www.pamguard.org/olhelp/detectors/whistleMoanHelp/docs/whistleMoan_Overview.html) contours and a [long term spectral average](https://www.pamguard.org/olhelp/sound_processing/LTSA/Docs/LTSA.html), demonstrating just a small fraction of what can done with these libraries. ::: callout-note ### Version @@ -468,27 +468,27 @@ The `data` variable produced by the code above will contain at least the followi +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | R | Meaning | +===============+==============================================================================================================================================================================================================+ -| `millis` | The start time of the whistle in milliseconds. | +| `millis` | The start time of the whistle in milliseconds. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `startSample` | The first sample of the whistle often used for finer-scale time delay measurements. | +| `startSample` | The first sample of the whistle often used for finer-scale time delay measurements. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `uid` | A unique identifier for the whistle. | +| `uid` | A unique identifier for the whistle. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `channelMap` | The channel map for this whistle (one integer, made up of 32 bits, where each bit has a value 0 or 1 specifying the existence of that channel in the `contour`. | +| `channelMap` | The channel map for this whistle (one integer, made up of 32 bits, where each bit has a value 0 or 1 specifying the existence of that channel in the `contour`. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `nSlices` | The number of slices the whistle's `contour` is created from. | +| `nSlices` | The number of slices the whistle's `contour` is created from. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `amplitude` | The amplitude of the whistle. | +| `amplitude` | The amplitude of the whistle. | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `minFreq` | The minimum frequency of the contour in Hz | +| `minFreq` | The minimum frequency of the contour in Hz | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `maxFreq` | The maximum frequency of the contour in Hz | +| `maxFreq` | The maximum frequency of the contour in Hz | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `sliceData` | An array of contour slices, with each slice `x` containing: \| \| - `sliceData[x]$sliceNumber`: book-keeping; \| \| - `sliceData[x]$nPeaks`: number of peaks; \| \| - `sliceData[x]$peakData`: peak data; \| | +| `sliceData` | An array of contour slices, with each slice `x` containing: \| \| - `sliceData[x]$sliceNumber`: book-keeping; \| \| - `sliceData[x]$nPeaks`: number of peaks; \| \| - `sliceData[x]$peakData`: peak data; \| | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `contour` | An array of the same length as `sliceData` where each element `contour(x)` is the first frequency peak which defines the contour (`sliceData[x]$peakData[0][1]`). \| | +| `contour` | An array of the same length as `sliceData` where each element `contour(x)` is the first frequency peak which defines the contour (`sliceData[x]$peakData[0][1]`). \| | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `contWidth` | An array of the same length as `sliceData` where each element `contWidth(x)` is the width of the first frequency peak in that contour slice (`sliceData(x)$peakData[0][2]-sliceData(x)$peakData[0][0]`). \| | +| `contWidth` | An array of the same length as `sliceData` where each element `contWidth(x)` is the width of the first frequency peak in that contour slice (`sliceData(x)$peakData[0][2]-sliceData(x)$peakData[0][0]`). \| | +---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ## Python @@ -501,31 +501,31 @@ data = binaryFile.data The `data` variable produced by the code above will contain at least the following attributes. Please familiarise yourself with them, before continuing on to the next section. -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Python | Meaning | -+==================================+=================================================================================================================================================================+ -| `millis` | The start time of the whistle in milliseconds. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `start_sample` | The first sample of the whistle often used for finer-scale time delay measurements. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `uid` | A unique identifier for the whistle. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `channel_map` | The channel map for this whistle (one integer, made up of 32 bits, where each bit has a value 0 or 1 specifying the existence of that channel in the `contour`. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `n_slices` | The number of slices the whistle's `contour` is created from. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `amplitude` | The amplitude of the whistle. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `slice_numbers` | An array of numbers: each element `slice_numbers[x]` containing a book-keeping number for a slice. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `n_peaks` | A parallel array to `slice_numbers`, each element `n_peaks[x]` containing the number of peaks in that slice. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `peak_data` | A parallel array to `slice_numbers`, each element `peak_data[x]` containing a sub-array of peak frequency-related data for that slice. | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `contour` | A parallel array to `slice_numbers`, each element `contour[x]` containing the peak frequency of that slice (`peak_data[x][1]`). | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `cont_width` | A parallel array to `slice_numbers`, each element `slice_numbers[x]` containing the frequency width of that slice (`peak_data[x][2] - peak_data[x][0]`). | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| Python | Meaning | ++=================+=================================================================================================================================================================+ +| `millis` | The start time of the whistle in milliseconds. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `start_sample` | The first sample of the whistle often used for finer-scale time delay measurements. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `uid` | A unique identifier for the whistle. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `channel_map` | The channel map for this whistle (one integer, made up of 32 bits, where each bit has a value 0 or 1 specifying the existence of that channel in the `contour`. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `n_slices` | The number of slices the whistle's `contour` is created from. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `amplitude` | The amplitude of the whistle. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `slice_numbers` | An array of numbers: each element `slice_numbers[x]` containing a book-keeping number for a slice. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `n_peaks` | A parallel array to `slice_numbers`, each element `n_peaks[x]` containing the number of peaks in that slice. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `peak_data` | A parallel array to `slice_numbers`, each element `peak_data[x]` containing a sub-array of peak frequency-related data for that slice. | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `contour` | A parallel array to `slice_numbers`, each element `contour[x]` containing the peak frequency of that slice (`peak_data[x][1]`). | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `cont_width` | A parallel array to `slice_numbers`, each element `slice_numbers[x]` containing the frequency width of that slice (`peak_data[x][2] - peak_data[x][0]`). | ++-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ ::: ## Exercise 5: Plotting Whistle Contours diff --git a/website.Rproj b/website.Rproj index 8e3c2eb..827cca1 100644 --- a/website.Rproj +++ b/website.Rproj @@ -11,3 +11,5 @@ Encoding: UTF-8 RnwWeave: Sweave LaTeX: pdfLaTeX + +BuildType: Website