openghg / openghg_inversions

University of Bristol Atmospheric Chemistry Research Group RHIME Inversion code (with openghg dependency)
MIT License
5 stars 0 forks source link

Separate data merge function #16

Closed aliceramsden closed 1 year ago

aliceramsden commented 1 year ago

Changes made:

  1. Pulled out functions from the main hbmcmc.py code that are used to read in and merge data and create the footprints and boundary conditions sensitivity matrices.
  2. Written a new function that replicates this process, that should (theoretically) be useable by other inverse models. I've tested this using my multiple-gas inverse model and it seems to work with no issue.
  3. Added options to save the output of this merging process as a .pickle file or reload model inputs from a previously created .pickle file.
  4. Added an option to search for already existing basis function files. The code then only creates the file if it doesn't already exist.
  5. Changed some variable names associated with making/finding basis function files. The example .ini files have been updated to reflect this change.
  6. Added a print out of the number and percentage of observations that are removed by the filtering process (this is unrelated to the above, but was a quick fix and something I find useful).

Notes:

  1. There are no tests for this code, I could write some now if suggested, or add this as an issue to be addressed later.
  2. Rachel has suggested that the zarr package could be used to reduce memory usage of the new merge_fp_data_flux_bc_openghg function. I haven't had any issues when using this code with methane, but this may be needed if this is used with CO2 in the future.