-
Notifications
You must be signed in to change notification settings - Fork 85
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
interpolate_na raises TypeError when using rioxarray.open_rasterio
instead of xarray.open_rasterio
#250
Comments
The issue is related to this: #212 (comment) The solution is either have the code do nothing if there is no nodata value or to raise a clearer exception. |
The dataset you have is missing a My guess is your nodata value is Here is the updated script: file_url = 'https://neo.sci.gsfc.nasa.gov/archive/geotiff.float/MY1DMW_CHLORA/MY1DMW_CHLORA_2020-03-21.FLOAT.TIFF'
ds = rioxarray.open_rasterio(file_url)
ds.rio.write_crs("EPSG:4326", inplace=True)
ds.rio.write_nodata(99999., inplace=True)
ds = ds.sel(
y=slice(55, 30), x=slice(165, 180)
)
ds = ds.rio.interpolate_na(method="linear") |
Thanks alot @snowman2 , this works great! 😄 |
You can actually write
I agree. I think raising an exception with the suggestion to use |
Great! :) |
Code Sample
The following causes a crash:
while replacing
rioxarray.open_rasterio
withxarray.open_rasterio
works fine.Problem description
The problem is a crash with the error:
TypeError: float() argument must be a string or a number, not 'NoneType'
:This also happens for other TIFFs.
Environment Information
Installation method
pypi
The text was updated successfully, but these errors were encountered: