Re: How to interpolate vectors?
- To: mathgroup at smc.vnet.net
- Subject: [mg112942] Re: How to interpolate vectors?
- From: Szymon Roziewski <szymon.roziewski at gmail.com>
- Date: Thu, 7 Oct 2010 03:35:55 -0400 (EDT)
hello Ingolf and MathGroup, My data is on curvilinear grid which represents geographical coordinates for some area. I don't know how to use rectilinear parameters to represent it. This interpolation was about to change curvilinear data from grid 448x615 to 132x145 rectilinear grid. I did it by another tool which was quite easy but I still don't know how to deal with it in Mathematica. //I am still working on another of your questions, but please be patient. I //have my job to do (what I am doing just now cannot be mentioned here) and a //garden to harvest. Thank You for your work I did it in a simply way just by sweeping matrices but it's an inefficient way for doing it. Have a good garner. kind regards, Simon 2010/10/5 Ingolf Dahl <ingolf.dahl at telia.com> > Mathematica should be able to do this straight off, as long as you might > represent the data on a rectilinear grid, just supply vectors as function > values for the control points. An example: > > a = Flatten[ > N[Table[{x, y, {Sin[x] Sin[y], Cos[x] Cos[y]}}, {x, 0, 2*Pi, > Pi/6}, {y, 0, 2*Pi, Pi/6}]], 1]; > > Interpolation[a][0.3, 0.4] > > gives {0.116014, 0.882871} > > ({Sin[x] Sin[y], Cos[x] Cos[y]} /. {x -> 0.3, y -> 0.4} gives {0.115081, > 0.879923}) > > You might also do > > b = Flatten[ > N[Table[{{x, y}, {Sin[x] Sin[y], Cos[x] Cos[y]}}, {x, 0, 2*Pi, > Pi/6}, {y, 0, 2*Pi, Pi/6}]], 1] > > Interpolation[b][0.3, 0.4] > > which gives the same. > You mention something about a curvilinear grid, but maybe you could use > some > rectilinear parameters to represent this? > (Longitude and latitude?) Then one might ask if an interpolation function > is > adequate for wind data, but that is another question, maybe outside the > realm of Mathematica. > > I am still working on another of your questions, but please be patient. I > have my job to do (what I am doing just now cannot be mentioned here) and a > garden to harvest. > > Best regards > > Ingolf Dahl > > > -----Original Message----- > > From: Szymon Roziewski [mailto:szymon.roziewski at gmail.com] > > Sent: den 5 oktober 2010 11:37 > > To: mathgroup at smc.vnet.net > > Subject: [mg112907] How to interpolate vectors? > > > > Hello there, > > Does anybody know how to interpolate vector data e.g. wind data? > > For example I have wind data on grid 448 columns and 615 rows on > curvilinear > > grid and I need this on grid 132x145 which is uniform. > > Does Mathematica provide such a function or maybe someone has that. > > > > Kind regards, > > Szymon > > > -- Z wyrazami szacunku, Szymon Roziewski