Project

General

Profile

gridboxstd on a moving spatial window

Added by Alison Muhling over 1 year ago

Apologies if this is a naive question, I'm new to CDO:

I'm using gridboxstd to calculate a spatial standard deviation. It works great, but the output netcdf is coarsened to the specified box (e.g. specifying a 3x3 box coarsens a 0.25 degree resolution netcdf to 0.75 degrees). Is there a way in CDO to calculate a standard deviation using a moving window? So the output netcdf would be on the same spatial grid as the input netcdf, and each cell would show the standard deviation of the cells in an x by x box around it?

Many thanks!


Replies (4)

RE: gridboxstd on a moving spatial window - Added by Uwe Schulzweida over 1 year ago

Use remapnn to map the result of gridboxstd to the original grid:

cdo remapnn,infile -gridboxstd,3,3 infile outfile

RE: gridboxstd on a moving spatial window - Added by Alison Muhling over 1 year ago

Thanks Uwe!

This is still not quite what I was looking for (the window is still fixed, and then results regridded within it), but it gets me closer. If the window does not include very many cells, I can probably get what I need just by adjusting the window a few times, re-running, and aggregating the results.

Thanks again!

RE: gridboxstd on a moving spatial window - Added by Zach Murphy 4 months ago

Hi there, I know I'm a bit late to this, but any luck on being able to calculate moving spatial windows?

RE: gridboxstd on a moving spatial window - Added by Alison Muhling 4 months ago

Hi Zach,

I didn't have any luck, I just ended up kludging it up in R (slow). I'm also a beginner with CDO though, so that doesn't necessarily mean it can't be done!

    (1-4/4)