Re: Data regriding question

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 29 2013 - 18:08:08 MDT


A couple of quick suggestions:

  1. For the linint2 function, the input and output coordinates must be monotonically INCREASING. I can see that your 'newlat' array runs from 90 to -90 (i.e. is decreasing). You will also need to check that the input lat/lon arrays don't need to be reversed.

2. Your output 'newlon' array runs from 0-360. It's quite possible that the input data lon array runs from -180 to 180; if this is the case you'll need to change your newlon array or half your data points will be __FillValues.


From: Durga Kafle <<>>
Date: Saturday, 30 March 2013 11:01 AM
To: "<>" <<>>
Subject: Data regriding question


I am trying to interpolate 20 CR precipitation data using linint2_Wrap function. The data is gaussian gridded. I would like to interpolate to a fixed grid. I have tried a few other functions as well (g2fsh_Wrap, linint2_Wrap etc). I get all Fillvalues (-32767) when I print the interpolated "prate". I am attaching the script here. I am just a beginner in ncl and would appreciate any help with this.


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
; read in netCDF file
  cdf_file = addfile("/Volumes/HD2/UCR/Data/20CR/<>","r")


; interpolate to new grid
  prate@_FillValue= -32767h

  newlat = fspan(90.0,-90,96)
  newlon = fspan(0.,358.,144)

  prate1 = short2flt(prate(0,:,:))
 ; print(prate1)
 ; prate2 =flt2dble(prate1)
; printVarSummary(prate1)

; do ne=0,0
 ; newprate = linint2(lon,lat,prate1,False,newlon,newlat,0)
  newprate = linint2_Wrap(lon,lat,prate1,False,newlon,newlat,0)
; end do
; newsst!0 ="lat"
; newsst!1 = "lon"
; newsst&lat = newlat
; newsst&lon = newlon


ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Mar 29 18:08:31 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT