[Thread Prev][Thread Next][Index]

[ferret_users] Problems determining indices using CURV_TO_RECT_MAP



Hello All,

I am trying to use CURV_TO_RECT_MAP to determine the index values of a subgrid for a curvilinear dataset using the FAQ http://www.ferret.noaa.gov/Ferret/FAQ/custom_plots/subsetting_curvi_data.html. When I implement the outlined procedure, Ferret crashes (see below). Any thoughts on what might be going wrong?

In advance, thanks for any help you can provide.

John

bash-2.05b$ ferret
NOAA/PMEL TMAP
FERRET v5.81
Linux(g77) 2.4.21-32 - 07/13/05
29-Aug-05 16:29

yes? go hazmat_subgrid
! Input data on a curvilinear grid
use "http://localhost/cgi-bin/nph-dods/dgom/hazmat.nc";
*** NOTE: Units on axis "sigma" are not recognized: sigma_level
*** NOTE: They will not be convertible:

let lonin = lon[d=1]
let latin = lat[d=1]

! Define the corners of our subset: These will define
! the axes of our output grid

let xmin = -90
let xmax = -82
let ymin = 25
let ymax = 29

def axis/x=`xmin`:`xmax`/npoints=2/modulo/units=degrees xax
!-> def axis/x=-90:-82/npoints=2/modulo/units=degrees xax
def axis/y=`ymin`:`ymax`/npoints=2/units=degrees yax
!-> def axis/y=25:29/npoints=2/units=degrees yax

! Define a variable on the output grid

let lonlatout = y[gy=yax] + x[gx=xax]

! Compute weights for the mapping

set memory/size=250
Cached data cleared from memory
let map = curv_to_rect_map (lonin, latin, lonlatout, .5)

! The variable <I>map</I> includes the indices within the source
! grid which correspond to coordinates in the destination grid.
! These are the lower lon and lat and upper lon and lat indices:

! e.g. here are the longitude indices (L=2) and latitude indices (L=3)
! the four nearest neighbors (K=1:4) in the curvilinear grid, which map
! to the i=1,j=1 location on the output axes.

! Compute the minimum and maximum indices in I and J needed
! to plot the entire region

show grid map
GRID (G005)
name axis # pts start end
XAX LONGITUDE 2mr 90W(-90) 82W(-82)
YAX LATITUDE 2 r 25N 29N
ABSTRACT Z 9999999 r 1 9999999
ABSTRACT T 9999999 r 1 9999999

let llon = map[i=1,j=@min,l=2,k=@min]
list map[i=1,j=@min,l=2,k=@min]
VARIABLE : CURV_TO_RECT_MAP (LONIN, LATIN, LONLATOUT, .5)
LONGITUDE: 90W(-90)
LATITUDE : 23N to 31N (minimum)
Z : 0.5 to 4.5 (minimum)
T : 2
91.00
let llat = map[i=@min,j=1,l=3,k=@min]
list map[i=@min,j=1,l=3,k=@min]
VARIABLE : CURV_TO_RECT_MAP (LONIN, LATIN, LONLATOUT, .5)
LONGITUDE: 94W(-94) to 78W(-78) (minimum)
LATITUDE : 25N
Z : 0.5 to 4.5 (minimum)
T : 3
73.00

let ulon = map[i=2,j=@max,l=2,k=@max]
list map[i=2,j=@max,l=2,k=@max]
free(): invalid pointer 0xa193d70!
VARIABLE : CURV_TO_RECT_MAP (LONIN, LATIN, LONLATOUT, .5)
LONGITUDE: 82W(-82)
LATITUDE : 23N to 31N (maximum)
Z : 0.5 to 4.5 (maximum)
T : 2
183.0
let ulat = map[i=@max,j=2,l=3,k=@max]
list map[i=@max,j=2,l=3,k=@max]
Segmentation fault


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement