Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed outer regions fails for certain flux files #120

Open
joe-pitt opened this issue May 13, 2024 · 0 comments
Open

Fixed outer regions fails for certain flux files #120

joe-pitt opened this issue May 13, 2024 · 0 comments

Comments

@joe-pitt
Copy link
Contributor

When I run an inversion with fixed outer regions using this flux file (https://uob-my.sharepoint.com/:u:/g/personal/zh21490_bristol_ac_uk/EaVEt0JeRt1BjVGcOz3KOkQBWgpJ2VuuMwDuYUb0JlMinw?e=tlcda0) I get the following error:

Traceback (most recent call last):
  File "/user/home/zh21490/openghg_inversions/openghg_inversions/hbmcmc/run_hbmcmc.py", line 247, in <module>
    mcmc_function(**param)
  File "/user/home/zh21490/openghg_inversions/openghg_inversions/hbmcmc/hbmcmc.py", line 437, in fixedbasisMCMC
    fp_data = basis_functions_wrapper(
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/home/zh21490/openghg_inversions/openghg_inversions/basis/_wrapper.py", line 95, in basis_functions_wrapper
    basis_data_array = fixed_outer_regions_basis(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/home/zh21490/openghg_inversions/openghg_inversions/basis/_functions.py", line 201, in fixed_outer_regions_basis
    basis.loc[loc_dict] = (inner_region + 5).squeeze().values
    ~~~~~~~~~^^^^^^^^^^
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/dataarray.py", line 246, in __setitem__
    self.data_array[dim_indexers] = value
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/dataarray.py", line 892, in __setitem__
    self.variable[key] = value
    ~~~~~~~~~~~~~^^^^^
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/variable.py", line 866, in __setitem__
    indexing.set_with_indexer(indexable, index_tuple, value)
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/indexing.py", line 1012, in set_with_indexer
    indexable[indexer] = value
    ~~~~~~~~~^^^^^^^^^
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/indexing.py", line 833, in __setitem__
    self.array[indexer] = value
    ~~~~~~~~~~^^^^^^^^^
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/indexing.py", line 1521, in __setitem__
    self._safe_setitem(array, key, value)
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/indexing.py", line 1504, in _safe_setitem
    raise exc
  File "/user/home/zh21490/.conda/envs/openghg_dev_env/lib/python3.12/site-packages/xarray/core/indexing.py", line 1495, in _safe_setitem
    array[key] = value
    ~~~~~^^^^^
ValueError: could not broadcast input array from shape (183,128) into shape (182,127)

When I use this flux file (https://uob-my.sharepoint.com/:u:/g/personal/zh21490_bristol_ac_uk/EfLKUfzbGKFOkESMI3b3iAkB8z_QTe-B06lFE_k_s7pakw?e=RpV7B6) the inversion runs fine. The only difference appears to be a very small difference in the lat/lon values, which should be within tolerance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant