Re: interpolate pixel level data into regular grid

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 30 2012 - 11:50:05 MDT

Chao,

Dennis suggested the ESMF regridding routines.

You might want to look at ESMF_regrid specifically.

Since you have 1D coordinate arrays for the source grid, and want a 12 km x 12 km destination grid, I suggest looking at example ESMF_regrid_2.ncl:

http://www.ncl.ucar.edu/Applications/ESMF.shtml

This shows how to regrid from a rectilinear grid (which it looks like you have), to a lat/lon grid that you define, which I assume you have.

This example uses all three methods of interpolation (bilinear, patch, conserve) and regrids to two different grids.

I think you just need to set:

---Common resources
    Opt = True

    Opt@ForceOverwrite = True

    Opt@DstGridLat = lat12
    Opt@DstGridLon = lon12

where lat12 and lon12 contain arrays that represent the 12 km grid.

Then, call ESMF_regrid:

  var_regrid = ESMF_regrid(var,Opt)

Where "var" is the variable you want to regrid that contains the 1D coordinate arrays.

--Mary

On Oct 30, 2012, at 11:09 AM, Luo, Chao wrote:

> x refer to time. This is hourly biomass emission data from 18:00-23:00 on 3/17/2012. What I want to do is to interpolate this pixel level data to regular grid (12km x 12km), but don't know which function can be used. Any suggestions are very appreciated!
>
> ----- Original Message -----
> From: "Dennis Shea" <shea@ucar.edu>
> To: "Chao Luo" <chao.luo@eas.gatech.edu>
> Cc: "ncl-talk" <ncl-talk@ucar.edu>
> Sent: Monday, October 29, 2012 5:00:34 PM
> Subject: Re: interpolate pixel level data into regular grid
>
> The issue is "What does the named dimension 'x' refer to?"
> There is nothing on the file to indicate its purpose.
> You must find out before proceding.
>
> Attached is a simple NCL script that plots the data.
>
> netcdf biomass_burning_20120317_18_23 {
> dimensions:
> x = 6 ;
> y = 371 ;
> variables:
> float Latitude(y) ;
> Latitude:long_name = "Latitude" ;
> Latitude:units = "degree" ;
> Latitude:valid_range = -90.f, 90.f ;
> Latitude:scale_factor = 1.f ;
> Latitude:add_offset = 0.f ;
> Latitude:_FillValue = -9.f ;
> float Longitude(y) ;
> Longitude:long_name = "Longitude" ;
> Longitude:units = "degree" ;
> Longitude:valid_range = -180.f, 180.f ;
> Longitude:scale_factor = 1.f ;
> Longitude:add_offset = 0.f ;
> Longitude:_FillValue = -9.f ;
> float Burned_area(y, x) ;
> [snip]
>
> On 10/29/12 5:15 PM, Luo, Chao wrote:
>> Hi Dennis,
>>
>> I have checked example 8 and 15. They both require two dimensional lat/lon. The lat/lon of files I have are 1 dimension, but data array is 2D (I am not familiar with these format data). Do I need convert lat/lon from 1D to 2D, and then do interpolation in this case? I am attaching the file. Any suggestions and help are very appreciated!
>>
>> CL
>>
>> ----- Original Message -----
>> From: "Dennis Shea" <shea@ucar.edu>
>> To: "Chao Luo" <chao.luo@eas.gatech.edu>
>> Cc: "ncl-talk" <ncl-talk@ucar.edu>
>> Sent: Monday, October 29, 2012 3:35:54 PM
>> Subject: Re: interpolate pixel level data into regular grid
>>
>> http://www.ncl.ucar.edu/Applications/ESMF.shtml
>>
>> Examples 8 and 15 may be of use.
>>
>> On 10/29/12 3:59 PM, Luo, Chao wrote:
>>> Hi,
>>>
>>> I was wondering if NCL has some functions, which can be used to
>>> interpolate satellite pixel level data into regular data. Any helps are
>>> very appreciated.
>>>
>>> CL
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 30 11:50:16 2012

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2012 - 09:14:12 MDT