导入的 GeoTIFF 文件仅返回 NAN 值
我一直在尝试导入显示辐照度数据的 GEOTIFF 文件。我能够绘制(请参阅绘制此处)该文件,因此我确信该文件包含数据;然而;栅格数组仅包含 nan 值。有什么办法可以解决这个问题吗?我对 python 很陌生,所以也许我错过了一些明显的东西,任何帮助将不胜感激:)
这是我正在使用的代码:
from osgeo import gdal
import numpy as np
import matplotlib.pyplot as plt
import gc
gc.enable()
#import
ds = gdal.Open('DNI_Spain.tif')
gt = ds.GetGeoTransform()
proj = ds.GetProjection()
band = ds.GetRasterBand(1)
array = band.ReadAsArray()
max_value = np.max(array)
min_value = np.min(array)
median_value = np.median(array)
plt.figure()
plt.imshow(array)
I have been trying to import a GEOTIFF file that shows irradiance data. I am able to plot (see Plot here) the file so I am sure the file has data; however; the raster array contains only nan values. Is there any way to resolve this? I am quite new to python so perhaps I've missed something obvious, any help would be appreciated :)
This is the code I'm using:
from osgeo import gdal
import numpy as np
import matplotlib.pyplot as plt
import gc
gc.enable()
#import
ds = gdal.Open('DNI_Spain.tif')
gt = ds.GetGeoTransform()
proj = ds.GetProjection()
band = ds.GetRasterBand(1)
array = band.ReadAsArray()
max_value = np.max(array)
min_value = np.min(array)
median_value = np.median(array)
plt.figure()
plt.imshow(array)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论