Utility Scripts: Difference between revisions
From WikiROMS
Jump to navigationJump to search
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) |
No edit summary (change visibility) |
||
Line 1: | Line 1: | ||
<div class="title">Matlab: Utility Scripts</div>__NOTOC__ | |||
This page describes several Matlab scripts in the matlab/utility repository sub-directory which are used for various purposes. | |||
<!-- Edit Template:Matlab_Scripts_TOC to modify this Table of Contents--> | |||
<div style="float: left;margin: 0 20px 0 0;">{{Matlab Scripts TOC}}</div>__NOTOC__ | |||
<div style="clear: both"></div> | |||
<section begin=sample_grid.m />;<span id="sample_grid"></span><span class="blue">sample_grid.m</span> | <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 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<br /> | :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<br /> |
Revision as of 19:21, 23 April 2012
Matlab: Utility Scripts
This page describes several Matlab scripts in the matlab/utility repository sub-directory which are used for various purposes.
- 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