Re: About linint2_Wrap function

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun Oct 07 2012 - 03:12:55 MDT

Hello,

The input array's south and north latitudes are

-88.42 and + 88.42

Your target bottom and top latitudes are -90 and 90.

linint2 will not extrapolate as mentioned in the documentation:

"If the output coordinates (xo,yo) are outside those of the input
coordinates (xi,yi), then the fo values at those coordinates will
be set to missing (i.e. no extrapolation is performed).

I suggest

    newsst( 0,:) = (/ avg(newsst( 1,:)) /)
    newsst(72,:) = (/ avg(newsst(71,:)) /)

However, at the south pole (-90 or -87.5 ) there are no sst.

On 10/5/12 4:36 PM, waqar younas wrote:
> Thanks for the response.
> The original lats are from 90 to -90 and i read them like that
> mm = short2flt(aa->prate(0,::-1,:))
> The printVarSummary of mm is
> Variable: mm
> Type: float
> Total Size: 72192 bytes
> 18048 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 94] x [lon | 192]
> Coordinates:
> lat: [-88.542..88.542]
> lon: [ 0..358.125]
> Number Of Attributes: 11
> valid_max : 0.0023903
> valid_min : 9.988131e-08
> _FillValue : 2e+20
> missing_value : 2e+20
> units : Kg/m^2/s
> long_name : mean Daily Precipitation Rate at surface
> time : 1.72512e+07
> date : 01/01/01
> title : mean Daily Precipitation Rate at surface
> name : prate
>
> Now i define new lat and lon like
>
> newlon = fspan(0,357.5,144)
> newlat = fspan(-90,90,73)
>
> newlat@units = "degrees_north"
> newlon@units = "degress_east"
>
> newsst = linint2_Wrap(mm&lon,mm&lat,mm,True,newlon,newlat,0)
>
> But the out put of newsst(0,0:100) is
>
> (0) 2e+20
>
> for all values. This is fill value of mm. It means when function
> applies, it is adding only fill value instead of real values. I checked
> the orginal mm for same range, the values are correct before regriding.
>
>
>
>
>
> On Fri, Oct 5, 2012 at 1:09 PM, Dennis Shea <shea@ucar.edu
> <mailto:shea@ucar.edu>> wrote:
>
> This is not enough information.
>
> What does printVarSummary(mm) yield ?
>
> What about printVarSummary(lat2) ?
>
> Note that the documentation states that 'yi'
> and 'yo' (ie, lat and lat2) must be increasing.
>
>
>
>
>
>
>
>
> On 10/5/12 1:38 PM, waqar younas wrote:
>
>
>
> ---------- Forwarded message ----------
> From: *waqar younas* <vickyqau@gmail.com
> <mailto:vickyqau@gmail.com> <mailto:vickyqau@gmail.com
> <mailto:vickyqau@gmail.com>>>
> Date: Fri, Oct 5, 2012 at 12:09 AM
> Subject: About linint2_Wrap function
> To: ncl-talk@ucar.edu <mailto:ncl-talk@ucar.edu>
> <mailto:ncl-talk@ucar.edu <mailto:ncl-talk@ucar.edu>>
>
>
> Hi to all,
> I am using linint2_Wrap to regrid NCEP precipitation data which is
> originally have 94 lats and 192 lon. I want to regrid to 2.5 by 2.5
> means, to 73 lats and 144 lons.
> But the regridded data is having fill values added, instead of real
> values and i do not know the reason. Here is the code
> begin
>
> aa = addfile("precep_NCEP_1969___2002.nc <http://2002.nc>", "r")
>
> mm = short2flt(aa->prate(0,:,:)) ;;;; taking one time just to make
> sure that code is working or not
>
> m_1a = mm*86400
>
> copy_VarCoords(mm,m_1a)
>
> lon1 = aa->lon
> lat1 = aa->lat
>
> f = addfile ("uwnd.1969.nc <http://uwnd.1969.nc>
> <http://uwnd.1969.nc>", "r") ;;;; This
>
> is file having lats 73 and lon 144.
>
> ff = f->uwnd(0,0,:,:)
> lon2 = f->lon
> lat2 = f->lat
>
> ;newlon = fspan(0,357.5,144)
> ;newlat = fspan(-90,90,73)
>
> ;newlat@units = "degrees_north"
> ;newlon@units = "degress_east"
>
> ;prep = linint2_Wrap(mm&lon,mm&lat,mm,__True,newlon,newlat,0)
>
> prep = linint2_Wrap(lon1,lat1,m_1a,__True,lon2,lat2,0)
>
> I tried both methods i.e. one using another file which is having the
> lats and lon, i want to have in new file. I took lat and lon of
> those
> file and applied the function to regrid. The other method is
> usual way
> which above i commented. Both methods are giving same result i.e
> adding
> fill values to regrided data instead of real values. Another thing i
> note that lon dimension should be cyclic to put argument True in the
> linint2_Wrap. I do not know which lons are cyclic and if they
> are not
> cyclic, how to make them?
> Any help would be highly appreciable.
> Thanks.
>
>
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>
>
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>
>
>
> _________________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/__mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Oct 7 03:13:15 2012

This archive was generated by hypermail 2.1.8 : Mon Oct 08 2012 - 15:54:16 MDT