Utility Scripts

From WikiROMS
Revision as of 18:49, 23 April 2012 by Arango (talk | contribs) (Created page with "<section begin=sample_grid.m />;<span id="sample_grid"></span><span class="blue">sample_grid.m</span> :Computes the donor grid indices range of the polygon that tightly contains …")
(change visibility) (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
sample_grid.m
Computes the donor grid indices range of the polygon that tightly contains the target grid. This is done to sample the donor grid to accelerate the interpolation of fields for the receiver grid. The input coordinates can be either in terms of Cartesian or spherical coordinates
[Istr, Iend, Jstr, Jend] = sample_grid  (XD, YD, XR, YR, offset, plt)
On Input:
XD:   Donor grid X-coordinates (2D array)
YD:   Donor grid Y-coordinates (2D array)
XR:   Receiver grid X-coordinates (2D array)
YR:   Receiver grid Y-coordinates (2D array)
offset:   Number of extra points to used to sample the donor grid so is large enough to contain the target grid (optional; default 5)
plt:   Switch to plot parent and target grids (logical; optional; default false)
On Ouput:
Istr:   Donor grid starting I-index for sampling
Iend:   Donor grid ending I-index for sampling
Jstr:   Donor grid starting J-index for sampling
Jend:   Donor grid ending J-index for sampling