I am trying to keep track of the performed HARP operations in Python through the history
global file attrribute, but I don’t get it to work as intended.
Let’s say I perform all operations during harp.import_product
:
file = "./S5P_OFFL_L2__HCHO___20240707T174154_20240707T192324_34892_03_020601_20240709T095147.nc"
hp = harp.import_product(file, operations="keep(tropospheric_HCHO_column_number_density,latitude_bounds,longitude_bounds);bin_spatial(181,-90,1.,361,-180,1.);derive(latitude {latitude});derive(longitude {longitude});", post_operations="bin();squash(time, (latitude,longitude));")
harp.export_product(hp, "harp_testfile.h5")
then the history attribute of the exported file contains the full content of the operations string.
However, if I perform the operations in 2 steps:
hp = harp.import_product(file, operations="keep(tropospheric_HCHO_column_number_density,latitude_bounds,longitude_bounds);"
hpl3 = harp.execute_operations(hp, operations="bin_spatial(181,-90,1.,361,-180,1.);derive(latitude {latitude});derive(longitude {longitude});", post_operations="bin();squash(time, (latitude,longitude));")
harp.export_product(hpl3, "harp_testfile.h5")
Here the history
attribute only contains the ‘keep’ operation performed during harp.import_product
.
I expected it to (also) include the most recent operations, from the execute_operations
command.
This seems to contradict this statement in the manual at:
Global attributes — HARP 1.23 documentation, where is says:
Note that the Conventions, datetime_start, and datetime_stop attributes are only used inside files. For the in-memory representation (in C, Python, etc.) only the history and source_product attributes are present.
Do I misunderstand?
Thanks in advance,
Jeroen