I am trying to produce an LTSA of a 3 week period of data from 2018 and the same period in 2020. My 2018 data was collected using a SoundTrap on a 10 min on/10 min off duty cycle. I have processed the files in PAMGuard to create LTSA binary files and found the below code from the very helpful Conservation Coding blog.
folder='D:\PAMGUARD\PAMBinary\Depl953\20180626';
channel=0; %use channel zero (these data are form one channel anyway)
plotLTSA=true; %true to autimaticall plot the LTSA
hsens=-172.3;%hydrophone sensitivity in dB re 1V/uPa
vp2p=2; %peak to peak voltage in dB
gain=0; %gain in dB
day_num_start=0; %time start
day_num_end=200000000; %time end
climits=[40,120]; %colour limits in dB root Hertz
%load and plot LTSA data
[ltsa_spectrum, ltsa_time, interval, ltsa_spectrumdB] = load_LTSA_folder(...
folder, channel, day_num_start, day_num_end, plotLTSA, hsens, vp2p, gain, climits);
%make a colour bar showing the spectral density
colormap jet;
ax = gca;
c=colorbar;
c.Label.FontSize = 12;
c.Label.Interpreter='tex';
c.Label.String = 'dB re 1\muPa \surdHz';
This plots the following LTSA:
My questions are:
- PAMGuard binary files are organised in folders by day. Is there a simple way to load more than one folder at a time so I can plot 3 weeks on one LTSA or do I need to loop through each folder?
- How can I make my x-axis dates/times as opposed to time in minutes?
- This may resolve itself after addressing (2), but, how can I include the duty cycle in the LTSA aka have 'blank' where there was no data? I want this because I want to plot the same 3-week period from 2018 and 2020 in a multiplot figure to allow qualitative comparison of course-scale noise variability within and between years.
Thanks!