Project

General

Profile

gencon rgrid remap with running squares

Added by Hélène Barras over 7 years ago

Hello

I've been using the following command

cdo gencon,r132x88 Input.nc remap_weights.nc
for f in ${filelist[@]} ; do
cdo -m -999 -b F64 -remap,"grid.txt" "remap_weights.nc" "$f" "${f%.nc}-halfdeg.nc" ;
done

to calculate the averages within 10x10 grid-points in several Input files (Input has a resolution of 1320x880).

Instead of calculating 10x10 averages for the 132x88 (lower resolved) grid-boxes:
Is there a way to calculate running 10x10 averages such that the Output is a 1320x880 grid with each grid-point in the output file being the average of 10x10 surrounding grid points? (if not surrounding; it could be the next 10x10 grid-points, that's not so crucial; also it's no Problem if the Output grid is smaller because of the edges)

Thanks for your help!
Cheers,
Hélène


Replies (6)

RE: gencon rgrid remap with running squares - Added by Ralf Mueller over 7 years ago

Hi Hélène!

what about the smooth operator ? Might not exactly be, what you requested, but very similar.

you could also have a look at slide 15 of https://code.zmaw.de/attachments/download/13557/CDO_Seminar_20161206.pdf

RE: gencon rgrid remap with running squares - Added by Hélène Barras over 7 years ago

Hi Ralf

Thank you for answering so quickly!
It took a bit longer to test your suggestions because we had to udate our CDO version.
I would be happy with using the smooth operator, however, it seems to have trouble working on my files. It runs endlessly and produces an empty file with only time, lat and lon without the smoothed variable. Could the problem be related to the grid?
Here is the top part of ncdump of one of my files.

Have a nice day
Hélène

RE: gencon rgrid remap with running squares - Added by Ralf Mueller over 7 years ago

sorry Hélène, it took some time ...

cdo -v -P 8 smooth,radius=1deg,nsmooth=2 Europe_19900527-ESACCI-L3U_CLOUD-CLD_PRODUCTS-AVHRR_NOAA-11-fv2.0-ascdesctogether.nc smoothed_Eur.tc

it took about an hour to do this. you could spped it up, by splitting the input per variable and process them in parallel.

RE: gencon rgrid remap with running squares - Added by Hélène Barras over 7 years ago

Hi Ralf
One hour (even a few minutes tbh) is definitely not fast enough for my purposes; I will have to figure out a different solution.
Still, thank you very much for your help and solution.
Cheers

    (1-6/6)