Package rocca

Class RoccaParameters

java.lang.Object
rocca.RoccaParameters
All Implemented Interfaces:
Serializable, Cloneable, ManagedParameters

public class RoccaParameters extends Object implements Serializable, Cloneable, ManagedParameters
Parameters for Rocca
modified contour calculations to better match original Matlab routine

serialVersionUID = 2
2012/7/23
added whistle and moan as a potential data source for classifier

serialVersionUID = 3
2012/8/12
corrected problem with not resetting inflection and sweep counts when reclassifying, resulting in doubling and tripling of the parameters

serialVersionUID = 4
2012/8/16
corrected problem with freqmin=-1 when contour points dragged and end point reselected.

serialVersionUID = 5
2012/10/12
added 'pick points' option to trace out contours

serialVersionUID = 6
2012/11/11
fixed problem with single step being counted multiple times

serialVersionUID = 7
2013/9/29
added 2nd stage classifier

serialVersionUID = 8
2013/12/13
added error checking in RoccaProcess, to catch if a PamRawDataBlock is empty
added error checking in RoccaContourDataBlock to catch if the filename for the source wav cannot be found

serialVersionUID = 9
2014/01/18
added more error checking in RoccaProcess to catch if firstIndx or lastIndx cannot be determined from the data sent by the WMD

serialVersionUID = 10
2014/02/04
in case numInflections < = 1, Rocca now writes a "0" to the following parameters instead of "999":
INFLMAXDELTA
INFLMINDELTA
INFLMAXMINDELTA
INFLMEANDELTA
INFLSTDDEVDELTA
INFLMEDIANDELTA

serialVersionUID = 11
2014/04/09
added decimal places to the date/time output in column B of RoccaContourStats
added End Date/Time column to RoccaContourStats

serialVersionUID = 12
2014/05/07
integrated with click detector
rev 12c 2014/07/26 released to Tina for beta testing

serialVersionUID = 13
2014/09/09
added notes tab to Parameters dialog and added 4 string variables to params

serialVersionUID = 14
2014/10/13
*allow multiple sources
*changed click duration calculation in RoccaContourDataBlock.calculateClickStats(). Instead of calling clickDetection.clickLength, we now call SweepClassifier.getClickLength
*released as Pamguard version 1_12_50

serialVersionUID = 15
2014/11/12
* add time calcs to school stats file
* released as Pamguard version 1.12.54 (? not positive about this)

serialVersionUID = 16
2014/12/28
* remove 'GMT' from start and end times in RoccaContourStats.csv, and just use
* it in the header row. Allows easier manipulation of dates in Excel
* released as Pamguard version 1.12.54b

serialVersionUID = 17
2015/01/14
* added geographic location and channels to notes tab, as well as sample rate
* RoccaContourStats.csv file
* released as Pamguard version 1.13.02b

serialVersionUID = 18
2015/04/20
* change the RoccaLoggingDataBlock unit lifetime from infinite to 10 seconds, and don't override the clearAll method anymore. There were problems with the memory being overloaded and crashing pamguard when the Whistle and Moan Detector was run over multiple hours.
* released as Pamguard version 1.13.03b

serialVersionUID = 19
2015/05/17
* added median and variance classes to PamMaths package
* added mean, median and variance calcs to ZeroCrossingStats class
* added mean, median and variance of time between zero crossings to the list of click stats calculated by RoccaContourDataBlock. These stats were also added to the RoccaContourStats enum and RoccaStatsLogger class. Note that the Click Detector params had never been added to RoccaStatsLogger, so everything was included this time.
* released as Pamguard version 1.13.03c

serialVersionUID = 20
2015/05/20
* added Encounter ID and Known Species to sidebar
* added test for change in Sources tab of Rocca Parameters Dialog. If no change has occurred, the Observer list will not be touched. This was causing Pamguard to crash if changes were made to the Parameters Dialog (the notes or output filenames) while Pamguard was running and handling multiple detections at the same time
* released as Pamguard version 1.13.03d

serialVersionUID = 21
2015/05/31
* changed Viewer Mode Rocca Event Analysis menu item. Instead of displaying a submenu listing all of the available events, load a dialog with a scrolling text box
* released as Pamguard version 1.13.03e

serialVersionUID = 22
2015/06/13
* added ancillary variables to encounter stats for both whistles and clicks. Up to now, clicks had not been included in encounter calculations. Because we want to calc ancillary variables for clicks as well as whistles, clicks are now sent to the sidebar but are NOT run through a classifier first - they default to 'ambig' species. To do this, we now pass the duration as well as the start time to the incSpeciesCount methods in RoccaSidePanel. Note that ancillary variable calculations can be enabled/disabled for whistles and clicks separately in the parameters dialog.
Ancillary variables include:
whistle density (sum of individual durations / encounter length)
whistle overlap (total number of seconds that two whistles overlap)
* Encounter duration calculation was also changed to go from the start of the first whistle OR click to the end of the last whistle or click
* fixed bug that didn't read the encounter stats file in correctly (did not take into account timeParams variables)
* fixed bug that could go past the end of the frequency array when calculating max freq bin in RoccaContour.getMaxFreqIndexFromFFTData
* found missing graphics for help files
* updated help files, including Click Detector help
* released for testing as Pamguard version 1.13.03f on 18 July 2015

serialVersionUID = 22
2015/08/31
* fixed bug in encounter stats - was incorrectly calculating average time between whistles/clicks
* released as Pamguard version 1.13.05b

serialVersionUID = 22
2015/09/09
* fixed memory leak issue in ViewerMode, whereby logging data units are created but never removed. Changes made
* released as Pamguard version 1.13.05c

serialVersionUID = 22
2015/09/13
* changed SweepClassifierWorker method createLengthData - converted lengthData to local variable tempLengthData to prevent NullPointerException due to threading issues
* released as Pamguard version 1.13.05d

serialVersionUID = 22
2015/09/15
* changed whistle/click overlap param to average overlap, by dividing by encounter length
* released as Pamguard version 1.13.05d

serialVersionUID = 23
2015/10/10
* Requested changes from ONR Debrief 2015/10/06
* remove white spaces and parenthesis characters from RoccaContourStats header row
* report 'N/A' for min time between detections, if there is only 1 detection
* released as Pamguard version 1.14.00b

serialVersionUID = 23
2016/01/04
* last requested change from ONR Debrief 2015/10/06
* add ability to load standard notes and use in RoccaParameters dialog window
* fixed Rocca multi-threading problem which caused Click Detector to send same click multiple times
* released as Pamguard version 1.14.00c

serialVersionUID = 24
2016/08/10
* added selection of click and event classifiers to parameters dialog
* added GPS as a potential source (to be used in conjunction with event classifier)
* removed references in parameters dialog to the original 2-stage classifier, which required 2 separate classifier files to function
* released as Pamguard version 1.15.04d

serialVersionUID = 25
2017/03/28
* added pruning for auto whistle/click detector classifiers. Note that the pruning parameters are specific to the classifiers developed for the ONR/LMR project N00014-14-1-0413 and documented in the report "Development of automated whistle and click classifiers for odontocete species in the western Atlantic Ocean, Temperate Pacific and the waters surrounding the Hawaiian Islands" J.N. Oswald and T.M. Yack, 2016. The parameters are hard-coded into the RoccaProcess.newData method and are applied when the classifier model file selected by the user matches a specific name.

2017/04/10
* modified event calcs to match the final params that were actually used for TempPac/Hawaii/Atlantic classifiers. StartHr, ProportionWhists and ProportionClicks were added. No params were removed to maintain backwards-compatibility (even though some are not used in the classifier)

2017/10/14
* subscribe to AcquisitionProcess.daqStatusDataBlock and monitor for changes in file name. When a change * occurs, update the event name automatically

2019/03/04
* copied over the click classification code from RoccaProcess.newData to RoccaControl.analyzeOfflineClicks. Didn't realize that in Viewer mode, clicks were not being classified and were simply set to Ambig. When RocccaProcess was upgraded with actual click classification, I forgot to change RoccaControl.

Author:
Michael Oswald
See Also:
  • Field Details Link icon

    • serialVersionUID Link icon

      public static final long serialVersionUID
      for serialization
      See Also:
    • NO_CONTOUR_HERE Link icon

      public static final int NO_CONTOUR_HERE
      constant used to define areas of spectrogram that do not contain whistle
      See Also:
  • Constructor Details Link icon

    • RoccaParameters Link icon

      public RoccaParameters()
  • Method Details Link icon

    • clone Link icon

      public RoccaParameters clone()
    • getSerialVersionUID Link icon

      public static long getSerialVersionUID()
    • getChannelMap Link icon

      public int getChannelMap()
    • setChannelMap Link icon

      public void setChannelMap(int channelMap)
    • getEnergyBinSize Link icon

      public int getEnergyBinSize()
    • getFftDataBlock Link icon

      public int getFftDataBlock()
    • getNoiseSensitivity Link icon

      public double getNoiseSensitivity()
    • setNoiseSensitivity Link icon

      public void setNoiseSensitivity(double noiseSensitivity)
    • getRoccaClassifierModelFilename Link icon

      public File getRoccaClassifierModelFilename()
      return the name of the whistle classifier
      Returns:
    • getRoccaClickClassifierModelFilename Link icon

      public File getRoccaClickClassifierModelFilename()
      return the name of the click classifier serialVersionUID=24 2016/08/10
      Returns:
    • getRoccaEventClassifierModelFilename Link icon

      public File getRoccaEventClassifierModelFilename()
      return the name of the event classifier serialVersionUID=24 2016/08/10
      Returns:
    • setRoccaClassifierModelFilename Link icon

      public void setRoccaClassifierModelFilename(File roccaClassifierModelFilename)
      Set the whistle classifier file
      Parameters:
      roccaClassifierModelFilename - the roccaClassifierModelFilename to set
    • setRoccaClickClassifierModelFilename Link icon

      public void setRoccaClickClassifierModelFilename(File roccaClickClassifierModelFilename)
      Set the click classifier file serialVersionUID=24 2016/08/10
      Parameters:
      roccaClickClassifierModelFilename - the roccaClassifierModelFilename to set
    • setRoccaEventClassifierModelFilename Link icon

      public void setRoccaEventClassifierModelFilename(File roccaEventClassifierModelFilename)
      Set the event classifier file serialVersionUID=24 2016/08/10
      Parameters:
      roccaEventClassifierModelFilename - the roccaEventClassifierModelFilename to set
    • getRoccaContourStatsOutputFilename Link icon

      public File getRoccaContourStatsOutputFilename()
    • getStage1Link Link icon

      public int getStage1Link()
      Returns:
      the stage1Link
    • setStage1Link Link icon

      public void setStage1Link(int stage1Link)
      Parameters:
      stage1Link - the stage1Link to set
    • getRoccaOutputDirectory Link icon

      public File getRoccaOutputDirectory()
    • getClassificationThreshold Link icon

      public int getClassificationThreshold()
    • setClassificationThreshold Link icon

      public void setClassificationThreshold(int classificationThreshold)
    • getSightingThreshold Link icon

      public int getSightingThreshold()
    • setSightingThreshold Link icon

      public void setSightingThreshold(int sightingThreshold)
    • getRoccaSightingStatsOutputFilename Link icon

      public File getRoccaSightingStatsOutputFilename()
    • getFilenameTemplate Link icon

      public String getFilenameTemplate()
    • setFilenameTemplate Link icon

      public void setFilenameTemplate(String filenameTemplate)
    • getWmDataSource Link icon

      public String getWmDataSource()
    • setWmDataSource Link icon

      public void setWmDataSource(String wmDataSource)
    • getClickDataSource Link icon

      public String getClickDataSource()
      Returns:
      the clickDataSource
    • setClickDataSource Link icon

      public void setClickDataSource(String clickDataSource)
      Parameters:
      clickDataSource - the clickDataSource to set
    • getClickNoiseDataSource Link icon

      public String getClickNoiseDataSource()
      Returns:
      the clickNoiseDataSource
    • setClickNoiseDataSource Link icon

      public void setClickNoiseDataSource(String clickNoiseDataSource)
      Parameters:
      clickNoiseDataSource - the clickNoiseDataSource to set
    • weAreUsingFFT Link icon

      public boolean weAreUsingFFT()
    • setUseFFT Link icon

      public void setUseFFT(boolean useFFT)
    • weAreUsingClick Link icon

      public boolean weAreUsingClick()
    • setUseClick Link icon

      public void setUseClick(boolean useClick)
    • weAreUsingWMD Link icon

      public boolean weAreUsingWMD()
    • setUseWMD Link icon

      public void setUseWMD(boolean useWMD)
    • getClickTypeList Link icon

      public int[] getClickTypeList()
      Returns:
      the clickTypeList
    • setClickTypeList Link icon

      public void setClickTypeList(int[] clickTypeList)
      Parameters:
      clickTypeList - the clickTypeList to set
    • getNotesEncounterID Link icon

      public String getNotesEncounterID()
      Returns:
      the notesEncounterID
    • setNotesEncounterID Link icon

      public void setNotesEncounterID(String notesEncounterID)
      Parameters:
      notesEncounterID - the notesEncounterID to set
    • getNotesCruiseID Link icon

      public String getNotesCruiseID()
      Returns:
      the notesCruiseID
    • setNotesCruiseID Link icon

      public void setNotesCruiseID(String notesCruiseID)
      Parameters:
      notesCruiseID - the notesCruiseID to set
    • getNotesDataProvider Link icon

      public String getNotesDataProvider()
      Returns:
      the notesDataProvider
    • setNotesDataProvider Link icon

      public void setNotesDataProvider(String notesDataProvider)
      Parameters:
      notesDataProvider - the notesDataProvider to set
    • getNotesKnownSpecies Link icon

      public String getNotesKnownSpecies()
      Returns:
      the notesKnownSpecies
    • setNotesKnownSpecies Link icon

      public void setNotesKnownSpecies(String notesKnownSpecies)
      Parameters:
      notesKnownSpecies - the notesKnownSpecies to set
    • getNotesGeoLoc Link icon

      public String getNotesGeoLoc()
      Returns:
      the notesGeoLoc
    • setNotesGeoLoc Link icon

      public void setNotesGeoLoc(String notesGeoLoc)
      Parameters:
      notesGeoLoc - the notesGeoLoc to set
    • getNotesChan Link icon

      public String getNotesChan()
      Returns:
      the notesChan
    • setNotesChan Link icon

      public void setNotesChan(String notesChan)
      Parameters:
      notesChan - the notesChan to set
    • areWeRunningAncCalcsOnClicks Link icon

      public boolean areWeRunningAncCalcsOnClicks()
      Returns:
      whether or not we're running Ancillary Calcs
    • setClickAncCalcs Link icon

      public void setClickAncCalcs(boolean runAncillaryCalcs)
      Parameters:
      runAncillaryCalcs - set whether or not to run Ancillary Calcs
    • areWeRunningAncCalcsOnWhistles Link icon

      public boolean areWeRunningAncCalcsOnWhistles()
      Returns:
      whether or not we're running Ancillary Calcs
    • setWhistleAncCalcs Link icon

      public void setWhistleAncCalcs(boolean runAncillaryCalcs)
      Parameters:
      runAncillaryCalcs - set whether or not to run Ancillary Calcs
    • isClassifyWhistles Link icon

      public boolean isClassifyWhistles()
    • setClassifyWhistles Link icon

      public void setClassifyWhistles(boolean classifyWhistles)
    • isClassifyClicks Link icon

      public boolean isClassifyClicks()
    • setClassifyClicks Link icon

      public void setClassifyClicks(boolean classifyClicks)
    • isClassifyEvents Link icon

      public boolean isClassifyEvents()
    • setClassifyEvents Link icon

      public void setClassifyEvents(boolean classifyEvents)
    • weAreUsingGPS Link icon

      public boolean weAreUsingGPS()
    • setUseGPS Link icon

      public void setUseGPS(boolean useGPS)
    • getGpsSource Link icon

      public String getGpsSource()
    • setGpsSource Link icon

      public void setGpsSource(String gpsSource)
    • isTrimWav Link icon

      public boolean isTrimWav()
    • setTrimWav Link icon

      public void setTrimWav(boolean trimWav)
    • getParameterSet Link icon

      public PamParameterSet getParameterSet()
      Description copied from interface: ManagedParameters
      Get a set of data that describes all of the parameters in a class
      Specified by:
      getParameterSet in interface ManagedParameters
      Returns:
      description of the parameters in a class.