Tethys output of Group3DLocalisations

Output of Group3D localiser data. Localisations only, no Detections output for this one
This commit is contained in:
Douglas Gillespie 2024-10-01 15:00:51 +01:00
parent ef494c0d0e
commit 7533a7cfbe
46 changed files with 1090 additions and 205 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Amazon Coretto 21">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/ojdk-21.0.1">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>

View File

@ -469,7 +469,9 @@ name="_Version_2.02.11_April"></a>Version whatevers next</h1>
<h2>New Features</h2>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>Rocca update: Ability to specify whether strong
whistle/encounter threshold is applied as an absolute value, or as the
difference between the highest and second-highest votes.</p>
<h2>Bug Fixes</h2>
@ -482,19 +484,22 @@ scaling. </p>
<p class=MsoNormal>Folder processing: At startup, while PAMGuard catalogues the
sound files, a progress bar is shown. This doesnt change anything, or speed up
the process, but does at least let the user know whats happening. </p>
the process, but does at least let the user know whats happening (Issue 156). </p>
<p class=MsoNormal>No sound card ? If no sound cards are present on your
computer (or if no headphones are attached, even though a sound card is
present) when processing files offline, PAMGuard will still slow the analysis
rate as it would if a soundcard were present. </p>
<p class=MsoNormal>Click Detector click selection on the display. Fixed issue
with wrong click being selected when display was highly zoomed in (Issue 158). </p>
<h1>Version 2.02.13 August 2024</h1>
<h2>New Features</h2>
<p class=MsoNormal>Deep Learning Classifier. Major upgrade to support for Deep
Learning models in PAMGuard. See online help for details.</p>
<p class=MsoNormal>Deep Learning Classifier. Major upgrade to support for Deep Learning
models in PAMGuard. See online help for details.</p>
<p class=MsoNormal>Click detector: Remembers locations of displays and doesnt
continually reset them. </p>
@ -592,8 +597,8 @@ Pamguard ViewerMode
<p class=MsoNormal><b><span lang=EN-US>Logger Forms</span></b></p>
<p class=MsoNormal><span lang=EN-US>Boolean (logical true/false, yes/no) data
were not showing correctly in Viewer mode. Now fixed</span></p>
<p class=MsoNormal><span lang=EN-US>Boolean (logical true/false, yes/no) data were
not showing correctly in Viewer mode. Now fixed</span></p>
<p class=MsoNormal><span lang=EN-US>Data selectors for plotting on map were not
working, also fixed</span></p>
@ -899,11 +904,11 @@ font-family:"Times New Roman",serif'>&nbsp;</span></p>
<h2>File Format Change</h2>
<p class=MsoNormal>Changes have been made to the binary file format to support
the output of additional noise outputs for certain detectors (See below).
Binary files created with this version will not be compatible with earlier
versions 2.01.### and below. This version will read and may convert earlier
format binary files.</p>
<p class=MsoNormal>Changes have been made to the binary file format to support the
output of additional noise outputs for certain detectors (See below). Binary
files created with this version will not be compatible with earlier versions
2.01.### and below. This version will read and may convert earlier format
binary files.</p>
<p class=MsoNormal style='margin-bottom:0cm'><span style='font-size:12.0pt;
font-family:"Times New Roman",serif'>&nbsp;</span></p>
@ -1018,8 +1023,8 @@ off the side of whistles </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>13. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
lang=EN-US> </span>Extend the Hyperbolic Localiser to handle 2D planar arrays
(previously limited to 3D volumetric arrays) </p>
lang=EN-US> </span>Extend the Hyperbolic Localiser to handle 2D planar arrays (previously
limited to 3D volumetric arrays) </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>14. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
@ -1591,8 +1596,8 @@ lang=EN-US> </span>Updates to the Ishmael detectors.</p>
<h1><a name="_Latest_Beta_Version_2.00.16"></a><span lang=EN-US>Beta Version
2.00.16 May 2019</span></h1>
<p class=MsoNormal><span lang=EN-US>PAMGuard Version 2 contains major updates. You
should read and understand the notes listed for <a
<p class=MsoNormal><span lang=EN-US>PAMGuard Version 2 contains major updates.
You should read and understand the notes listed for <a
href="#_Latest_Beta_Version_2.00.10">Beta Version 2.00.10</a> before proceeding
with installation and use of this version.</span></p>
@ -1682,10 +1687,10 @@ lang=EN-US> </span>Added adaptive noise filter to Ishmael Detectors.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>5. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
lang=EN-US> </span>Many upgrades to the Sound Playback module, including a high-pass
filter, gain control, and the ability to mix wavefrom and envelope data
together to listen to high-frequency clicks and dolphin whistles at the same
time.</p>
lang=EN-US> </span>Many upgrades to the Sound Playback module, including a
high-pass filter, gain control, and the ability to mix wavefrom and envelope
data together to listen to high-frequency clicks and dolphin whistles at the
same time.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>6. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
@ -2230,9 +2235,9 @@ showing. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>2.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-US>Bug 323. Difar module. </span>Fixed a couple of small bugs
in the DIFAR system which caused it to not work if old configuratins were used.
</p>
</span><span lang=EN-US>Bug 323. Difar module. </span>Fixed a couple of small
bugs in the DIFAR system which caused it to not work if old configuratins were
used. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -2325,12 +2330,11 @@ UID
<h4><span lang=EN-US>Converting Old Data</span></h4>
<p class=MsoNormal><span lang=EN-US>If old data are opened with the PAMGuard
viewer they will automatically be converted. For safety, the original binary
files will not be overwritten and the new data will be placed in a new folder
on your computer with the same path as the old data, but suffixed with
_WithUID, e.g. if your binary data were previously stored in the folder
C:\MySurvey\binarydata the new data will be written to
C:\MySurvey\binarydata_WithUID. </span></p>
viewer they will automatically be converted. For safety, the original binary files
will not be overwritten and the new data will be placed in a new folder on your
computer with the same path as the old data, but suffixed with _WithUID, e.g.
if your binary data were previously stored in the folder C:\MySurvey\binarydata
the new data will be written to C:\MySurvey\binarydata_WithUID. </span></p>
<p class=MsoNormal><span lang=EN-US>The additional UID column will be added to
all database tables and populated with unique values. For data which are stored
@ -2349,11 +2353,11 @@ Note that this display is only available if you are running Java 8 or later. </s
<h3><span lang=EN-US>Event Marking and the Detection Group Localiser</span></h3>
<p class=MsoNormal><span lang=EN-US>A new system of event marking which can be
used both online and offline has been added to PAMGuard. Details are in the
PAMGuard help file (Displays/Display Marking). Data can be selected on the Map,
the Spectrogram Display and the new Time Display FX in a similar way and sent
to other PAMGuard modules. The new marking and data selection system works with
<p class=MsoNormal><span lang=EN-US>A new system of event marking which can be used
both online and offline has been added to PAMGuard. Details are in the PAMGuard
help file (Displays/Display Marking). Data can be selected on the Map, the
Spectrogram Display and the new Time Display FX in a similar way and sent to
other PAMGuard modules. The new marking and data selection system works with
the new Detection Group Localiser. The Detection Group Localiser extends the
functionality which always existed in the click detector to other types of data
(e.g. Whistles) so that they can be grouped and tracked using target motion
@ -2363,11 +2367,11 @@ PAMGuard help files (Localisation/Detection Group Localiser).</span></p>
<h3><span lang=EN-US>Display Colours</span></h3>
<p class=MsoNormal><span lang=EN-US>A new system for handling display colours
has been implemented across all PAMGuard displays. This gives greater flexibility
to the user to control how data units are shown. For instance, you might simply
want to show clicks in blue and whistles in green. However, for clicks and
whistles that have been assigned to a Detection Group, you may want to colour
them by the colour assigned to the group. </span></p>
has been implemented across all PAMGuard displays. This gives greater
flexibility to the user to control how data units are shown. For instance, you
might simply want to show clicks in blue and whistles in green. However, for
clicks and whistles that have been assigned to a Detection Group, you may want
to colour them by the colour assigned to the group. </span></p>
<h3><span lang=EN-US>Using Old PAMGuard Configurations</span></h3>
@ -2440,14 +2444,14 @@ switches/parameters to be included in *.ini files.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>1.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-US>Bug 308. Map Overlay Control. </span>Storage of data
saying what get's plotted on each map and for how long became corrupted and the
list grew to a ridiculous size. Code has been put in place to a) stop it
happening again and b) to repair any configuration files which are corrupted.
Corrupted files will be slow to load, slow to save and will be &gt; several
megabytes in size. It may be necessary to delete the PamguardSettings table in
any databases since these too may have become oversized which will slow down
viewer mode PAMGuard start-up.</p>
</span><span lang=EN-US>Bug 308. Map Overlay Control. </span>Storage of data saying
what get's plotted on each map and for how long became corrupted and the list
grew to a ridiculous size. Code has been put in place to a) stop it happening
again and b) to repair any configuration files which are corrupted. Corrupted
files will be slow to load, slow to save and will be &gt; several megabytes in
size. It may be necessary to delete the PamguardSettings table in any databases
since these too may have become oversized which will slow down viewer mode
PAMGuard start-up.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>2.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -2493,9 +2497,10 @@ January 2017</span></h1>
<p class=MsoListParagraph style='margin-left:38.25pt;text-indent:-20.25pt'><span
lang=EN-US>1.</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-US>Bug 306. Certain methods have been querying AcousticDataUnit.getDuration
and expecting to receive a response in milliseconds. However, getDuration
actually returns the number of samples. &nbsp;This has been corrected. </span></p>
</span><span lang=EN-US>Bug 306. Certain methods have been querying
AcousticDataUnit.getDuration and expecting to receive a response in
milliseconds. However, getDuration actually returns the number of samples.
&nbsp;This has been corrected. </span></p>
<p class=MsoNormal><b><span lang=EN-US>Plug-Ins</span></b></p>
@ -2699,9 +2704,9 @@ the database. </span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>2.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span lang=EN-US>The number of data streams associated with the click
detector has been tidied up so that there are a) All Click, b) Tracked Clicks
(those which are part of an event) and c) Events. </span></p>
</span><span lang=EN-US>The number of data streams associated with the click detector
has been tidied up so that there are a) All Click, b) Tracked Clicks (those
which are part of an event) and c) Events. </span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -2771,10 +2776,10 @@ since V 1.15.03:</p>
<p class=MsoListParagraph style='margin-left:38.25pt;text-indent:-20.25pt'>1.<span
style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Bug 272. File types: Some File Open / File Save dialogs were allowing selection
of all file types. e.g. Save Configuration As, Section of whistle classifier
training file, Map file Selection, These have now been changed so that only the
correct type of file can be selected.</p>
</span>Bug 272. File types: Some File Open / File Save dialogs were allowing
selection of all file types. e.g. Save Configuration As, Section of whistle
classifier training file, Map file Selection, These have now been changed so
that only the correct type of file can be selected.</p>
<p class=MsoListParagraph style='margin-left:38.25pt;text-indent:-20.25pt'>2.<span
style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -3318,9 +3323,8 @@ to read on a time. Fixed</p>
<p class=MsoNormal><i>Menu Layout</i></p>
<p class=MsoNormal>The PAMGuard menus have been rearranged into a more
intuitive grouping which we believe will help users find functionality more
easily. </p>
<p class=MsoNormal>The PAMGuard menus have been rearranged into a more intuitive
grouping which we believe will help users find functionality more easily. </p>
<p class=MsoNormal>'Detection' menu has been renamed to 'Settings' since many
menu items within this menu were not directly to do with 'Detection'.</p>
@ -3361,8 +3365,8 @@ Visual Methods</p>
<p class=MsoNormal>'<i>Multi Threading</i>' menu item moved from 'Detection'
(now 'Settings') to 'File'</p>
<p class=MsoNormal>'<i>Start</i>' and '<i>Stop</i>' menu items removed.
PAMGuard should be started and stopped using the red and black buttons.</p>
<p class=MsoNormal>'<i>Start</i>' and '<i>Stop</i>' menu items removed. PAMGuard
should be started and stopped using the red and black buttons.</p>
<p class=MsoNormal><b>New Modules</b></p>
@ -3503,10 +3507,10 @@ whistle.</p>
<p class=MsoNormal><b>Bug Fixes</b></p>
<ol style='margin-top:0cm' start=1 type=1>
<li class=MsoNormal style='margin-bottom:0cm'>Reading of wav files.
Modifications to the Java wav file reading code in order to read wav files
between 2 and 4 GByte in size (the wav standard extends to 4 Gbyte, but
Java for some reason only supports up to 2Gbyte)</li>
<li class=MsoNormal style='margin-bottom:0cm'>Reading of wav files. Modifications
to the Java wav file reading code in order to read wav files between 2 and
4 GByte in size (the wav standard extends to 4 Gbyte, but Java for some
reason only supports up to 2Gbyte)</li>
<li class=MsoNormal style='margin-bottom:0cm'>Ishmael Detector configuration.
It was impossible to correctly configure these detectors and configuration
settings were not being saved correctly. This has now been rectified. </li>
@ -3577,8 +3581,8 @@ survey software package.</p>
<p class=MsoNormal style='margin-left:36.0pt'><i>Core Functionality</i></p>
<p class=MsoNormal style='margin-left:36.0pt'>New storage options have been
implemented which give the user greater control of where data are stored. </p>
<p class=MsoNormal style='margin-left:36.0pt'>New storage options have been implemented
which give the user greater control of where data are stored. </p>
<p class=MsoNormal style='margin-left:36.0pt'>Modules have been arranged into
different groups in the configuration menus and tool tip texts have been added
@ -3600,15 +3604,15 @@ other data sources for the PAMGuard viewer. </p>
<p class=MsoNormal style='margin-left:36.0pt'><i>Database</i></p>
<p class=MsoNormal style='margin-left:36.0pt'>Can now copy data from binary storage
to the database offline for any module having both binary and database storage.
</p>
<p class=MsoNormal style='margin-left:36.0pt'>Can now copy data from binary
storage to the database offline for any module having both binary and database
storage. </p>
<p class=MsoNormal style='margin-left:36.0pt'>Can create a blank MS Access
database (2007 and later *.accdb formats only).</p>
<p class=MsoNormal style='margin-left:36.0pt'>Can open MS Access from within PAMGuard
to make it easier to view database content. </p>
<p class=MsoNormal style='margin-left:36.0pt'>Can open MS Access from within
PAMGuard to make it easier to view database content. </p>
<p class=MsoNormal style='margin-left:36.0pt'>Support for open office
databases.</p>
@ -3665,8 +3669,8 @@ inter-detection interval.</p>
margin-left:36.0pt'>&nbsp;</p>
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:36.0pt'>Target Motion Analysis: Updated target motion analysis
module so that it works in three (as opposed to two) dimensions.</p>
margin-left:36.0pt'>Target Motion Analysis: Updated target motion analysis module
so that it works in three (as opposed to two) dimensions.</p>
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
margin-left:36.0pt'>&nbsp;</p>
@ -3688,8 +3692,8 @@ margin-left:36.0pt'>&nbsp;</p>
<p class=MsoListParagraph style='margin-left:54.0pt;text-indent:-18.0pt'><i>Ishmael
Detection Modules</i></p>
<p class=MsoListParagraph style='margin-left:54.0pt;text-indent:-18.0pt'>We have
implemented database storage for output of these modules. </p>
<p class=MsoListParagraph style='margin-left:54.0pt;text-indent:-18.0pt'>We
have implemented database storage for output of these modules. </p>
<p class=MsoNormal><b>Bug fixes</b></p>
@ -3809,8 +3813,8 @@ Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Bearings can be calculated using the envelope of the waveform rather
than the full waveform. The waveform or envelope can also be filtered prior to
</span>Bearings can be calculated using the envelope of the waveform rather than
the full waveform. The waveform or envelope can also be filtered prior to
bearing calculation.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
@ -3896,9 +3900,9 @@ Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Filter and Decimator modules output data name. These were not unique in
previous versions which made it impossible for downstream modules to connect to
the correct data stream. This has been fixed. </p>
</span>Filter and Decimator modules output data name. These were not unique in previous
versions which made it impossible for downstream modules to connect to the
correct data stream. This has been fixed. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -4117,8 +4121,8 @@ existing configurations. </p>
<p class=MsoNormal>Sound acquisition</p>
<p class=MsoNormal>Changes made for a previous Mac build now incorporated into
main Beta branch. This should allow for basic 2 channel sound acquisition using
<p class=MsoNormal>Changes made for a previous Mac build now incorporated into main
Beta branch. This should allow for basic 2 channel sound acquisition using
Macs. </p>
<p class=MsoNormal>Bug Fixes</p>
@ -4363,9 +4367,9 @@ more details. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Simulated sound sources. New sound source simulator. Accessible from within
the main data acquisition dialog. The old simulator didn't work well and has
been deleted.</p>
</span>Simulated sound sources. New sound source simulator. Accessible from
within the main data acquisition dialog. The old simulator didn't work well and
has been deleted.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -4465,8 +4469,8 @@ This would cause memory leaks when multiple files were being analysed off-line
and would eventually crash PAMGUARD. The way that colours are managed in
PAMGUARD has been rewritten.&nbsp; </p>
<p class=MsoNormal>Some issues with Swing fixed that might have been causing hang
ups on startup especially on Macs/Linux machines</p>
<p class=MsoNormal>Some issues with Swing fixed that might have been causing
hang ups on startup especially on Macs/Linux machines</p>
<p class=MsoNormal>&nbsp;Some tidying up of events and default ports for serial
devices to improve GPS data collection (particularly for USB-Serial GPS on
@ -4541,10 +4545,10 @@ Utilities. This will not affect how existing settings files are loaded. </p>
<p class=MsoNormal><b>Multi-screen environments.</b></p>
<p class=MsoNormal>In previous versions, if PAMGUARD was configured in a
multiscreen environment and is then run on a single screen, it was possible that
the display would not appear. PAMGUARD now checks screen dimensions at start up
and ensures that the main display is visible. Consequently, program start-up
takes slightly longer than previously. </p>
multiscreen environment and is then run on a single screen, it was possible
that the display would not appear. PAMGUARD now checks screen dimensions at
start up and ensures that the main display is visible. Consequently, program
start-up takes slightly longer than previously. </p>
<p class=MsoNormal><b>Outstanding bugs</b></p>
@ -4845,8 +4849,8 @@ point &nbsp;located from shore)</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Seismic veto code to detect seismic pulses and then veto out that pulse from
audio and spectrogram data streams</p>
</span>Seismic veto code to detect seismic pulses and then veto out that pulse
from audio and spectrogram data streams</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -4921,8 +4925,7 @@ Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif
<h2>0.5b&nbsp;&nbsp;&nbsp; 31 August 2007 </h2>
<p class=MsoNormal>Requires Java 6 Update 2
(http://java.com/en/download/manual.jsp)</p>
<p class=MsoNormal>Requires Java 6 Update 2 (http://java.com/en/download/manual.jsp)</p>
<p class=MsoNormal>Major new features include:</p>

View File

@ -4,7 +4,7 @@
<groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId>
<name>Pamguard</name>
<version>2.02.13</version>
<version>2.02.13b</version>
<description>Pamguard using Maven to control dependencies</description>
<url>www.pamguard.org</url>
<organization>

6
javadoc.xml Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ import PamModel.parametermanager.PamParameterSet;
/**
* Parameters wrapper for array data. Shockingly, the current system just serializes
* an array list of recent arrays - ArrayList<PamArray>. Are now going to wrap that in a new class so that
* an array list of recent arrays - ArrayList of PamArray's. Are now going to wrap that in a new class so that
* the stored class can do something creative with parameter management with the new PamParameterData classes.
* @author dg50
*

View File

@ -9,8 +9,8 @@ import pamMaths.PamVector;
* more concrete locators, in particular the StaticHydrophoneLocator
* and StraightHydrophoneLocators
* @author Doug Gillespie
* @see Array.ThreadingHydrophoneLocator
* @see Array.StraightHydrophoneLocator
* @see Array.StaticHydrophoneLocator
*
*/

View File

@ -133,7 +133,7 @@ public class PitchRollComponent extends ArrayDimComponent {
if (drew) nDrawn++;
int iStreamer = getStreamerIndex(i);
if (nStreamers > 1) {
String sTxt = String.format(" S%d", iStreamer);
String sTxt = String.format("S%d", iStreamer);
xt -= fontMetrics.charsWidth(sTxt.toCharArray(), 0, sTxt.length());
g2d.drawString(sTxt, xt, yt);
}

View File

@ -1,9 +1,12 @@
package Localiser;
import java.awt.Window;
import java.io.Serializable;
import PamDetection.LocContents;
import PamDetection.LocalisationInfo;
import tethys.localization.LocalizationBuilder;
import tethys.swing.export.LocalizationOptionsPanel;
public interface LocalisationAlgorithmInfo {
@ -28,4 +31,12 @@ public interface LocalisationAlgorithmInfo {
*/
public Serializable getParameters();
/**
* Get options panel to either build into the export dialog or to show as a separate
* dialog (in which case export wizard will show a button). Can be null if no options.
* @param locBuilder
* @return options panel or null if there are no options.
*/
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder);
}

View File

@ -1,11 +1,14 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import Localiser.LocalisationAlgorithmInfo;
import PamDetection.LocContents;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
@Deprecated
public class CombinedBearingLocaliser implements BearingLocaliser {
@ -93,4 +96,9 @@ public class CombinedBearingLocaliser implements BearingLocaliser {
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import Array.ArrayManager;
@ -11,7 +12,9 @@ import Localiser.LocalisationAlgorithmInfo;
import PamDetection.LocContents;
import PamUtils.PamUtils;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
public class LSQBearingLocaliser implements BearingLocaliser {
@ -239,4 +242,9 @@ public class LSQBearingLocaliser implements BearingLocaliser {
// TODO Auto-generated method stub
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import java.util.Arrays;
@ -13,7 +14,9 @@ import PamUtils.ArrayDump;
import PamUtils.PamUtils;
import PamUtils.SystemTiming;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
/**
* Maximum likelihood bearing localiser to get bearings from a closely
@ -659,4 +662,9 @@ public class MLGridBearingLocaliser implements BearingLocaliser {
// TODO Auto-generated method stub
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import java.util.Arrays;
@ -15,8 +16,10 @@ import PamUtils.ArrayDump;
import PamUtils.PamUtils;
import PamUtils.SystemTiming;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.pamdata.AutoTethysProvider;
import tethys.swing.export.LocalizationOptionsPanel;
/**
* Revamp of the earlier MLGridBearingLocaliser but with a more sensible
@ -785,4 +788,9 @@ public class MLGridBearingLocaliser2 implements BearingLocaliser {
this.phiStep = AutoTethysProvider.roundDecimalPlaces(this.phiStep, 2);
}
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import java.util.Arrays;
@ -11,7 +12,9 @@ import Localiser.LocalisationAlgorithmInfo;
import PamDetection.LocContents;
import PamUtils.PamUtils;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
/**
* Really simple BearingLocaliser which works with two element closely
@ -314,5 +317,9 @@ public class PairBearingLocaliser implements BearingLocaliser {
public LocalizationCreator getTethysCreator() {
// TODO Auto-generated method stub
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package Localiser.algorithms.timeDelayLocalisers.bearingLoc;
import java.awt.Window;
import java.io.Serializable;
import java.util.Arrays;
@ -19,7 +20,9 @@ import Localiser.LocalisationAlgorithmInfo;
import PamDetection.LocContents;
import PamUtils.PamUtils;
import pamMaths.PamVector;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
@Deprecated
public class SimplexBearingLocaliser implements BearingLocaliser {
@ -261,6 +264,12 @@ public class SimplexBearingLocaliser implements BearingLocaliser {
public Serializable getParameters() {
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
// private class BearingConvergence implements RealConvergenceChecker {
//
// @Override

View File

@ -497,13 +497,16 @@ public class PamguardXMLWriter implements PamSettings {
// so far, everything above is the same as for the Decimus output. Now it changes however
// since we're going to add a whole load of settings 0 - many depending on the module ...
if (toWrite != null) {
ArrayList<Object> repeatStopper = new ArrayList<Object>();
Element settingEl = doc.createElement("CONFIGURATION");
moduleData.appendChild(settingEl);
for (int i = 0; i < toWrite.length; i++) {
if (wantObject(toWrite[i]) == false) {
continue;
}
Element setEl = writeSettings(doc, toWrite[i], new ArrayList<Object>());
// System.out.println("Writing settings : " + toWrite[i].toString());
Element setEl = writeSettings(doc, toWrite[i], repeatStopper);
// System.out.println("Repeat stopper has x elements: " + repeatStopper.size());
if (setEl != null) {
settingEl.appendChild(setEl);
}

View File

@ -1,6 +1,7 @@
package bearinglocaliser;
import java.awt.Frame;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
@ -31,7 +32,9 @@ import bearinglocaliser.toad.TOADBearingProvider;
import offlineProcessing.OLProcessDialog;
import offlineProcessing.OfflineTaskGroup;
import pamViewFX.fxNodes.pamDialogFX.PamDialogFX2AWT;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
import userDisplay.UserDisplayControl;
public class BearingLocaliserControl extends PamControlledUnit implements PamSettings, LocalisationAlgorithm, LocalisationAlgorithmInfo {
@ -280,4 +283,9 @@ public class BearingLocaliserControl extends PamControlledUnit implements PamSet
public Serializable getParameters() {
return bearingLocaliserParams;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package binaryFileStorage;
import java.awt.Desktop;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -31,6 +32,7 @@ import PamController.PamControlledUnitGUI;
import PamController.PamControlledUnitSettings;
import PamController.PamController;
import PamController.PamControllerInterface;
import PamController.PamFolders;
import PamController.PamGUIManager;
import PamController.PamSettingManager;
import PamController.PamSettings;
@ -478,24 +480,44 @@ PamSettingsSource, DataOutputStore {
@Override
public JMenuItem createFileMenu(JFrame parentFrame) {
JMenuItem m;
m = new JMenuItem("Storage options ...");
m.setToolTipText("Configure binary storage location and file lengths");
m.addActionListener(new BinaryStorageOptions(parentFrame));
JMenu settingsMenu = new JMenu(getUnitName());
settingsMenu.add(m);
if (isViewer || SMRUEnable.isEnable()) {
m = new JMenuItem("Storage options ...");
m.addActionListener(new BinaryStorageOptions(parentFrame));
JMenu settingsMenu = new JMenu(getUnitName());
settingsMenu.add(m);
m = new JMenuItem("Datagram options ...");
m.addActionListener(new DatagramOptions(parentFrame));
settingsMenu.add(m);
return settingsMenu;
}
else {
m = new JMenuItem("Binary Storage options ...");
m.addActionListener(new BinaryStorageOptions(parentFrame));
JMenu settingsMenu = new JMenu(getUnitName());
return m;
}
m = new JMenuItem("Open binary folder");
m.setToolTipText("Open folder in Explorer");
m.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
openBinaryFolder();
}
});
settingsMenu.add(m);
return settingsMenu;
}
protected void openBinaryFolder() {
File file = new File(binaryStoreSettings.getStoreLocation());
if (file.exists() == false || file.isDirectory() == false) {
return;
}
Desktop desktop = Desktop.getDesktop();
try {
desktop.open(file);
} catch (IOException e1) {
System.out.println("Unable to open folder " + file);
}
}
class DatagramOptions implements ActionListener {
private JFrame parentFrame;

View File

@ -25,7 +25,6 @@ import javafx.scene.shape.Rectangle;
*
* @author Jamie Macaulay
* @param <D> - the super detection type
* @param <E> - the sub detection type
*
*/
public class WaterfallSpecPlot<D extends DetectionGroupDataUnit> extends RawFFTPlot<D>{

View File

@ -1,14 +1,22 @@
package group3dlocaliser;
import IshmaelDetector.IshDetection;
import PamguardMVC.dataSelector.DataSelectorCreator;
import PamguardMVC.superdet.SuperDetDataBlock;
import group3dlocaliser.dataselector.Group3DDataSelectCreator;
import group3dlocaliser.tethys.Group3DSpeciesManager;
import group3dlocaliser.tethys.Group3DTethysProvider;
import tethys.TethysControl;
import tethys.pamdata.TethysDataProvider;
import tethys.species.DataBlockSpeciesManager;
public class Group3DDataBlock extends SuperDetDataBlock {
private Group3DProcess group3DProcess;
private Group3DDataSelectCreator dataSelCreator;
private Group3DLocaliserControl groupLocControl;
private Group3DTethysProvider group3dTethysProvider;
private Group3DSpeciesManager group3dSpeciesManager;
public Group3DDataBlock(String dataName, Group3DProcess group3DProcess, int channelMap, Group3DLocaliserControl groupLocControl) {
super(Group3DDataUnit.class, dataName, group3DProcess, channelMap, SuperDetDataBlock.ViewerLoadPolicy.LOAD_OVERLAPTIME);
@ -27,4 +35,20 @@ public class Group3DDataBlock extends SuperDetDataBlock {
return dataSelCreator;
}
@Override
public TethysDataProvider getTethysDataProvider(TethysControl tethysControl) {
if (group3dTethysProvider == null) {
group3dTethysProvider = new Group3DTethysProvider(tethysControl, groupLocControl, this);
}
return group3dTethysProvider;
}
@Override
public DataBlockSpeciesManager<IshDetection> getDatablockSpeciesManager() {
if (group3dSpeciesManager == null) {
group3dSpeciesManager = new Group3DSpeciesManager(this);
}
return group3dSpeciesManager;
}
}

View File

@ -9,6 +9,8 @@ import java.util.ArrayList;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import Localiser.LocalisationAlgorithm;
import Localiser.LocalisationAlgorithmInfo;
import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings;
import PamController.PamSettingManager;
@ -22,11 +24,14 @@ import group3dlocaliser.algorithm.toadmimplex.ToadMimplexLocaliser;
import group3dlocaliser.algorithm.toadsimplex.ToadSimplexLocaliser;
import group3dlocaliser.dialog.GroupLocSettingPaneFX;
import group3dlocaliser.offline.Group3DOfflineTask;
import group3dlocaliser.tethys.Group3DLocalizationCreator;
import group3dlocaliser.tethys.Group3dAlgorithmInfo;
import offlineProcessing.OLProcessDialog;
import offlineProcessing.OfflineTaskGroup;
import pamViewFX.fxNodes.pamDialogFX.PamDialogFX2AWT;
import tethys.localization.LocalizationCreator;
public class Group3DLocaliserControl extends PamControlledUnit implements PamSettings {
public class Group3DLocaliserControl extends PamControlledUnit implements PamSettings, LocalisationAlgorithm {
public static final String unitType = "Group 3D Localiser";
@ -40,6 +45,8 @@ public class Group3DLocaliserControl extends PamControlledUnit implements PamSet
private Group3DOfflineTask g3DOfflineTask;
private Group3dAlgorithmInfo group3dAlgorithmInfo;
public Group3DLocaliserControl(String unitName) {
super(unitType, unitName);
algorithms3D = new ArrayList<>();
@ -222,4 +229,24 @@ public class Group3DLocaliserControl extends PamControlledUnit implements PamSet
public Group3DOfflineTask getG3DOfflineTask() {
return g3DOfflineTask;
}
@Override
public LocalisationAlgorithmInfo getAlgorithmInfo() {
if (group3dAlgorithmInfo == null) {
group3dAlgorithmInfo = new Group3dAlgorithmInfo(this);
}
return group3dAlgorithmInfo;
}
@Override
public LocalizationCreator getTethysCreator() {
return new Group3DLocalizationCreator(this);
}
/**
* @return the group3dParams
*/
public Group3DParams getGroup3dParams() {
return group3dParams;
}
}

View File

@ -11,6 +11,7 @@ import PamModel.parametermanager.PrivatePamParameterData;
import group3dlocaliser.algorithm.LocaliserAlgorithm3D;
import group3dlocaliser.algorithm.LocaliserAlgorithmParams;
import group3dlocaliser.grouper.DetectionGrouperParams;
import tethys.localization.CoordinateName;
public class Group3DParams implements Serializable, Cloneable, ManagedParameters {
@ -27,6 +28,8 @@ public class Group3DParams implements Serializable, Cloneable, ManagedParameters
private Hashtable<String, LocaliserAlgorithmParams> algorithmSpecificParams;
private CoordinateName exportCoordinateName = CoordinateName.WGS84;
/* (non-Javadoc)
* @see java.lang.Object#clone()
*/
@ -157,5 +160,22 @@ public class Group3DParams implements Serializable, Cloneable, ManagedParameters
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
/**
* @return the exportCoordinateName
*/
public CoordinateName getExportCoordinateName() {
if (exportCoordinateName == null) {
exportCoordinateName = CoordinateName.WGS84;
}
return exportCoordinateName;
}
/**
* @param exportCoordinateName the exportCoordinateName to set
*/
public void setExportCoordinateName(CoordinateName exportCoordinateName) {
this.exportCoordinateName = exportCoordinateName;
}
}

View File

@ -9,6 +9,7 @@ import Localiser.detectionGroupLocaliser.GroupLocalisation;
import PamController.PamController;
import PamController.PamControllerInterface;
import PamDetection.AbstractLocalisation;
import PamDetection.LocContents;
import PamUtils.CPUMonitor;
import PamView.GroupedDataSource;
import PamView.GroupedSourceParameters;
@ -40,6 +41,8 @@ public class Group3DProcess extends PamProcess implements DetectionGroupMonitor
private CPUMonitor cpuMonitor = new CPUMonitor();
private int standardLocContents = LocContents.HAS_LATLONG | LocContents.HAS_DEPTH | LocContents.HAS_XYZ | LocContents.HAS_PERPENDICULARERRORS;
/**
* Process for 3D localisation based on multiple hydrophone clusters.
* <p>
@ -61,6 +64,7 @@ public class Group3DProcess extends PamProcess implements DetectionGroupMonitor
Group3DOverlayDraw.defaultSymbol.getSymbolData()));
group3dLogging = new Group3DLogging(group3DControl, group3dDataBlock);
group3dDataBlock.SetLogging(group3dLogging);
group3dDataBlock.setLocalisationContents(standardLocContents );
}
/*
@ -228,7 +232,7 @@ public class Group3DProcess extends PamProcess implements DetectionGroupMonitor
}
}
System.out.println("Ran localisation " + i + " " + localiserAlgorithm3D.getName() + " got: " + abstractLocalisation.getLatLong(0) + " " + abstractLocalisation.getHeight(0) + " Error: " + abstractLocalisation.getLocError(0));
// System.out.println("Ran localisation " + i + " " + localiserAlgorithm3D.getName() + " got: " + abstractLocalisation.getLatLong(0) + " " + abstractLocalisation.getHeight(0) + " Error: " + abstractLocalisation.getLocError(0));
if (abstractLocalisation instanceof GroupLocalisation) {
groupLocalisation = (GroupLocalisation) abstractLocalisation;
@ -285,7 +289,7 @@ public class Group3DProcess extends PamProcess implements DetectionGroupMonitor
Group3DDataUnit newDataUnit = group3dDataUnits[bestSet];
newDataUnit.setLocalisation(bestLocalisation);
System.out.println("Set click localisation: " + bestSet + " " + bestLocalisation.getRange(0) + " " + bestLocalisation.getLatLong(0));
// System.out.println("Set click localisation: " + bestSet + " " + bestLocalisation.getRange(0) + " " + bestLocalisation.getLatLong(0));
group3dDataBlock.addPamData(newDataUnit);
if (group3DControl.isViewer()) {
// call explicityly since it won't happen in normal mode.
@ -314,7 +318,7 @@ public class Group3DProcess extends PamProcess implements DetectionGroupMonitor
LocaliserError err = result1.getLocError();
//if one has location information and the other does not, choose the one with the
System.out.println("LAT LONG TEST: " + result1.getLatLong() + " " + result2.getLatLong());
// System.out.println("LAT LONG TEST: " + result1.getLatLong() + " " + result2.getLatLong());
if (result1.getLatLong()==null && result2.getLatLong()!=null) {
return false;
}

View File

@ -125,7 +125,7 @@ abstract public class TOADBaseAlgorithm extends LocaliserAlgorithm3D {
groupDataUnit.getTimeMilliseconds());
System.out.println("HYDROPHONE 0 POSITION: "+ groupDataUnit.getTimeMilliseconds() + " " + geometry.getGeometry()[0]);
// System.out.println("HYDROPHONE 0 POSITION: "+ groupDataUnit.getTimeMilliseconds() + " " + geometry.getGeometry()[0]);
// if (groupDataUnit.getSubDetection(0).getUID() == 9035003222L) {

View File

@ -265,6 +265,9 @@ public class DetectionGrouper {
* @param motherGroup
*/
private void processFirstGroup(FirstGrouping motherGroup) {
if (motherGroup == null) {
return;
}
List<PamDataUnit> dataUnits = motherGroup.getDataUnits();
// for (int i = 0; i < dataUnits.size(); i++) {
// if (dataUnits.get(i).getUID() == 291039474) {
@ -422,7 +425,7 @@ public class DetectionGrouper {
}
}
if (nAccepted > 0) {
System.out.printf("Accepted %d of %d data combinations\n", detectionGroupedSet.getNumGroups(), totalCombinations);
// System.out.printf("Accepted %d of %d data combinations\n", detectionGroupedSet.getNumGroups(), totalCombinations);
detectionGroupMonitor.newGroupedDataSet(detectionGroupedSet);
}

View File

@ -25,7 +25,6 @@ public class Group3DLogging extends SuperDetLogging {
private Group3DLocaliserControl group3DControl;
private PamTableItem masterChild, otherChilds;
// superId;
private SQLLoggingAddon currentSQLAddon;

View File

@ -0,0 +1,151 @@
package group3dlocaliser.tethys;
import java.util.List;
import Localiser.algorithms.locErrors.LocaliserError;
import Localiser.detectionGroupLocaliser.GroupLocalisation;
import PamDetection.AbstractLocalisation;
import PamUtils.LatLong;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import group3dlocaliser.Group3DLocaliserControl;
import nilus.CartesianCoordinateType;
import nilus.LocalizationType;
import nilus.LocalizationType.Cartesian;
import nilus.LocalizationType.WGS84;
import nilus.Localize;
import nilus.WGS84CoordinateType;
import pamMaths.PamVector;
import nilus.Localize.Effort;
import nilus.Localize.Effort.CoordinateReferenceSystem;
import nilus.Localize.Effort.CoordinateReferenceSystem.ReferenceFrame;
import tethys.localization.CoordinateName;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.localization.LocalizationSubTypes;
import tethys.localization.LocalizationTypes;
import tethys.localization.TethysLatLong;
import tethys.pamdata.AutoTethysProvider;
public class Group3DLocalizationCreator implements LocalizationCreator {
private Group3DLocaliserControl group3DControl;
private boolean hasDepth;
public Group3DLocalizationCreator(Group3DLocaliserControl group3DControl) {
this.group3DControl = group3DControl;
}
@Override
public boolean sortLocalisationCoordinates(LocalizationBuilder localizationBuilder, PamDataBlock dataBlock) {
Localize doc = localizationBuilder.getCurrentDocument();
Effort locEffort = doc.getEffort();
List<String> locTypes = locEffort.getLocalizationType();
/**
* CoordinateName should be WGS84 or Cartesian.
*/
CoordinateName coordinateName = group3DControl.getGroup3dParams().getExportCoordinateName();
LocalizationSubTypes coordSubType = coordinateName.getSubType();
// always a point whether it's cartesian or WGS84
locTypes.add(LocalizationTypes.Point.toString());
CoordinateReferenceSystem coordRefs = locEffort.getCoordinateReferenceSystem();
coordRefs.setName(coordinateName.toString());
coordRefs.setSubtype(coordinateName.getSubType().toString());
ReferenceFrame refFrame = localizationBuilder.getDefaultReferenceFrame(coordinateName, coordinateName.getSubType());
if (refFrame != null) {
coordRefs.setReferenceFrame(refFrame);
}
locEffort.setDimension(2);// may get updated at end if hasDepth becomes true.
hasDepth = false;
return true;
}
@Override
public LocalizationType createLocalization(LocalizationBuilder localizationBuilder, PamDataUnit dataUnit) {
CoordinateName coordinateName = group3DControl.getGroup3dParams().getExportCoordinateName();
LocalizationType locType = localizationBuilder.makeBaseLoc(dataUnit);
switch (coordinateName) {
case Cartesian:
Cartesian cartesianValue = createCartesianValue(localizationBuilder, dataUnit);
if (cartesianValue == null) {
return null;
}
locType.setCartesian(cartesianValue);
break;
case WGS84:
WGS84 wgs84 = createWGS84Localisation(localizationBuilder, dataUnit);
if (wgs84 == null) {
return null;
}
locType.setWGS84(wgs84);
break;
}
return locType;
}
private WGS84 createWGS84Localisation(LocalizationBuilder localizationBuilder, PamDataUnit dataUnit) {
WGS84 wgs84 = new WGS84();
AbstractLocalisation loc = dataUnit.getLocalisation();
if (loc instanceof GroupLocalisation == false) {
return null;
}
GroupLocalisation groupLoc = (GroupLocalisation) loc;
LatLong ll = loc.getLatLong(0);
if (ll == null) {
return null;
}
WGS84CoordinateType wgsCoordinate = new WGS84CoordinateType();
wgsCoordinate.setLatitude(TethysLatLong.formatLatitude(ll.getLatitude(), TethysLatLong.mmDecimalPlaces));
wgsCoordinate.setLongitude(TethysLatLong.formatLongitude(ll.getLongitude(), TethysLatLong.mmDecimalPlaces));
if (ll.getNumCoordinates() == 3) {
hasDepth = true;
wgsCoordinate.setElevationM(AutoTethysProvider.roundDecimalPlaces(ll.getHeight(), 3));
}
wgs84.setCoordinate(wgsCoordinate);
return wgs84;
}
private Cartesian createCartesianValue(LocalizationBuilder localizationBuilder,
PamDataUnit dataUnit) {
Cartesian cart = new Cartesian();
CartesianCoordinateType cartCoordinate = new CartesianCoordinateType();
AbstractLocalisation loc = dataUnit.getLocalisation();
if (loc instanceof GroupLocalisation == false) {
return null;
}
GroupLocalisation groupLoc = (GroupLocalisation) loc;
LatLong ll = loc.getLatLong(0);
if (ll == null) {
return null;
}
LatLong refLatLong = dataUnit.getOriginLatLong(false);
if (refLatLong == null) {
return null;
}
cartCoordinate.setXM(AutoTethysProvider.roundDecimalPlaces(refLatLong.distanceToMetresX(ll),3));
cartCoordinate.setYM(AutoTethysProvider.roundDecimalPlaces(refLatLong.distanceToMetresY(ll),3));
if (ll.getNumCoordinates() == 3) {
cartCoordinate.setZM(AutoTethysProvider.roundDecimalPlaces(ll.getHeight()-refLatLong.getHeight(),3));
}
LocaliserError locErr = loc.getLocError(0);
cart.setCoordinate(cartCoordinate);
return cart;
}
@Override
public boolean checkDocument(LocalizationBuilder localizationBuilder) {
boolean ok = localizationBuilder.checkDocument();
Effort locEffort = localizationBuilder.getCurrentDocument().getEffort();
locEffort.setDimension(hasDepth ? 3 : 2);
return ok;
}
}

View File

@ -0,0 +1,15 @@
package group3dlocaliser.tethys;
import PamguardMVC.PamDataBlock;
import tethys.species.FixedSpeciesManager;
public class Group3DSpeciesManager extends FixedSpeciesManager {
private static final int itisCode = 180403;
private static final String name = "Cetacea";
private static final String callType = "Group Localisation";
public Group3DSpeciesManager(PamDataBlock dataBlock) {
super(dataBlock, itisCode, name, callType);
}
}

View File

@ -0,0 +1,22 @@
package group3dlocaliser.tethys;
import PamguardMVC.PamDataBlock;
import group3dlocaliser.Group3DLocaliserControl;
import tethys.TethysControl;
import tethys.pamdata.AutoTethysProvider;
public class Group3DTethysProvider extends AutoTethysProvider {
private Group3DLocaliserControl group3dLocaliserControl;
public Group3DTethysProvider(TethysControl tethysControl, Group3DLocaliserControl group3dLocaliserControl, PamDataBlock pamDataBlock) {
super(tethysControl, pamDataBlock);
this.group3dLocaliserControl = group3dLocaliserControl;
}
@Override
public boolean hasDetections() {
return false;
}
}

View File

@ -0,0 +1,62 @@
package group3dlocaliser.tethys;
import java.awt.Window;
import java.io.Serializable;
import Localiser.LocalisationAlgorithmInfo;
import group3dlocaliser.Group3DLocaliserControl;
import group3dlocaliser.Group3DParams;
import tethys.localization.CoordinateName;
import tethys.localization.LocalizationBuilder;
import tethys.swing.export.CoordinateChoice;
import tethys.swing.export.CoordinateChoisePanel;
import tethys.swing.export.LocalizationOptionsPanel;
public class Group3dAlgorithmInfo implements LocalisationAlgorithmInfo, CoordinateChoice {
private Group3DLocaliserControl group3DControl;
private CoordinateName[] possibleCoordinates = {CoordinateName.WGS84, CoordinateName.Cartesian};
public Group3dAlgorithmInfo(Group3DLocaliserControl group3DControl) {
this.group3DControl = group3DControl;
}
@Override
public int getLocalisationContents() {
return group3DControl.getGroup3dProcess().getGroup3dDataBlock().getLocalisationContents().getLocContent();
}
@Override
public String getAlgorithmName() {
return group3DControl.getUnitType();
}
@Override
public Serializable getParameters() {
return group3DControl.getSettingsReference();
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return new CoordinateChoisePanel(this);
}
@Override
public CoordinateName[] getPossibleCoordinates() {
return possibleCoordinates;
}
@Override
public CoordinateName getCoordinateName() {
Group3DParams params = group3DControl.getGrid3dParams();
return params.getExportCoordinateName();
}
@Override
public void setCoordinateName(CoordinateName coordinateName) {
Group3DParams params = group3DControl.getGrid3dParams();
params.setExportCoordinateName(coordinateName);
}
}

View File

@ -240,17 +240,23 @@ public class RXTablePanel2 extends DataBlockTableView<BuoyStatusDataUnit>{
}
private Integer getExtraInfoIndex(int column) {
if (networkReceiver == null) {
return null;
}
column -= (colNames1.length);
return (column >= 0 & column < networkReceiver.getExtraTableInfo().size() ? column : null);
}
private Integer getCols2Index(int column) {
if (networkReceiver == null) {
return null;
}
column -= (colNames1.length + networkReceiver.getExtraTableInfo().size());
return (column >= 0 & column < colNames2.length ? column : null);
}
private Integer getDatablockIndex(int column) {
if (networkReceiver.getRxDataBlocks() == null) {
if (networkReceiver == null || networkReceiver.getRxDataBlocks() == null) {
return null;
}
column -= (colNames1.length + networkReceiver.getExtraTableInfo().size() + colNames2.length);

View File

@ -27,10 +27,10 @@ public class BeakedWhaleCluster extends StandardQACluster {
/*
* The tagged whales started vocalizing at depths ranging from 178 m to 643 m,
* with maximum depths ranging from 530 m to 1390 m for the different dives.
* The mean foraging depth of the whales during regular clicking was at 698m (range 435m 1110 m)
* for the animals from El Hierro and 833m (range 392 m 1190m) for the animals from the Bahamas
* (Table 1). Whales depth during vocalization periods (Fig. 4 and 5) had a mean value of 753 m
* (561 m 880 m 5 - 95 % quantiles).
* The mean foraging depth of the whales during regular clicking was at 698m (range 435m - 1110 m)
* for the animals from El Hierro and 833m (range 392 m - 1190m) for the animals from the Bahamas
* (Table 1). Whales depth during vocalization periods (Fig. 4 and 5) had a mean value of 753 m
* (561 m - 880 m 5 - 95 % quantiles).
*
* Think I'll use the El Hierro, since has larger confidnece interval, so mean = 833, STD=(1190-392)/4=200
*/

View File

@ -69,7 +69,7 @@ import rawDeepLearningClassifier.segmenter.SegmenterProcess;
* Currently the jdl4pam library supports three types of deep learning model,
* Generic, AnimalSpot and Ketos.
* <p>
* <li>Generic</li>
* Generic<br>
* Generic models allows users to load almost any type of model and manually
* assign the types of data transform and input shape. This means that the user
* has to get the settings exactly right or the model will not work. It is the
@ -77,14 +77,14 @@ import rawDeepLearningClassifier.segmenter.SegmenterProcess;
* However, users can export a settings file which makes it easier to set up for
* another user.
* <p><p>
* <li>AnimalSpot </li>
* AnimalSpot <br>
* AnimalSpot is a framework for training acoustic deep learning
* models using Pytorch. Users can load a .py model which contains embedded
* metadata so that PMAGuard knows the exact transforms required for the model
* input. This makes deploying models in PAMGuard very easy - users require little
* or no experience to get this working.
* <p>
* <li>Ketos</li>
* Ketos<br>
* Ketos is a framework for training acoustic deep learning models
* using TensorFlow. Users can load a .ktpb model which contains embedded
* metadata so that PMAGuard knows the exact transforms required for the model

View File

@ -1,6 +1,7 @@
package targetMotionOld;
import java.awt.Frame;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
@ -26,8 +27,11 @@ import Localiser.detectionGroupLocaliser.GroupDetection;
import Localiser.detectionGroupLocaliser.GroupLocResult;
import Localiser.detectionGroupLocaliser.GroupLocalisation;
import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings;
import PamController.PamController;
import PamController.PamControllerInterface;
import PamController.PamSettingManager;
import PamController.PamSettings;
import PamDetection.AbstractLocalisation;
import PamDetection.LocContents;
import PamguardMVC.PamDataBlock;
@ -42,7 +46,10 @@ import targetMotionOld.algorithms.Simplex2DNew;
import targetMotionOld.algorithms.Simplex3DNew;
import targetMotionOld.dialog.TargetMotionDialog;
import targetMotionOld.tethys.TMALocalizationCreator;
import targetMotionOld.tethys.TMAOptionsPanel;
import tethys.localization.LocalizationBuilder;
import tethys.localization.LocalizationCreator;
import tethys.swing.export.LocalizationOptionsPanel;
/**
* Reinstated Target motion add-in as used by the click detector. Hope one day still to replace this
@ -51,7 +58,7 @@ import tethys.localization.LocalizationCreator;
*
* @param <T>
*/
public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLocaliser<T> implements LocalisationAlgorithm, LocalisationAlgorithmInfo {
public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLocaliser<T> implements LocalisationAlgorithm, LocalisationAlgorithmInfo, PamSettings {
public enum Interractive {START, SAVE, BACK, CANCEL, SETNULL, KEEPOLD}
// public enum WorkStatus {IDLE, LOADING, WAITING};
@ -64,6 +71,8 @@ public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLoc
private ArrayList<GroupLocResult> results = new ArrayList<GroupLocResult>();
private int bestResultIndex = -1;
private EventLocaliserWorker eventLocaliserWorker;
private TargetMotionOptions targetMotionOptions = new TargetMotionOptions();
// private Object dataSynchObject = new Object();
// /**
@ -96,6 +105,8 @@ public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLoc
models.add(new LeastSquaresNew<T>(this));
models.add(new Simplex2DNew<T>(this));
models.add(new Simplex3DNew<T>(this));
PamSettingManager.getInstance().registerSettings(this);
}
@Override
@ -756,4 +767,43 @@ public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLoc
// return new BearingLocaliserParams();
return null;
}
@Override
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) {
return null;// new TMAOptionsPanel(parent, this);
}
@Override
public String getUnitName() {
return pamControlledUnit.getUnitName();
}
@Override
public String getUnitType() {
return "Target Motion Localiser (old)";
}
@Override
public Serializable getSettingsReference() {
return targetMotionOptions;
}
@Override
public long getSettingsVersion() {
return TargetMotionOptions.serialVersionUID;
}
@Override
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
this.targetMotionOptions = (TargetMotionOptions) pamControlledUnitSettings.getSettings();
return true;
}
/**
* @return the targetMotionOptions
*/
public TargetMotionOptions getTargetMotionOptions() {
return targetMotionOptions;
}
}

View File

@ -0,0 +1,20 @@
package targetMotionOld;
import java.io.Serializable;
import tethys.localization.CoordinateName;
public class TargetMotionOptions implements Serializable, Cloneable{
public static final long serialVersionUID = 1L;
/**
* Coordinate choice for Tethys export.
*/
public CoordinateName exportCoordinate = CoordinateName.WGS84;
public TargetMotionOptions() {
// TODO Auto-generated constructor stub
}
}

View File

@ -1,5 +1,6 @@
package targetMotionOld.tethys;
import java.awt.Window;
import java.util.List;
import Localiser.LocaliserModel;
@ -24,6 +25,7 @@ import nilus.Localize.Effort.CoordinateReferenceSystem;
import nilus.Localize.Effort.CoordinateReferenceSystem.ReferenceFrame;
import pamMaths.PamVector;
import targetMotionOld.TargetMotionLocaliser;
import targetMotionOld.TargetMotionOptions;
import tethys.TethysTimeFuncs;
import tethys.localization.Anchor;
import tethys.localization.CoordinateName;
@ -33,18 +35,22 @@ import tethys.localization.LocalizationSubTypes;
import tethys.localization.LocalizationTypes;
import tethys.localization.TimeReference;
import tethys.pamdata.AutoTethysProvider;
import tethys.swing.export.LocalizationOptionsPanel;
public class TMALocalizationCreator implements LocalizationCreator {
int maxDimension = 2;
private TargetMotionLocaliser targetMotionLocaliser;
public TMALocalizationCreator(TargetMotionLocaliser targetMotionLocaliser) {
// TODO Auto-generated constructor stub
this.targetMotionLocaliser = targetMotionLocaliser;
}
@Override
public boolean sortLocalisationCoordinates(LocalizationBuilder localizationBuilder, PamDataBlock dataBlock) {
Localize doc = localizationBuilder.getCurrentDocument();
Effort locEffort = doc.getEffort();
locEffort.setTimeReference(TimeReference.beam.toString());
@ -54,49 +60,129 @@ public class TMALocalizationCreator implements LocalizationCreator {
locTypes.add(LocalizationTypes.PerpendicularRange.toString());
/**
* Currently, TMA is only outputing as WGS84. Future release will have
* options to put out local xyz coordinates instead, in which case this
* will be Engineering and the referenceFrame will become instrument.
* Set the coordinate type based on the options.
*/
CoordinateReferenceSystem coordRefs = locEffort.getCoordinateReferenceSystem();
coordRefs.setName(CoordinateName.WGS84.toString());
coordRefs.setSubtype(LocalizationSubTypes.Geographic.toString());
CoordinateName coordName = getCoordinateName();
ReferenceFrame refFrame = localizationBuilder.getDefaultReferenceFrame(CoordinateName.WGS84, LocalizationSubTypes.Geographic);
CoordinateReferenceSystem coordRefs = locEffort.getCoordinateReferenceSystem();
coordRefs.setName(coordName.toString());
coordRefs.setSubtype(coordName.getSubType().toString());
ReferenceFrame refFrame = localizationBuilder.getDefaultReferenceFrame(coordName, coordName.getSubType());
if (refFrame != null) {
coordRefs.setReferenceFrame(refFrame);
}
// /**
// * TMA is always references to the earth.
// */
// ReferenceFrame refFrame = coordRefs.getReferenceFrame();
// if (refFrame == null) {
// refFrame = new ReferenceFrame();
// try {
// Helper.createRequiredElements(refFrame);
// } catch (IllegalArgumentException | IllegalAccessException | InstantiationException e) {
// e.printStackTrace();
// }
// coordRefs.setReferenceFrame(refFrame);
// }
// refFrame.setAnchor(Anchor.WGS84.toString());
locEffort.setDimension(2);
locEffort.setDimension(2);
return true;
}
/**
* Get the coordinate type, setting to WGS84 if it's undefined.
* @return Coordinate name
*/
private CoordinateName getCoordinateName() {
// TargetMotionOptions tmaOptions = targetMotionLocaliser.getTargetMotionOptions();
// if (tmaOptions.exportCoordinate == null) {
// tmaOptions.exportCoordinate = CoordinateName.WGS84;
// }
// return tmaOptions.exportCoordinate;
return CoordinateName.WGS84; // always this I think. I don't see a possibility of options in this one.
}
@Override
public LocalizationType createLocalization(LocalizationBuilder localizationBuilder, PamDataUnit dataUnit) {
/*
* Add two types of localisation. A WGS84 and a perpendicular range.
*/
CoordinateName coordName = getCoordinateName();
AbstractLocalisation pamLoc = dataUnit.getLocalisation();
LatLong latLong = pamLoc.getLatLong(0);
if (pamLoc instanceof GroupLocalisation == false || latLong == null) {
return localizationBuilder.createStandardLocalization(dataUnit);
if (pamLoc == null) {
return null;
}
if (pamLoc instanceof GroupLocalisation == false) {
return null;
}
LocalizationType loc = localizationBuilder.makeBaseLoc(dataUnit);
boolean locOk = false;
switch (coordName) {
case WGS84:
locOk = makeWGS84Localization(loc, pamLoc);
break;
case Cartesian:
locOk = makeCartesianLocalization(loc, pamLoc);
break;
case Cylindrical:
locOk = makeCylinderLocalization(loc, pamLoc);
break;
}
if (locOk == false) {
return null;
}
GroupLocalisation groupLoc = (GroupLocalisation) pamLoc;
GroupLocResult groupLocResult = groupLoc.getGroupLocaResult(0);
LocaliserModel tmaModel = groupLocResult.getModel();
// set the TMA information
Parameters params = loc.getParameters();
if (params == null) {
params = new Parameters();
loc.setParameters(params);
}
TargetMotionAnalysis tma = new TargetMotionAnalysis();
tma.setStart(TethysTimeFuncs.xmlGregCalFromMillis(dataUnit.getTimeMilliseconds()));
tma.setEnd(TethysTimeFuncs.xmlGregCalFromMillis(dataUnit.getEndTimeInMilliseconds()));
params.setTargetMotionAnalysis(tma);
Long timeAbeam = groupLocResult.getBeamTime();
if (timeAbeam != null) {
loc.setTimeStamp(TethysTimeFuncs.xmlGregCalFromMillis(timeAbeam));
}
// now also output a perpendicular distance.
Double perp = groupLocResult.getPerpendicularDistance();
if (perp != null) {
loc.setPerpendicularRangeM(AutoTethysProvider.roundDecimalPlaces(perp, 2));
}
// con only output one type.
// if (perp != null) {
// AngularCoordinateType acType = new AngularCoordinateType();
// acType.setAngle1(90);
// acType.setDistanceM(AutoTethysProvider.roundDecimalPlaces(perp,1));
// Angular angular = new Angular();
// angular.setCoordinate(acType);
// if (errors != null) {
// AngularCoordinateType angErr = new AngularCoordinateType();
// angErr.setDistanceM(errors.norm());
// angular.setCoordinateError(angErr);
// }
// loc.setAngular(angular);
// }
return loc;
}
private boolean makeCylinderLocalization(LocalizationType loc, AbstractLocalisation pamLoc) {
// TODO Auto-generated method stub
return false;
}
private boolean makeCartesianLocalization(LocalizationType loc, AbstractLocalisation pamLoc) {
LatLong latLong = pamLoc.getLatLong(0);
GroupLocalisation groupLoc = (GroupLocalisation) pamLoc;
GroupLocResult groupLocResult = groupLoc.getGroupLocaResult(0);
LocaliserModel tmaModel = groupLocResult.getModel();
boolean hasDepth = false;
return false;
}
private boolean makeWGS84Localization(LocalizationType loc, AbstractLocalisation pamLoc) {
LatLong latLong = pamLoc.getLatLong(0);
GroupLocalisation groupLoc = (GroupLocalisation) pamLoc;
GroupLocResult groupLocResult = groupLoc.getGroupLocaResult(0);
LocaliserModel tmaModel = groupLocResult.getModel();
@ -152,46 +238,7 @@ public class TMALocalizationCreator implements LocalizationCreator {
loc.setWGS84(wgs84);
// set the TMA information
Parameters params = loc.getParameters();
if (params == null) {
params = new Parameters();
loc.setParameters(params);
}
TargetMotionAnalysis tma = new TargetMotionAnalysis();
tma.setStart(TethysTimeFuncs.xmlGregCalFromMillis(dataUnit.getTimeMilliseconds()));
tma.setEnd(TethysTimeFuncs.xmlGregCalFromMillis(dataUnit.getEndTimeInMilliseconds()));
params.setTargetMotionAnalysis(tma);
Long timeAbeam = groupLocResult.getBeamTime();
if (timeAbeam != null) {
loc.setTimeStamp(TethysTimeFuncs.xmlGregCalFromMillis(timeAbeam));
}
// now also output a perpendicular distance.
Double perp = groupLocResult.getPerpendicularDistance();
if (perp != null) {
loc.setPerpendicularRangeM(AutoTethysProvider.roundDecimalPlaces(perp, 2));
}
// con only output one type.
// if (perp != null) {
// AngularCoordinateType acType = new AngularCoordinateType();
// acType.setAngle1(90);
// acType.setDistanceM(AutoTethysProvider.roundDecimalPlaces(perp,1));
// Angular angular = new Angular();
// angular.setCoordinate(acType);
// if (errors != null) {
// AngularCoordinateType angErr = new AngularCoordinateType();
// angErr.setDistanceM(errors.norm());
// angular.setCoordinateError(angErr);
// }
// loc.setAngular(angular);
// }
return loc;
return true;
}
@Override
@ -202,4 +249,5 @@ public class TMALocalizationCreator implements LocalizationCreator {
return ok;
}
}

View File

@ -0,0 +1,83 @@
package targetMotionOld.tethys;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Window;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.border.TitledBorder;
import PamView.dialog.PamGridBagContraints;
import targetMotionOld.TargetMotionLocaliser;
import targetMotionOld.TargetMotionOptions;
import tethys.localization.CoordinateName;
import tethys.swing.export.LocalizationOptionsPanel;
public class TMAOptionsPanel implements LocalizationOptionsPanel {
private TargetMotionLocaliser targetMotionLocaliser;
private JPanel mainPanel;
private JRadioButton wgs84, xyz, cylindrical;
public TMAOptionsPanel(Window parent, TargetMotionLocaliser targetMotionLocaliser) {
this.targetMotionLocaliser = targetMotionLocaliser;
this.mainPanel = new JPanel(new GridBagLayout());
mainPanel.setBorder(new TitledBorder("TMA options"));
GridBagConstraints c = new PamGridBagContraints();
wgs84 = new JRadioButton("WGS84");
xyz = new JRadioButton("Local cartesian frame");
cylindrical = new JRadioButton("Local cylindrical coordinate");
ButtonGroup bg = new ButtonGroup();
bg.add(wgs84);
bg.add(xyz);
bg.add(cylindrical);
mainPanel.add(wgs84, c);
c.gridy++;
mainPanel.add(xyz, c);
c.gridy++;
mainPanel.add(cylindrical, c);
c.gridy++;
}
@Override
public JComponent getDialogComponent() {
return mainPanel;
}
@Override
public void setParams() {
TargetMotionOptions tmaOptions = targetMotionLocaliser.getTargetMotionOptions();
wgs84.setSelected(tmaOptions.exportCoordinate == CoordinateName.WGS84);
xyz.setSelected(tmaOptions.exportCoordinate == CoordinateName.Cartesian);
cylindrical.setSelected(tmaOptions.exportCoordinate == CoordinateName.Cylindrical);
}
@Override
public boolean getParams() {
TargetMotionOptions tmaOptions = targetMotionLocaliser.getTargetMotionOptions();
if (wgs84.isSelected()) {
tmaOptions.exportCoordinate = CoordinateName.WGS84;
}
if (xyz.isSelected()) {
tmaOptions.exportCoordinate = CoordinateName.Cartesian;
}
if (cylindrical.isSelected()) {
tmaOptions.exportCoordinate = CoordinateName.Cylindrical;
}
return tmaOptions.exportCoordinate != null;
}
@Override
public boolean isBig() {
return false;
}
}

View File

@ -22,6 +22,30 @@ public enum CoordinateName {
* The most of the others
*
*/
public String getDescription() {
switch (this) {
case Cartesian:
return "Cartesian (x,y) or (x,y,z) coordinates in metres relative to the array reference point";
case Cylindrical:
return "An angle in the instrument plane, a perpendicular distance, and an elevation in metres";
case PerpendicularRange:
break;
case Polar:
return "One or two angles, relative to the reference frame, and a distance in metres";
case Range:
break;
case Spherical:
return "Two angles, relative to the reference frame";
case UTM:
break;
case WGS84:
return "WGS84 (Latitude and Longitude) and optional elevation (-depth)";
default:
break;
}
return null;
}
public LocalizationSubTypes getSubType() {
switch (this) {
@ -41,4 +65,9 @@ public enum CoordinateName {
}
return null;
}
@Override
public String toString() {
return super.toString(); // don't mess with this, since some ops need the correct name.
}
}

View File

@ -64,8 +64,11 @@ import tethys.species.SpeciesMapItem;
/**
* Class to build a single localisation document during export.
* Works hand in had with the global LocalisationHandler and also
* with other functions it's going to find in the datablock and whatever localisation
* Works hand in had with the global LocalisationHandler and also with
* the LocalizationCreator that should be part of each localisation algorithm.
* <p>To understand the difference, this contains most of the required functionality
* but by having the interface on specific algorithms, it's easy for them to override
* that on a localiser specific basis.
* algorithm was used.
* @author dg50
*
@ -244,8 +247,8 @@ public class LocalizationBuilder {
if (ll != null) {
GpsData pos = ll.getGpsData();
if (pos != null) {
referenceFrame.setLatitude(TethysLatLong.formatLatitude(pos.getLatitude()));
referenceFrame.setLongitude(TethysLatLong.formatLongitude(pos.getLongitude()));
referenceFrame.setLatitude(TethysLatLong.formatLatitude(pos.getLatitude(),TethysLatLong.mmDecimalPlaces));
referenceFrame.setLongitude(TethysLatLong.formatLongitude(pos.getLongitude(),TethysLatLong.mmDecimalPlaces));
referenceFrame.setDatum(String.format("Altitude %3.2fm", pos.getHeight()));
}
}
@ -457,7 +460,7 @@ public class LocalizationBuilder {
deg = PamUtils.constrainedAngle(deg);
deg = AutoTethysProvider.roundDecimalPlaces(deg, 2);
return deg;
}
}
/**
* Convert a vertical angle from radians to degrees and round.

View File

@ -1,21 +1,53 @@
package tethys.localization;
import java.awt.Window;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import nilus.LocalizationType;
import tethys.swing.export.LocalizationOptionsPanel;
/**
* Creator thingy that Localisation algorithms can use to overwrite any standard
* behaviour in LocalizatinBuilder.
* behaviour in LocalizatinBuilder. This interface should be added to localization
* algorithms to provide Tethys compatibility.
* @author dg50
*
*/
public interface LocalizationCreator {
/**
* Sort out localization coordinates and set them in the current document in the
* Localization builder. e.g. the TMA module should be able to work out at this point
* if it's working in 2 or 3 dimensions and whether it's outputting in cartesian or
* WGS84 coordinate systems. Whatever it chooses to do needs to be put into the
* current localization document / Effort / CoordinateReferenceSystem, which must
* then match whatever is output to the actual Localizations.
* @param localizationBuilder holder of current document and other information about the export.
* @param dataBlock Current datablock (though the localiser will probably know this)
* @return true if everything makes sense. false if it's not been possible to sort the coordinated, in which case
* export probably shouldn't proceed.
*/
public boolean sortLocalisationCoordinates(LocalizationBuilder localizationBuilder, PamDataBlock dataBlock) ;
/**
* Create a localization record for export. The coordinate used in the localization must match what what
* set in the call to sortLocalisationCoordinates
* @param localizationBuilder holder of current document and other information about the export.
* @param dataUnit data unit containing the localization to export
* @return Localization record. Can be null if the data unit didn't have a localization, in which case nothing is written.
*/
public LocalizationType createLocalization(LocalizationBuilder localizationBuilder, PamDataUnit dataUnit);
/**
* Called after all localizations have been exported to check the document. Particularly regarding
* coordinate types. In principle, a lot of the functions of sortLocalisationCoordinates could be sorted
* out here if it's only possible to work out the coordinate system after going through all the data.
* @param localizationBuilder holder of current document and other information about the export.
* @return true if everything OK and the document can be written to Tethys.
*/
public boolean checkDocument(LocalizationBuilder localizationBuilder);
}

View File

@ -11,6 +11,16 @@ import tethys.detection.StreamDetectionsSummary;
import tethys.niluswraps.NilusDataWrapper;
import tethys.niluswraps.PDeployment;
/**
* Handler for localizations. This was originally going to mirror the DetectionsHandler, but became
* a bit redundant when it became clear that the localization export would have to happen in parralel
* with the detections export, so all happens in DetectionsHandler. The DetectionsHandler will use
* a LocalizationBuilder class to create each document, but will call through the an interface
* in each Localiser algorithm (LocalizationCreator) to do the real work or sorting out coordinate
* frames and creating the actual detections.
* @author dg50
*
*/
public class LocalizationHandler extends CollectionHandler {
private int uniqueLocalisationsId = 1;

View File

@ -587,6 +587,11 @@ abstract public class AutoTethysProvider implements TethysDataProvider {
return (granularityType == null || granularityType == GranularityEnumType.CALL);
}
@Override
public LocalisationAlgorithm getLocalisationAlgorithm() {
return pamDataBlock.getLocalisationAlgorithm();
}
@Override
public TethysLocalisationInfo getLocalisationInfo() {
LocalisationInfo locCont = pamDataBlock.getLocalisationContents();

View File

@ -2,6 +2,7 @@ package tethys.pamdata;
import java.util.List;
import Localiser.LocalisationAlgorithm;
import PamDetection.LocalisationInfo;
import PamguardMVC.PamDataUnit;
import nilus.AlgorithmType;
@ -140,6 +141,13 @@ public interface TethysDataProvider {
*/
public boolean wantExportDialogCard(ExportWizardCard wizPanel);
/**
* Get the localisation algorithm (if there is one). This is generally
* found automatically from the datablock, but it may be necessary to override.
* @return Localisation Algorithm, or null.
*/
public LocalisationAlgorithm getLocalisationAlgorithm();
/**
* Get localisation info for the datablock. Can be null, but probably never is. More likely to have a zero of available types;
* @return

View File

@ -0,0 +1,19 @@
package tethys.swing.export;
import tethys.localization.CoordinateName;
/**
* Interface for algorithms that can provide a coordinate choice. Works with
* Coordinate choice panel to automatically generate choise.
* @author dg50
*
*/
public interface CoordinateChoice {
public CoordinateName[] getPossibleCoordinates();
public CoordinateName getCoordinateName();
public void setCoordinateName(CoordinateName coordinateName);
}

View File

@ -0,0 +1,75 @@
package tethys.swing.export;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.border.TitledBorder;
import PamView.dialog.PamGridBagContraints;
import PamView.panel.WestAlignedPanel;
import tethys.localization.CoordinateName;
public class CoordinateChoisePanel implements LocalizationOptionsPanel {
private CoordinateChoice coordinateChoise;
private JPanel mainPanel;
private JRadioButton[] choiceButtons;
private CoordinateName[] possibles;
public CoordinateChoisePanel(CoordinateChoice coordinateChoice) {
this.coordinateChoise = coordinateChoice;
possibles = coordinateChoice.getPossibleCoordinates();
choiceButtons = new JRadioButton[possibles.length];
ButtonGroup bg = new ButtonGroup();
mainPanel = new WestAlignedPanel(new GridBagLayout());
mainPanel.setBorder(new TitledBorder("Coordinate choice"));
GridBagConstraints c = new PamGridBagContraints();
for (int i = 0; i < possibles.length; i++) {
choiceButtons[i] = new JRadioButton(possibles[i].name());
bg.add(choiceButtons[i]);
String tip = possibles[i].getDescription();
if (tip != null) {
choiceButtons[i].setToolTipText(tip);
}
mainPanel.add(choiceButtons[i], c);
c.gridy++;
}
}
@Override
public JComponent getDialogComponent() {
return mainPanel;
}
@Override
public void setParams() {
CoordinateName current = coordinateChoise.getCoordinateName();
for (int i = 0; i < possibles.length; i++) {
choiceButtons[i].setSelected(possibles[i] == current);
}
}
@Override
public boolean getParams() {
for (int i = 0; i < possibles.length; i++) {
if (choiceButtons[i].isSelected()) {
coordinateChoise.setCoordinateName(possibles[i]);
return true;
}
}
return false;
}
@Override
public boolean isBig() {
return possibles.length > 1;
}
}

View File

@ -18,6 +18,10 @@ import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import Localiser.LocalisationAlgorithm;
import Localiser.LocalisationAlgorithmInfo;
import PamView.component.PamSettingsIconButton;
import PamView.dialog.GenericSwingDialog;
import PamView.dialog.PamGridBagContraints;
import PamView.panel.WestAlignedPanel;
import PamguardMVC.PamDataBlock;
@ -54,6 +58,12 @@ public class GranularityCard extends ExportWizardCard {
private GranularityEnumType[] allowedGranularities;
private TethysDataProvider tethysDataProvider;
private LocalisationAlgorithm localisationAlgorithm;
private LocalizationOptionsPanel localisationPanel;
private PamSettingsIconButton locSetingsButton;
public GranularityCard(DetectionsExportWizard detectionsExportWizard, TethysControl tethysControl, PamDataBlock dataBlock) {
super(tethysControl, detectionsExportWizard, "Granularity", dataBlock);
@ -61,27 +71,40 @@ public class GranularityCard extends ExportWizardCard {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
tethysDataProvider = dataBlock.getTethysDataProvider(tethysControl);
localisationAlgorithm = tethysDataProvider.getLocalisationAlgorithm();
if (localisationAlgorithm != null) {
LocalisationAlgorithmInfo locinfo = localisationAlgorithm.getAlgorithmInfo();
if (locinfo != null) {
localisationPanel = locinfo.getLocalizationOptionsPanel(detectionsExportWizard, null);
}
}
GranularityChange gc = new GranularityChange();
exportDetections = new JCheckBox("Export Detections");
exportLocalisations = new JCheckBox("Export Localisations");
locSetingsButton = new PamSettingsIconButton("Options");
exportDetections.addActionListener(gc);
exportLocalisations.addActionListener(gc);
JPanel whatPanel = new JPanel(new GridBagLayout());
GridBagConstraints cw = new PamGridBagContraints();
cw.gridwidth = 2;
cw.gridwidth = 1;
whatPanel.add(exportDetections, cw);
cw.gridy++;
whatPanel.add(exportLocalisations, cw);
cw.gridx += cw.gridwidth;
whatPanel.add(locSetingsButton, cw);
cw.gridwidth = 1;
cw.gridx = 0;
cw.gridy++;
whatPanel.add(new JLabel("Loclisation types: ", JLabel.RIGHT), cw);
whatPanel.add(new JLabel("Localisation types: ", JLabel.RIGHT), cw);
cw.gridx++;
cw.gridwidth = 2;
whatPanel.add(localisationTypes = new JLabel("none"), cw);
JPanel walPanel = new WestAlignedPanel(whatPanel);
walPanel.setBorder(new TitledBorder("What to export"));
this.add(walPanel);
locSetingsButton.setToolTipText("Localisation export options");
localisationTypes.setToolTipText("Not all listed localisation types may be present in actual data");
// granularity
@ -167,6 +190,13 @@ public class GranularityCard extends ExportWizardCard {
dataPanel.add(BorderLayout.CENTER, sp);
this.add(dataPanel);
}
locSetingsButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showLocalisationOptions();
}
});
}
@ -239,6 +269,13 @@ public class GranularityCard extends ExportWizardCard {
return detectionsExportWizard.showWarning("You must select Detections or Localisations for export");
}
if (localisationPanel != null) {
boolean lpOK = localisationPanel.getParams();
if (!lpOK) {
return false;
}
}
return streamExportParams.granularity != null;
}
@ -275,18 +312,28 @@ public class GranularityCard extends ExportWizardCard {
exportDetections.setSelected(streamExportParams.exportDetections);
exportLocalisations.setSelected(streamExportParams.exportLocalisations);
if (localisationPanel != null) {
localisationPanel.setParams();
}
newDataSelection();
enableControls();
}
private void enableControls() {
exportDetections.setEnabled(tethysDataProvider.hasDetections());
if (tethysDataProvider.hasDetections() == false) {
exportDetections.setSelected(false);
exportLocalisations.setSelected(true);
granularities[callIndex].setSelected(true);
}
String locStr = getLocInfString();
boolean dets = exportDetections.isSelected();
boolean locs = exportLocalisations.isSelected();
granularities[binnedIndex].setEnabled(!locs);
granularities[encounterIndex].setEnabled(!locs);
GranularityEnumType granularity = getCurrentGranularity();
boolean canLoc = tethysDataProvider.canExportLocalisations(granularity);
boolean canLoc = localisationAlgorithm != null;//tethysDataProvider.canExportLocalisations(granularity);
exportLocalisations.setEnabled(canLoc);
if (canLoc == false) {
exportLocalisations.setSelected(false);
@ -296,6 +343,7 @@ public class GranularityCard extends ExportWizardCard {
if (granularities.length == 1) {
granularities[0].setSelected(true);
}
locSetingsButton.setEnabled(exportLocalisations.isSelected() && localisationPanel != null);
binLength.setEnabled(granularities[binnedIndex].isSelected());
minBinnedCalls.setEnabled(granularities[binnedIndex].isSelected());
@ -314,4 +362,11 @@ public class GranularityCard extends ExportWizardCard {
return locInf.getLoclisationTypes();
}
private void showLocalisationOptions() {
if (localisationPanel == null) {
return; // should never happen since button disabled if this is null, but ...
}
GenericSwingDialog.showDialog(detectionsExportWizard, "Localisation options", localisationPanel);
}
}

View File

@ -0,0 +1,15 @@
package tethys.swing.export;
import PamView.dialog.PamDialogPanel;
public interface LocalizationOptionsPanel extends PamDialogPanel {
/**
* Is the panel big enough that it needs opening in a separate dialog,
* or is it small enough to squish into the export panel ? <p>
* Caller may chose to ignore this information.
* @return true if it should open in it's own window.
*/
public boolean isBig();
}