The fact that it is spacial data doesn't matter. But to correctly calculate the standard deviation of a collection of values which are, themselves, averages, you also need two other numbers for each of those values: the number of measurements which were averaged to produce each (average) value, and the standard deviation of those measurements.
So each point on the grid must have, not just one, but three numbers associated with it: the mean (the value which is the average of the measurements at that grid point), the number of measurements that were averaged to calculate that mean, and the standard deviation of those measurements. Thus, for a 20x20 grid (400 grid points) you'll have 400 averages, 400 standard deviations, and 400 sample counts.
If you have that, then you can exactly calculate the combined/composite mean and standard deviation for the whole set of 400 grid points. This web page describes how to do it, and why it works; it also includes source code in Perl and Python:
http://www.burtonsys.com/climate/composite_standard_deviations.html