Is 'weight' variable used in bin() operation?

My use case is the following: when I want to create daily grids of S5P L2 data, I can either

  1. merge L2 files for all orbits of a day, and use a single bin_spatial() operation on the merged L2 data, or
  2. use bin_spatial() on each orbit, and then merge the per-orbit grids into a single grid using bin()

I’d prefer to use method 2), because it likely requires much less memory when using harpmerge ‘reduce’ operations, but I’m not 100% sure the result will be identical. bin_spatial() creates a weight variable, determined by the pixel area overlap of input satellite pixels and the spatial bins. Does bin() take into account this ‘weight’ variable when combining per-orbit grids? If not, the result of method 2 would be slightly different from that of method 1).

I’ve read a previous conversation on this topic (How is the average of a HARP "bin" calculated? Role of weight and count variables?). From the C library documentation of harp_product_bin(), I understand that the weight variable is used, but the algorithm documentation at Regridding operations — HARP 1.19 documentation suggests a more simple arithmetic average.

This is an omission in the documentation. Existing weight/count variables are taken into account when performing temporal binning (i.e. method 2 can be used). We will update the documentation for this.
Thanks for bringing this to our attention.

1 Like