geoschem / integrated_methane_inversion

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

[BUG/ISSUE] StateVector.nc fails to build for very narrow region of interest #29

Closed djvaron closed 5 months ago

djvaron commented 2 years ago

Using a very small latitude range for the region of interest:

LonMin: 3
LonMax: 7
LatMin: 42
LatMax: 43
REGION: "EU"

BufferDeg: 5
nBufferClusters: 8
LandThreshold: 0.25
CreateStateVectorFile: true

Res: "0.5x0.625"
Met: "merra2"

IMI throws the following error when building and then attempting to read the state vector file:

/home/ubuntu/CH4_Workflow/Test_France_3days/make_state_vector_file.py:110: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  statevector.values[land.isnull()] = 0
Traceback (most recent call last):
  File "/home/ubuntu/CH4_Workflow/Test_France_3days/make_state_vector_file.py", line 183, in <module>
    make_state_vector_file(land_cover_pth, save_pth, lat_min, lat_max, lon_min, lon_max, buffer_deg, land_threshold, k_buffer_clust)
  File "/home/ubuntu/CH4_Workflow/Test_France_3days/make_state_vector_file.py", line 110, in make_state_vector_file
    statevector.values[land.isnull()] = 0
IndexError: too many indices for array: array is 2-dimensional, but 19 were indexed

Works normally when using a larger region of interest, e.g. setting LatMax: 53.

djvaron commented 2 years ago

Interestingly, the following configuration (with narrow longitude) works normally:

LonMin: 3
LonMax: 4
LatMin: 42
LatMax: 53
REGION: "EU"

BufferDeg: 5
nBufferClusters: 8
LandThreshold: 0.25
CreateStateVectorFile: true

Res: "0.25x0.3125"
Met: "geosfp"

I suspect it's not to do with latitude vs. longitude, but because the resolution is higher here, so 1 degree isn't as effectively narrow as in the MERRA-2 configuration.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the issue from closing this issue.

github-actions[bot] commented 5 months ago

Closing due to inactivity