Re: help with regridding

From: Jeff Van Dorn <vandorn_at_nyahnyahspammersnyahnyah>
Date: Tue, 2 May 2006 16:29:40 -0500

Hi Adam,

I'd prefer doing some kind of area average, but subsampling will
probably suffice, however the newlat and newlons as defined below are
not in finarr (e.g., it goes from 39.9375 to 40.0925, so no 40.0). I
guess I could change the newlat/newlon values to ones that are in
finarr, although I really need to output data at the specified lat/
lons in newlat and newlon (38., 40. etc).

However, if there's a way to do an area average for this data, that's
what I'd prefer. (FWIW, I've also put the data where the images are,
see below)

Thanks for the suggestion, something I obviously wasn't thinking
about and will play with it to see what I can come up with.
Jeff

On May 2, 2006, at 4:05 PM, Adam Phillips wrote:

> Hi Jeff,
>
> Depending on what you want here, Dennis Shea (just in my office)
> has came up with a possible solution for you.
>
> This is assuming you do not want an area average, and that you are
> fine with subsampling:
>
> newlat = (/38.,40.,42.,44.,46.,48./)
> newlon = (/-80.0, -77.5, -75.0, -72.5, -70.0, -67.5, -65.0/)
> arr2x25 = finarr({newlat},{newlon})
>
> newlat2 = (/36.,40.,44.,48.,52/)
> newlon2 = (/-80.,-75.,-70.,-65.,-60./)
> arr4x5 = finarr({newlat2},{newlon2})
>
> If this isn't what you are looking for let us know.
> Adam
>
>
> Jeff Van Dorn wrote:
>> Hello,
>> I have an ascii grid file at a resolution of .125 x .125, which
>> Adam (Phillips) graciously helped me to be able to read into and
>> plot with NCL. However, now I have the task of having to upscale
>> this data to a larger grid (2x2.5 and also 4x5 - lat x lon). My
>> attempts at regridding might be producing the best results
>> possible, however I'd much appreciate it if someone could take a
>> look and see if there's something I'm doing incorrectly.
>> As this data that I have is for the northeast US only, and no
>> ocean or Canadian data is present I do have a rather slim
>> boundary for the data to fit in, and given the fact the my new
>> grid will be considerably larger than the existing grid, that
>> might be why I have so few grids that actually contain any data
>> when I plot the larger grid, but then again I might be doing
>> something wrong with the regridding.
>> Below is a portion of the script that I'm executing, and I've
>> uploaded my output images to:
>> http://temagami.tosm.ttu.edu/~jvandorn
>> If anyone has any suggestions on how to get more grids in the
>> larger grid size to contain data, I would be most appreciative.
>> Alternatively, I'd also be grateful if someone would just be able
>> to confirm that this is the best that I can do with the larger
>> grid size that I'd like to have.
>> Thanks much,
>> Jeff Van Dorn
>> finarr = new((/dimsizes(lat),dimsizes
>> (lon)/),"float",-999.) ; set up array to house
>> finarr!0 = "lat" ; data
>> finarr&lat = lat
>> finarr!1 = "lon"
>> finarr&lon = lon
>> do gg = 0,dimsizes(a(:,0))-1 ; loop thru each line,
>> use coordinate subscripting to
>> finarr({a(gg,0)},{a(gg,1)}) = (/ a(gg,2) /) ; place
>> data in finarr
>> end do
>> ;##########
>> ; This is what I've added
>> ;##########
>> newlat = (/38,40,42,44,46,48/)
>> newlon = (/-80.0, -77.5, -75.0, -72.5, -70.0, -67.5, -65.0/)
>> newlat_at_units = "degrees_north"
>> newlon_at_units = "degrees_east"
>> newlat!0 = "lat"
>> newlat&lat = newlat
>> newlon!0 = "lon"
>> newlon&lon = newlon
>> ; attempt the regrid
>> newvar = linint2( lon, lat, finarr, False, newlon, newlat, 0)
>> newvar!0 = "lat" ; data
>> newvar&lat = newlat
>> newvar!1 = "lon"
>> newvar&lon = newlon
>> ;Then plot and stuff
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 02 2006 - 15:29:40 MDT

This archive was generated by hypermail 2.2.0 : Wed May 03 2006 - 09:00:09 MDT