crop_all

Reduce the time span of a dataset by cropping out any data that falls before and after two time cues.


Matlab & Octave

X = crop_all(tcues,X)		% X is a sensor structure or set of sensor structures
      or
[X,Y,...] = crop_all(tcues,X,Y,...)		% X, Y, ... are sensor structures

R

list <- crop_all(tcues, X)           # X is a sensor list or set of sensor lists)

Reduce the time span of a dataset by cropping out any data that falls before and after two time cues.

Input var Description Units
tcues is a two-element vector containing the start and end time cue in seconds of the data segment to keep, i.e., tcues = [start_time, end_time] (%Mat. or Oct.) tcues ← c(start_time, end_time) (#R).seconds
X is a sensor structure/list or a set of sensor structures/lists (e.g., from load_nc). In Matlab and Octave, Y, Z, …. are additional sensor structures.N/A
Output var Description Units
X is a sensor structure/list or set of sensor structures/lists containing the cropped data segment. The output data have the same units, frame and sampling characteristics as the input.N/A
Y,… (%Mat. and Oct.) are additional sensor structures as required to match the input.N/A

Matlab & Octave

X=load_nc('testset3')
d = find_dives(X.P,300) ;
X = crop_all([d.start(2) d.end(2)],X);	% crop all data to 2nd dive
plott(X.P,X.A)
% plot shows the dive profile and acceleration of the second dive

R

test <- beaked_whale
d <- find_dives(test$P,300)
X <- crop_all(c(d$start[2], d$end[2]), test)	#crop all data to 2nd dive
testdata <- list(P = X$P, A = X$A)
plott(testdata)
#plot shows the dive profile and acceleration of the second dive

bugs@animaltags.org Last modified: 4 August 2017

  • tagwiki/tools/calibration/crop_all.txt
  • Last modified: 2017/08/04 13:23
  • by das39