0

I'm regridding an irregular data (MODIS 10kmx10km data) to a regular grid of 0.1km x 0.1km. I'm using the pyresample code but I'm uncertain about which value should I use for the radius_of_influence parameter.

Understand from the pyresample documentation that radius_of_influence is the radius around each grid pixel in meters to search for neighbours in the swath. If I'm understanding this correctly, in my case -to regrid data from 10kmx10km to 0.1kmx0.1km- should my radius of influence be 10km? (or 0.1km?) The code below is a block of an example code obtained from LAADS MODIS. I've changed the cellSize from 0.1 to 0.001 degree (the task in the original code is to regrid to a something that is close enough to native resolution). I'm wondering whether I should change the radius_of_influence, and I thought that I should not based on the definition given in the documentation. But I'm not sure, and hope to hear more suggestions on this.

    # Regrid.
    # Define SwathDefinition.
    swathDef = SwathDefinition(lons=longitude, lats=latitude)    

    # Define GridDefinition.
    # 0.001 degree is about 0.01011km
    cellSize = 0.001
    min_lon = np.min(longitude)
    max_lon = np.max(longitude)
    min_lat = np.min(latitude)
    max_lat = np.max(latitude)
    x0, xinc, y0, yinc = (min_lon, cellSize, max_lat, -cellSize)
    nx = int(np.floor((max_lon - min_lon) / cellSize))
    ny = int(np.floor((max_lat - min_lat) / cellSize))
    x = np.linspace(x0, x0 + xinc*nx, nx)
    y = np.linspace(y0, y0 + yinc*ny, ny)
    lon_g, lat_g = np.meshgrid(x, y)
    grid_def = GridDefinition(lons=lon_g, lats=lat_g)

    # Set radius_of_influence in meters.
    ri = 10000
    result = resample_nearest(swathDef, data, grid_def, 
                          radius_of_influence=ri, epsilon=0.5,
                          fill_value=np.nan)
LEC
  • 1
  • 1

0 Answers0