Giter Site home page Giter Site logo

marinebioacousticsrc / triton Goto Github PK

View Code? Open in Web Editor NEW
36.0 27.0 21.0 44.22 MB

:whale: Scripps Whale Acoustics Lab :earth_americas: Scripps Acoustic Ecology Lab - Triton with remoras in development

License: Other

MATLAB 70.37% C++ 3.57% M 0.02% HTML 22.18% XQuery 0.13% HCL 0.01% Python 0.06% C 3.34% Makefile 0.12% Objective-C 0.01% JavaScript 0.01% CSS 0.20%
mbarc triton whale scripps detection classification machine-learning marine-species acoustics sound

triton's Introduction

Triton

The Triton Software Package is aimed at evaluating long duration, continuous and scheduled duty-cycle time series.

The Triton base package was developed by Dr. Sean M. Wiggins at Scripps Institution of Oceanography, UC San Diego.

Remoras are developed by contributors at Scripps Institution of Oceanography and San Diego State University.

For instructions, please check out our wiki.

If you do not have a Matlab installation, please check out out our standalone version.

Non-GitHub Users: You can obtain all of the source code by clicking the green "code" button and selecting "Download ZIP". However we encourage you to clone the repository so that you can easily recieve updates and bug fixes.

Current and past funders include:

  • NOAA Protected Species Toolbox Initiative
  • NAVFAC Living Marine Resources Program

Batch/MultiDir LTSA Remora development TO DOs

  • add gui/step to check output filenames and change if wanted
  • test Remora folder alone with flac version

triton's People

Contributors

asolsonaberga avatar cschoenbeck avatar jahildebrand avatar kfrasier avatar maceyrafter avatar marie-r avatar mziegenhorn avatar rcohen85 avatar sbaumannpickering avatar sfregosi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

triton's Issues

empty CSV output file when computing metrics on LTSA

Hi all,

I'm opening a new issue concerning my second problem. After managing to create a LTSA from my data (with the Soundscape remora), I tried to compute some metrics on it.
I tried several parameters combinations, but the output CSV file is either empty or filled with NaN, with only the column headers correct.

I'm joining the log file in which the output of two different trials I made.
I guess that I'm doing something wrong in setting the "Data analysis parameters", but I cannot figure out where.

My LTSA computation parameters were the following:
-averaging time: 10 sec
-frequency bin size: 200Hz

I therefore did put the following "Data analysis parameters":
-bandpass edges: 20-10000 Hz (my wav data are sampled at 22kHz)
-averaging:
-bin size time (sec): 10
-PSD bin size frequency (Hz): 200
-Min. Seconds / average (%) : 1 or 50

Any suggestion would be greatly appreciated!
Thanks,
logfile.txt

ShipDetector - Karli's version of the thresholds

Here's my version of the thresholds for distinguishing between ships and non-ships (ambient), which are mostly delphinids at the Hawaii locations. Starting line 342 in sh_passage_detector.m. I haven't tried them for any other sites, but thought someone might find them helpful!

%Karli's Hawaii version
for m = 1:size(noise,1)
    RLs(m,:) = [mean(RLsB1(noise(m,1):noise(m,2))), mean(RLsB2(noise(m,1):noise(m,2))),...
        mean(RLsB3(noise(m,1):noise(m,2)))]; 
    %if RLs(m,1)>80 & (RLs(m,2)<60 | RLs(m,3)<60)
    if RLs(m,3) > RLs(m,2)
        labels{m} = 'ship1';
    elseif RLs(m,1)>55
            labels{m} = 'ship2';
    elseif RLs(m,1)-RLs(m,3) < 10
            labels{m} = 'ambient';
    elseif (RLs(m,1) - mean(RLs(m,2:3))) > 10
            labels{m} = 'ship';
    else
            labels{m} = 'ambient';
    end
end

% %Alba's Version
% for m = 1:size(noise,1)
% RLs= [mean(RLsB1(noise(m,1):noise(m,2))), mean(RLsB2(noise(m,1):noise(m,2))),...
% mean(RLsB3(noise(m,1):noise(m,2)))];
%
% if RLs (1) > RLB1thr %&& RLs(2) > RLB2thr && RLs(3) > RLB3thr % %RLs(m,1)>80 & (RLs(m,2)<60 | RLs(m,3)<60)
% labels{m} = 'ship';
% else
% if (RLs(2)< 0 || RLs(3)<0)
% noise(m,:) = [0 0];
% elseif (RLs(1) - mean(RLs(2:3))) > 15
% labels{m} = 'ship';
% else
% labels{m} = 'ambient';
% end
% end
% end

Missing sm_init files?

Hi all,

I'm trying to plot soundscape metrics within the soundscape metrics remora and am running into an issue with the file sm_pulldown. Multiple referenced files beginning with with the syntax "sm_init" seem to be missing from the overall triton zipfile. The absence of these files are preventing sm_pulldown from running and plotting soundscape metrics. I can't find any reference to these files on the github.

Thanks for any help you can provide,

Nicole

Error computing Soundscape Metrics

Hello to all!

My data was collect with SoundTraps as wav files of 96kHz sampling rate and 10-minutes length.
I'm testing computing soundscape metrics in triton for the first time and I don't have much experience with matlab, so I started generating soundscape LTSAs with default settings (1s, 1Hz and 7 days resolution). LTSAs were generated correctly, but when I try to compute soundscape metrics (300s bin size for time, 1hz bin size for frequency, 50% min. seconds/average and single value calibration), I get the following error message:

Unrecognized function or variable 'utFindFiles'.

Error in sm_cmpt_metrics (line 15)
    utFindFiles('*.ltsa', REMORA.sm.cmpt.indir, 0);

Error in sm_cmpt_control (line 136)
    sm_cmpt_metrics;
 
Error while evaluating DestroyedObject Callback.

What can be happening, is it not recognizing the soundscape LTSA files?

Any help is much appreciated!

Ship Detector - Always Removing Disk-Write Noise, with simple fix

Hi Triton team,

The Ship Detector has a check-box button to select whether one wants to exclude Disk Write noise, which is very helpful for HARP data, but not much else. It looks like the way it is coded (Lines 28-38 in sh_passage_detector.m) it always functions to remove the "Disk-Write" noise, even if the box is unchecked. A simple fix would be to change line 28 to read: if REMORA.sh.settings.diskWrite == 1, which is the value of REMORA.sh.settings.diskWrite if the checkbox is clicked. (If the check box is unchecked the value of REMORA.sh.settings.diskWrite is "Exclude Disk-Write Noise", which still exists, so the current code considers this to also mean that one should remove the Disk Writes.)

-Karli

Error initializing triton - Error using xml_read Your MATLAB version is too old. You need version 7.1 or newer.

Hi triton team!
I recently updated to MATLAB 2023b and am receiving an error when attempting to open triton:
Error using xml_read
Your MATLAB version is too old. You need version 7.1 or newer.

This refers to xml_read.m lines 93-99 where the MATLAB version is checked. Perhaps things have changed in how MATLAB reports versions because the version that is returned by version = str2double(regexp(v.Version, '\d.\d','match','once'));
is 3.2, but the version is actually listed as 23.2.

When I try the same process on my version 2019a it returns version 9.7. I'm not sure if this is a MATLAB change, or just a bug in the 2023 versions, but it seems like a "simple" fix would be to change the regex search to include two digits (e.g. "23") not just one ("e.g. ignoring the "2" and jumping right to the "3").

I suggest changing line 95 to something like:
version = str2double(regexp(v.Version, '\d+','match','once')); to get the first digit before the decimal place (if we only care about it being higher than 7, and it's unlikely that someone with 7 and not 7.1 is going to use the software), or:
version = str2double(regexp(v.Version, '\d+.\d','match','once'));
If we want to capture the full number and the decimal.

Thanks!
Karli

Error in pulling noise sample when no clicks

In the spice-snr-threshold branch, in dt_parameters line 39 when there are no valid detections passed in (variable "clicks" is empty) then there are no indices to indicate a chunk of samples prior to any detections which could be saved as a noise sample.
image

We could probably just skip all of dt_parameters if no valid detections were found. Here's the fix I put in:
image

Ship Detector - recommend changing "Duty Cycle Data" to "Remove Extreme Low Outliers"

Hi Alba & co.,

The code included in the Ship Detector that is supposed to deal with Duty Cycled Data does not seem to do that (sh_passage_detector.m Lines 103-112). It does remove/NaN any extreme low outlier data points (which might happen if there is a data dropout), but based on what I've seen most duty cycled data does not have gaps in the actual data, just jumps in the time stamps. Additionally, this code only works correctly if one has applied a tf or calibration value that makes the pwr values positive (otherwise it NaNs almost all of the data).

I propose that this check box be "rebranded". One option might be that on the initial Settings gui window the check box could be renamed from "Duty Cycle Data" to something like "Remove Extreme Low Outliers (requires tf/calibration value)". Alternatively, gray-out the "Duty Cycle Data" option, so it's clear that is not functional, and add a new check box that allows a user to select the "Remove Extreme Low Outliers" function.

Either of these small changes would more accurately represent what this selection actually does, and it would prevent unsuspecting users from mistakenly thinking that the Remora should work well for duty cycled data.

(I'm still working on how to make the code functional for duty cycled data, and will get back to you if/when I find a way to work around that!)

-Karli

https://github.com/MarineBioAcousticsRC/Triton/blob/929192df3b660f53e25253ebc691035016e361c0/Remoras/Ship-Detector/detection/sh_passage_detector.m#L103C1-L112C4

Error generating LTSAs

Dear all,

I'm new to using triton. So far, I'm having trouble generating LTSAs. I am getting the error message:
"Error using horzcat: Dimensions of arrays being concatenated are not consistent." See:

Error using horzcat
Dimensions of arrays being concatenated are not consistent.

Error in calc_ltsa (line 149)
                               data = [data,dz'];

Error in mk_ltsa (line 43)
calc_ltsa

Error in toolpd (line 81)
  mk_ltsa
 
Error while evaluating Menu Callback.

Data was collected with anchored SoundTraps recording at 96kHz and 16-bit continuously for two months (each file containing 10 minutes). All audio files have the same size. What could be happening, can you please shed some light?

Thanks for the support,

cursor not moving to bottom of pickxyz output in Message window

Hi All,

I have this bug that I've been trying to investigate/fix but without luck. I'm not sure if this is just a me issue or others have encountered it. I can replicate it on my laptop and on a virtual machine that I remotely work on, but it doesn't always happen on my laptop. I am running Matlab 2020b and this occurs with the latest master branch.

My workflow is a open Triton, open an LTSA, toggle on the Pickxyz button so I can keep a scratchpad of start/end times to investigate further, and then click either in the LTSA or in a spectrogram view and I get the following error message in the Command Window:

Error using eval
Check for missing argument or incorrect argument data type in call to function 'getComponent'.
Error in disp_pick (line 15)
eval('jDisp = jDEdit.getComponent(0).getComponent(0);')
Error in pickxyz (line 107)
            disp_pick([str,' ', info_struct.plot]); 
Error while evaluating Figure WindowButtonDownFcn.

Working my way back to try to debug, I found that line 14 in disp_pick, line 14 results in jDEdit being a 1x0 handle, which causes line 15 to throw the error. Stepping in from there, findobj seems to do ok until line 268 when it process the 'position' argument, I end up with an empty foundIdx variable and that breaks things moving forward. I'm not familiar enough with Matlab figure handles and GUIs to get any further than this.

Last week when this issue was not happening on my laptop but was happening on the virtual machine, I did a step-by-step walk through in parallel (thinking the issue was just the virtual machine). In that case, when it was working correctly, line 14 in disp_pick was not returning an empty handle and all proceeded without error. But, coming back to it this week, I'm now getting the same error on my laptop.

This isn't a critical bug, its just annoying as it dings every time and I can't see the output of later picks because they are lost down low in the message window (can scroll to them but each subsequent pick resets to the top). But, if anyone else has encountered this or wants to try to work together to fix it, I'd be happy to do that!!
Thanks,
Selene

Explosion Detector

Screenshot (118)
Screenshot (117)

  1. In the quick setup, "Add Remora" section for the explosion detector, it directs you to add the Ship Detector vs the Explosion detector
    https://github.com/MarineBioAcousticsRC/Triton/wiki/Quick-Setup#S4

  2. After selecting "Run Explosion Detector", the GUI pops up and the following default info populates into the MatLab console:

ans =

struct with fields:

   threshold: 0.0300
   c2_offset: 3.0000e-06
      diff_s: 2
    nSamples: 1000
       rmsAS: 1.5000
       rmsBS: 1
        ppAS: 4
        ppBS: 3
   durLong_s: 0.5500
  durShort_s: 0.0300
     baseDir: 'G:\Site\data\df100'
      outDir: 'G:\Site\ExplosionDetections'
    datatype: 'HARP'
templateFile: 'C:\Users\OSI\Documents\GitHub\Triton\Remoras\Triton-master\Remoras\Explosion-Detector\template.mat'
      plotOn: 0
recursSearch: 0

The when entering my personalized folder locations, selecting "Sound Trap" data type, and hitting the "Run Explosion Detector" button, I receive the following error:

Error using load
Unable to read file 'C:\Users\OSI\Documents\GitHub\Triton\Remoras\Triton-master\Remoras\Explosion-Detector\template.mat'. No such
file or directory.

Error in ex_xcorr_explosion_p2_v4_ST (line 29)
load(template)

Error in ex_detector_control (line 84)
ex_xcorr_explosion_p2_v4_ST(REMORA.ex.detect_params);

Error while evaluating DestroyedObject Callback.

Compute Soundscape Metrics "Bandpass Edges" Ignoring Low Frequency Limit

When I try to use both low and high frequency limits under Bandpass Edges, it seems to be ignoring the lower limit. For example, I attempted 10 to 4096 and the output Excel still included the frequencies below 10. It mislabeled the columns as a result, with the last few columns having no column name at all.

Remora for batch creating LTSAs for multiple directories

Hi MBARC!

I modified a multiDirLTSA Triton version/code that worked to batch create LTSAs for HARP data into a Remora that could be used with the latest version of Triton and should work for wav files. I am not positive it will work for all, and it could probably use some improvements/clean up, but I wanted to let you all know to see if it was of interest to anyone or if you wanted to try to add it as another branch in the MBARC Triton repository. Let me know!

Selene

Conversion of Flac file into xwav file

Hi, whenever I want to convert a Flac file of sampling rate 200KHz (SanctSound_MB03_01_D143_181114000000.x.flac which is a HARP MOORING raw file) into an xwav file by using triton, it does not give a full-length data file (actual Flac file is one-hour data file but converted xwav file is 75sec file or some times it is showing different length data file but not exact). Please provide a solution for this problem.

Thank you.

split vs strsplit

older versions of MATLAB do not have the "split" command, but all versions do have strsplit. I recommend replacing all instances of "split" with "strsplit" e.g. sh_detector_batch.m line 179 (Not sure if there are others lurking - this is the only one I ran into)

Logger improvements

  1. When opening an LTSA or spectrogram and adjusting the Brightess/Contrast for the first time, the color bar on the right does not change until you advance the window once (arrow left or right).
  2. Logger remora - shortcut keys (ex: 1, 2, 3, 4) don't work for the parameters (ex: Start_Hz, End_Hz, Duration_s etc.)
  3. Logger remora - when opening an existing log, all possible species and call types become available to log, instead of only the previously selected species/call types.
  4. Logger effort sheet - the Bryde's whale long-moan and downsweep pulse calls aren't listed as an option.

Batch run detections not matching Interactive detector results

Hi there,
When completing some performance evaluations on the vessel detector I noticed that the when using exactly the same settings in both the initial "interactive detector" and the subsequent "batch run detector" the results do not end up the same.
I assumed the "interactive detector" allowed you to best set your motion control settings and then when these are performing best you apply them to the "batch run detector". However, I have noticed some dropped detections in the batch detector.

Is this normal? Happy to share more details and examples if needed.
I initially worked with the ship detector for the SanctSound program a couple of years back when working in the US - Alba gave me the first run though of the software :)

Many Thanks

meaning of the "MIN. Seconds/Average"(in GUI) or REMORA.sm.cmpt.perc (in code) setting?

Hi all,

Sorry in advance for this long post, but I'm trying to be as precise as possible...

I'm having some issues finding the correct settings to compute metrics with the soundscape metrics Remora.
More specifically with the "MIN. Seconds/Average" settings.

Here are the parameters I use to compute the LTSA :
PARAMS.ltsa.tave = 60; % averaging time [seconds]
PARAMS.ltsa.dfreq = 1; % frequency bin size [Hz]
PARAMS.ltsa.ndays = 16; % length of LTSA [days]
PARAMS.ltsa.nstart = 1; % start number of LTSA file (e.g. want to start at week 2)

% experiment defined (in WAV/XWAV file):
PARAMS.ltsa.fs = 22000; % sample rate [Hz]
PARAMS.ltsa.ftype = 1; % 1= WAVE, 2=XWAV
PARAMS.ltsa.dtype = 1; % 1 = HARP, 2 = ARP, 3 = OBS, 4 = towed array or sonobuoy, 5 = SoundTrap
PARAMS.ltsa.ch= 1; % channel to do ltsa on for multichannel wav files

And here are the parameters used for the metrics :
REMORA.sm.cmpt.ltsaout = 0; % yes/no for a new average LTSA output
REMORA.sm.cmpt.csvout = 1; % yes/no for a csv output
REMORA.sm.cmpt.fstart = 1; % LTSA file number to start with for calculation

%% Analysis Options
% Bandpass Edges
REMORA.sm.cmpt.lfreq = 20; % low frequency cut off (Hz)
REMORA.sm.cmpt.hfreq = 10000; % hight frequency cut off (Hz)

% Analysis Type
REMORA.sm.cmpt.bb= 0; % yes/no broadband level
REMORA.sm.cmpt.ol = 0; % yes/no octave level
REMORA.sm.cmpt.tol = 0; % yes/no third octave level
REMORA.sm.cmpt.psd = 1; % yes/no power spectral density

% Averaging
REMORA.sm.cmpt.avgt = 60; % bin size of time average in seconds
REMORA.sm.cmpt.avgf = 1; % bin size of frequency average in Hz
REMORA.sm.cmpt.perc = 0.01; % percentage of seconds with good data / time average
REMORA.sm.cmpt.mean = 1; % mean averaging type
REMORA.sm.cmpt.median = 0; % median averaging type
REMORA.sm.cmpt.prctile = 0; % percentiles averaging type

% Remove Erroneous Data
REMORA.sm.cmpt.fifo = 0; % yes/no remove fifo noise
REMORA.sm.cmpt.dw = 0; % yes/no remove disk writes in HARP data
REMORA.sm.cmpt.strum = 0; % yes/no remove flow or strumming noise

With the data Iโ€™m analyzing at the moment, anything else than 1 for the REMORA.sm.cmpt.perc parameter does not work, and the output says Time average NOT computed.

I tried to see where the problem comes from, and it appears that any other value than 1 puts the condition in line 85 of sm_cmpt_avgs.m

if (length(hidx) + length(REMORA.sm.cmpt.pre.timeavgs)) >= REMORA.sm.cmpt.avgt*REMORA.sm.cmpt.perc || last_avg == 1

being always false. Therefore, the program never goes into the sm_cmpt_writeout(tidx) line and therefore all outputs are empty.
The variable hidx is incremented by one at each loop turn and that timeavgs is always empty. Therefore length(hidx) + length(REMORA.sm.cmpt.pre.timeavgs)) is always 1 and never > REMORA.sm.cmpt.avgt*REMORA.sm.cmpt.perc except if REMORA.sm.cmpt.perc > 1/ REMORA.sm.cmpt.avgt, which, in my case is equal to 60 seconds.

With this parameter equals to 1% (ie REMORA.sm.cmpt.perc=0.01), it seems that all the averages are done correctly, without skiping LTSA data. Is that correct?
If so, what is the purpose of this parameter?

Thank you very much for any help on this issue!

dateoffest.m missing from Detector Remora

Pulled down fresh copy of Triton to do a fresh install. After adding the Detector Remora, and attempting to run the Detector on a series of .wav files, MATLAB threw an error that dateoffset.m function did not exist. Looked back at previous install of Triton and dateoffset.m existed in the Remoras/Detection directory but did not exist in the fresh pull from Github. Copying dateoffset.m from elsewhere in Triton fixed this issue.

Naming conventions?

@asolsonaberga Do you think we should figure out a naming convention for all of the remoras we have?
I think it could get confusing if things end up with the same names, etc. Maybe we could discuss briefly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.