cdo remap by addition?
Added by David Kelly over 5 years ago
Hello,
I'd like to remap a netcdf file, reducing the total number of pixels. I'd like each new pixel value to be the sum of the old/smaller pixels contained within it. The new file and old file would have different resolutions but have the same total sum. In other words, I'd like to remap by addition. Is there any easy way to do this? Thanks!
Regards,
David
Replies (6)
RE: cdo remap by addition? - Added by Uwe Schulzweida over 5 years ago
Try the CDO operator gridboxsum (https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-3880002.8.10).
To compute the sum over 4x4 grid boxes (16 pixels) of the input field use:
cdo gridboxmean,4,4 infile outfile
RE: cdo remap by addition? - Added by Pallav Kumar Shrestha about 2 years ago
Hi
I have the same question as David, but relatively complicated data situation.
My input pixel is 0.08333 degree and I would like to upscale it to 0.125 degree. So I can not use gridboxmean as nx and ny (4 and 4 in above example) are required to be integers.
Remap/ remapcon, on the other hand, can be applied to any non-integer ratio between input and target resolution, but for "average preservation". Is there is a solution with CDO to carry out upscaling between non aligning resolutions with "sum preservation"?
Thanks in advance.
Pallav
RE: cdo remap by addition? - Added by ray kettaren about 2 years ago
Hello all,
I have a similar question regarding the remapping data. I have data downloaded from Cordex project with domain EUR-11 with rotated coordinate.
Then, I want to remap it to be usual coordinate. Firstly I use this :
cat > EUR11-grid << EOR
gridtype = lonlat
gridtype = lonlat
xsize = 1000
ysize = 480
xfirst = -44.82
xinc = 0.11
yfirst = 21.78
yinc = 0.11
EOR
#######################################################
Then I type this command:
cdo remapdis,EUR11-grid timmean_prhadgem_76-05.nc remap_pr_hadgem_76-05.nc
But there is an error message said that
cdo remapdis (Abort): xsize undefined!
If you have any idea about it let me know.
Thank you very much.
Regards,
Ray
RE: cdo remap by addition? - Added by Uwe Schulzweida about 2 years ago
Ever gridtype entry in the CDO grid description file will define a new grid. Remove on of them and it will work as expected.
RE: cdo remap by addition? - Added by Uwe Schulzweida about 2 years ago
The CDO operator remapsum computes the sum of all source points within a target cell. Maybe this is the operator you need.