# Differences

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

— |
tagwiki:tools:calibration:crop [2017/08/04 13:14] (current) das39 created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== crop ====== | ||

+ | Interactive data cropping tool. | ||

+ | ----- | ||

+ | ===== Syntax ===== | ||

+ | === Matlab & Octave === | ||

+ | <code> | ||

+ | Y = crop(X) % X is a sensor structure | ||

+ | or | ||

+ | [Y,tcues] = crop(X,fs) % X is a regularly sampled vector or matrix | ||

+ | or | ||

+ | [Y,T,tcues] = crop(X,T) % X is a regularly sampled vector or matrix | ||

+ | </code> | ||

+ | === R === | ||

+ | <code> | ||

+ | list <- crop(X) # X is a sensor list | ||

+ | or | ||

+ | list <- crop(X, sampling_rate) # X is a regularly sampled vector of matrix | ||

+ | or | ||

+ | list <- crop(X, T) # X is a regularly sampled vector or matrix | ||

+ | </code> | ||

+ | |||

+ | ===== Description ===== | ||

+ | Interactive data cropping tool. This function plots the input data # and allows the user to select start and end times for cropping. | ||

+ | |||

+ | ===== Inputs ===== | ||

+ | ^ Input var ^ Description ^ Units ^ | ||

+ | |X| is a sensor structure/list, vector or matrix. X can be regularly or irregularly sampled data in any frame and unit.|N/A| | ||

+ | |fs/sampling_rate| is the sampling rate of X in Hz. This is only needed if X is not a sensor structure and X is regularly sampled. If X is not a sensor structure/list and X is not regularly sampled, T is a vector of sampling times for X. |Hz| | ||

+ | |||

+ | ===== Outputs ===== | ||

+ | ^ Output var ^ Description ^ Units^ | ||

+ | |Y| is a sensor structure/list, vector or matrix containing the cropped data segment. If the input is a sensor structure, the output will also be. The output has the same units, frame and sampling characteristics as the input.|N/A| | ||

+ | |T| is a vector of sampling times for Y. This is only returned if X is irregularly sampled and X is not a sensor structure. If X is a sensor structure, the sampling times are stored in the structure. |Hz| | ||

+ | |tcues| is a two-element vector containing the start and end time cue in seconds of the data segment kept, i.e., tcues = [start_time, end_time] (%Mat. or Oct.) tcues <- c(start_time, end_time) (#R).|seconds| | ||

+ | |||

+ | ===== Example ===== | ||

+ | |||

+ | ==== Matlab & Octave ==== | ||

+ | <code> | ||

+ | load_nc('testset3') | ||

+ | Pc = crop(P); % interactively select a section of data | ||

+ | plott(Pc) | ||

+ | % plot shows the cropped section | ||

+ | </code> | ||

+ | |||

+ | ==== R ==== | ||

+ | <code> | ||

+ | data <- beaked_whale | ||

+ | Pc <- crop(data$P) #interactively select a section of data | ||

+ | Ydata <- list(depth = Pc$Y) | ||

+ | plott(Ydata) | ||

+ | #plot shows the cropped section | ||

+ | </code> | ||

+ | |||

+ | ===== About ===== | ||

+ | [[bugs@animaltags.org]] | ||

+ | Last modified: 4 August 2017 |