Skip to content
Advertisement

how to spatialy aggregate netcdf fields in python, CDO, or NCO?

I want to regrid population data from 0.05 degrees to 0.1 degrees. Because it is population, I should aggregate (sum) population values for resampling data to a coarser resolution. Although I thought that there going to be a simple answer to this question, I did find any yet. I think my question does not need sample data, but you may find the population data from Gridded Population of the World (GPW), v4.

Thanks for your help.

Advertisement

Answer

You could also duplicate Charlie’s conversion approach using cdo, but because your gridbox sizes (before/after) are an integral multiple of each other (i.e. you want to aggregate over a 2×2 pixel square), then it is simpler to directly use the cdo function gridboxsum

 cdo gridboxsum,2,2 in.nc out.nc
Advertisement