Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tagwiki:tools:calibration:crop_all [2017/08/04 13:23]
das39 created
tagwiki:tools:calibration:crop_all [2017/08/04 13:23] (current)
das39
Line 1: Line 1:
 +====== crop_all ======
 +Reduce the time span of a dataset by cropping out any data that falls before and after two time cues.
 +-----
  
 +===== Syntax =====
 +=== Matlab & Octave ===
 +<​code>​
 +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
 +</​code>​
 +=== R ===
 +<​code>​
 +list <- crop_all(tcues,​ X)           # X is a sensor list or set of sensor lists)
 +</​code>​
 +
 +===== Description =====
 +Reduce the time span of a dataset by cropping out any data that falls before and after two time cues.
 +
 +===== Inputs =====
 +^ 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|
 +
 +===== Outputs =====
 +^ 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|
 +
 +===== Example =====
 +
 +==== Matlab & Octave ====
 +<​code>​
 +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
 +</​code>​
 +
 +==== R ====
 +<​code>​
 +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
 +</​code>​
 +
 +===== About =====
 +[[bugs@animaltags.org]]
 +Last modified: 4 August 2017
  • tagwiki/tools/calibration/crop_all.txt
  • Last modified: 2017/08/04 13:23
  • by das39