Specifying indexes in regridded data #281
Unanswered
jmdelvecchio
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, I have a netCDF file where the original dimensions were (X,Y) (polar coordinates) and I have successfully regridded the data to lat/long (much like in this example, which I followed). However, I would now like to sample the value of my data at certain points I have (which are in lat/long), but when I go to use
.sel()
to get data values based on lat/long I receive the error messageKeyError: "no index found for coordinate 'lat'"
The code I use is:Indeed checking
reindexed_data.indexes
returns empty indices, but I cannot.set_xindex('lon')
because I get the error messagePandasIndex only accepts a 1-dimensional variable, variable 'lon' has 2 dimensions
I believe I need to create/define indexes for the regridded DataArray, but I am unsure how to do that. Any advice is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions