geoschem / integrated_methane_inversion

Integrated Methane Inversion workflow repository.
https://imi.readthedocs.org
MIT License
25 stars 19 forks source link

AssertionError: lon_b should be size (Nx+1, Ny+1) #165

Closed delgadocc closed 11 months ago

delgadocc commented 11 months ago

Name and Institution (Required)

Name: Cristhian Delgado Institution: University of Otago

Description of your issue or question

I've been having trouble using the visualization_notebook, especially on the Comparison at 0.25 x 0.3125 resolution. I get the error "AssertionError: lon_b should be size (Nx+1, Ny+1)" related to the 'conservative_normed' method in the regriding part. I also tried with the 'conservative' method getting the same error. However,using the 'bilinear', 'nearest_s2d', 'patch' and 'nearest_d2s' methods it works, the latter being the one that I think is closest to the 0.1x0.1 grid. However, I'm not sure. Could you be so kind as to give me an advise? Attached you will find the notebook .

visualization_notebook.pdf

In any case, I have the following concern, what is the difference between the superobs_df and visualization_df dataframes and why the one is used for the 0.1x0.1 grid and another for the 0.25x0.325 grid.

Thanks in advance for the clarification.

laestrada commented 11 months ago

Hi @delgadocc,

Thanks for writing in. This was a bug that we recently fixed here, but the bufix will not be released until IMI2.0 comes out. For now, you should be able to download the updated visualization_notebook.ipynb in the dev-2.0 branch and replace it with your existing one.

As for the difference between the superobs_df and visualization_df dataframes, in the inversion we average tropomi observations into the native resolution gridcells (.25x.3125) if they are in the same retrieval file following Chen et al., 2023. This cuts down on computational time during the inversion step by reducing the size of the observation matrix (y) and has little effect on the outcome of the inversion.

However, because these observations are averaged into a .25 degree gridcells already, regridding them to .1x.1 degree resolution causes the resultant visualization to appear segmented, since all super observations that land in a gridcell will overlay each other. For this reason, we use the non-averaged observations to provide the user with a better idea of the observation coverage.

Let me know if the above bugfix fixes your issue.

delgadocc commented 11 months ago

Dear @laestrada

Thank you so much for your continuous support and detailed explanation! I confirm that is working now.

Best regards

laestrada commented 11 months ago

Great!