#pragma rtGlobals=1 // Use modern global access method. #include ":IFDL Procedures:IFDL" #include ":IFDL Procedures:Apply filter" Function Master() variable SingleDouble SingleDouble=1 Prompt SingleDouble,"1: for single A-tag towed, 2: for double A-tag towed" DoPrompt "FOR TOWED SURVEY TO COUNT ANIMALS",SingleDouble if(V_Flag) Abort "The user pressed Cancel" endif if (SingleDouble==1) Data_loadingCSV() PulseInterval() DrawSingle() elseif (SingleDouble==2) Data_loadingCSVB() PulseIntervalB() Data_loadingCSV() PulseInterval() DrawDouble() else print "unexpected towed type. Let me assume single type" Data_loadingCSV() PulseInterval() DrawSingle() endif Bunpu() end //----------------------------------------------------------- //Data loading Function Data_loadingCSV() string /G InputFileName print "*****************************" print "****** ******" print "****** select FRONT data ******" print "****** ******" print "*****************************" LoadWave/G/D/L={0, 0, 0, 0, 0} rename wave0, Igtime rename wave1, SPL1 rename wave2, SPL2 rename wave3, td InputFileName=S_fileName //print InputFileName print "FRONT data loading completed" print "" end //----------------------------------------------------------- //Data loading Function Data_loadingCSVB() string /G InputFileName print "****************************" print "****** ******" print "****** select REAR data ******" print "****** ******" print "****************************" LoadWave/G/D/L={0, 0, 0, 0, 0} rename wave0, IgtimeB rename wave1, SPL1B rename wave2, SPL2B rename wave3, tdB InputFileName=S_fileName //print InputFileName print "REAR data loading completed" print "" end //----------------------------------------------------------- //create inter-pulse interval Function PulseInterval() wave Igtime variable p, m, N, j, dlt, scale string w m=numpnts(Igtime) //total number of pulses Make/D/O/N=(m) PlsInt j=0 do PlsInt[j]=(Igtime[j+1]*100000-Igtime[j]*100000)/100 j+=1 while (j