Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

CURV_TO_RECT

CURV_TO_RECT (V, mapping)

Applies the mapping computed by function CURV_TO_RECT_MAP to interpolate data from a curvilinear to a rectilinear latitude-longitude grid. This computation employs a spherical interpolation code written at GFDL; the Ferret developers are responsible for its implementation as an external function.

Arguments:

V

Variable on the source curvilinear grid

 

mapping

mapping from the source grid to a rectilinear grid

Result Axes:

X

Inherited from mapping

 

Y

Inherited from mapping

 

Z

Inherited from V

 

T

Inherited from V

This is a grid-changing function. Indicate limits on the argument axes with square brackets []. See the note on grid-changing functions in Chapter 3

Example of calls to CURV_TO_RECT_MAP and CURV_TO_RECT:

yes? use my_curvilinear_data.nc
yes? show data
currently SET data sets:
1> /.my_curvilinear_data.nc (default)
name title I J K L
GEOLON geographic longitude of grid 1:180 1:173 .. ..
GEOLAT geographic latitude of grid 1:180 1:173 .. ..
SALT salinity 1:180 1:173 1:30 1:12 
AIRT air temperature 1:180 1:173 1:30 1:12
 
yes? ! For convenience define variables with curvilinear grid
 
yes? let lonin = geolon[d=1]
yes? let latin = geolat[d=1]
yes? ! Define output grid and a variable on the rectilinear output grid
 
yes? define axis/x=0:360:5/modulo/units=degrees xax
yes? def axis/y=0:85:5/units=degrees yax
 
! This is a dummy variable on the rectilinear grid
yes? let lonlatout = y[gy=yax] + x[gx=xax]
yes? ! Compute the mapping to the rectangular grid, save to a file
 
yes? let map = curv_to_rect_map ( lonin,latin,lonlatout,10)
yes? save/clobber/file=curv_map.nc map
yes? ! Apply the mapping to the data fields
 
yes? cancel var/all
yes? use curv_map.nc
yes? let out_salt = curv_to_rect(salt[d=1,K=1,L=2], map[d=2])yes? shade out_salt
yes? let out_airt = curv_to_rect(airt[d=1], map[d=2])
yes? save/file=air_on_rect.nc out_airt