Open joe-pitt opened 5 months ago
From discussion with Brendan: basis functions in the inversion output are aligned with the footprint, whereas the flux is not. So we need to align the flux with the basis functions in make_paris_outputs before multiplying them
Describe the bug make_paris_outputs fails for inversion runs that used species-specific hfo1234yf fps. It works fine for hfo1234yf runs that used inert footprints, and it also works fine for runs using species-specific fps for hcfo1233zde. I have put the relevant runs on BP1 in the following directory: /group/chem/acrg/joe_hfo_output/24.06.1
To Reproduce python ~/acrg/acrg/paris_formatting/make_paris_outputs.py \ -s hfo1234yf \ -r /group/chem/acrg/joe_hfo_output/24.06.1/pop_base \ -t RHIME_NAME_EUROPE_POPULATION_hfo1234yf_yearly \ -c /group/chem/acrg/PARIS_results_sharing/country_masks/country_EUROPE_EEZ_PARIS_gapfilled.nc \ -p "4h" \ -o /group/chem/acrg/joe_hfo_output/24.06.1 \ --pol-obs
Output Traceback (most recent call last): File "/user/home/zh21490/acrg/acrg/paris_formatting/make_paris_outputs.py", line 401, in
emissions, concentrations = main(
^^^^^
File "/user/home/zh21490/acrg/acrg/paris_formatting/make_paris_outputs.py", line 271, in main
country_output = make_country_output(species, inv_outs, countries, report_mode=report_em_mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/user/home/zh21490/acrg/acrg/paris_formatting/make_paris_outputs.py", line 93, in make_country_output
countries.get_country_trace(species, inv_out).expand_dims({"time": [time_func(inv_out)]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/user/home/zh21490/acrg/acrg/paris_formatting/countries.py", line 140, in get_country_trace
x_to_country_mat = self.get_x_to_country_mat(inv_out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/user/home/zh21490/acrg/acrg/paris_formatting/countries.py", line 94, in get_x_to_country_mat
result = sparse_xr_dot(self.matrix, self.area_grid inv_out.flux inv_out.basis)