source: trunk/src/transform_field/diff_vel.m @ 876

Last change on this file since 876 was 876, checked in by sommeria, 9 years ago

deformation modified in civ_series and bug corrections

File size: 2.0 KB
Line 
1%'diff_vel': calculate the difference of two input velocity fields.
2%
3% the second velocity field is linearly interpolated
4% (after elimination of the vectors marked with an error flag) to the positions of
5% the first one before subtraction. The ancilary data of the first field
6% are preserved while those of the second one are lost.
7
8%-----------------------------------------------------------------------
9% function SubData=diff_vel(Field,XmlData,Field_1)
10%
11% OUPUT:
12% SubData: structure representing the resulting field
13%
14% INPUT:
15% Field: matlab structure representing the first field
16% XmlData: not used, needed for consistency with the call of transform fct.
17% Field_1:matlab structure representing the second field
18
19%=======================================================================
20% Copyright 2008-2014, LEGI UMR 5519 / CNRS UJF G-INP, Grenoble, France
21%   http://www.legi.grenoble-inp.fr
22%   Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
23%
24%     This file is part of the toolbox UVMAT.
25%
26%     UVMAT is free software; you can redistribute it and/or modify
27%     it under the terms of the GNU General Public License as published
28%     by the Free Software Foundation; either version 2 of the license,
29%     or (at your option) any later version.
30%
31%     UVMAT is distributed in the hope that it will be useful,
32%     but WITHOUT ANY WARRANTY; without even the implied warranty of
33%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34%     GNU General Public License (see LICENSE.txt) for more details.
35%=======================================================================
36
37function SubData=diff_vel(Field,XmlData,Field_1)
38
39SubData=Field;
40if exist('Field_1','var')
41          F.U=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.U,'linear');
42         SubData.U=Field.U-F.U(Field.X,Field.Y);%substract the interpolated ref to U
43          F.V=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.V,'linear');
44          SubData.V=Field.V-F.V(Field.X,Field.Y);%substract the interpolated ref to V
45end
46 
Note: See TracBrowser for help on using the repository browser.