Bin operation succeeds with -ap but fails with -ar

Hi Sander,

I applied bin_spatial to get daily L3 files from QA4ECV NO2 L2 files, for 1 month of data. This went fine.
Then I created a single monthly file using the ‘bin()’ operation as post-operation (-ap) in a harpmerge command. That went fine as well. Note that ‘latitude_bounds_weight’, ‘longitude_bounds_weight’ variables are created in the process, but were initially not present in the daily files.

As a test, I tried a reduce-operation (-ar) instead of a post-operation for the ‘bin()’ to create a monthly file from the daily files. However, then I get as error message
ERROR: products don’t both have variable ‘latitude_bounds_weight’

Even if I do as reduce-operation “exclude(latitude_bounds_weight);exclude(longitude_bounds_weight);bin();” I still get this error message.

Is this a bug? Or is the reduce operation restricted for certain use cases only?

You have to turn it around. The weight variables are a result of the bin() operation, so if you want to combine that partial result with the next grid of a file, then you have to make sure that this partial result doesn’t have the weight variables (since the individual grid of a file doesn’t have it either).
So this would be: bin();exclude(latitude_bounds_weight,longitude_bounds_weight).

However, the correct way to do this is to remove the dependency on the time dimension for the lat/lon grid variables. This way they won’t get included in the bin() operation and you will not see weight variables for them appear either. You do this by providing the following reduce operation: squash(time,(latitude_bounds,longitude_bounds));bin()

Thanks. It works now!