I need to re-grid fine matrix variable, called “fine_var” with dimensions of (12,1800,3600) (time lat lon) to coarse matrix variable, called “coarse_var” with dimension (12,180,360) (time, lat, lon), without interpolate the variable, but summing the contribution to each cell of fine matrix to the cell of coarse matrix.
To do this I created a loop below with python:
for ii in range(len(ds.fine_var[0,:,0])-1):
for jj in range(len(ds_disk.fine_var[0,0,:])-1):
coarse_var[:,int(ii/10),int(jj/10)]+=ds.fin_var[:,ii,jj]
However, this loop is too heavy to compute and I was wondering if there is a light method in Python to create a coarse grid without interpolating the variable.
Can anyone please offer any assistance?
Any help is much appreciated!