Search code examples
rnetcdf4cdo-climatenco

Best method for resample and reproject large set of data


I got all set of daily data from IMERG (precipitation) from 2005 to 2020. (5947 files).

I need to made this:

  • clip the data for my interest area for reduce the size of the total file. done!

    cdo sellonlatbox

  • Reproject the files to EPSG:31983 (UTM) and resize the pixel to 25mx25m. Stuck on this!!

Now i'm using the projectRaster from R, but it is too lazy !!

Someone have some tips?

i can use python, R, NCO, CDO...


Solution

  • For the future people: Use gdalwarp function for it.

    Example:

    gdalwarp -s_srs EPSG:4326 -t_srs EPSG:31983 -tr 25 25 -te 512125 7738250 660700 8061650 -r near input.nc output.nc
    

    Explanation:

    -s_srs EPSG:4326 input srs

    -t_srs EPSG:31983 output srs

    -tr 25 25 is the spatial resolution

    -te 512125 7738250 660700 8061650 is the new extent acording to EPSG:31983

    -r near resample method