简体   繁体   English

无法使用 satpy 加载 HDF Modis 数据

[英]Could not load HDF Modis data with satpy

one maybe silly question.一个可能很愚蠢的问题。 I want to load MODIS hdf data with python. The datasets are available at Earthdata.我想用 python 加载 MODIS hdf 数据。数据集可在 Earthdata 获得。 First of all a generated a list of data, which match the datestemp.首先生成一个数据列表,它与 datetemp 相匹配。

filenames_Aqua=glob(sat_path+MODIS_AQUA+'*.hdf')
filenames_Aqua.sort()

Now i have a list of 10 files.现在我有 10 个文件的列表。 Following the introduction from Satpy:根据 Satpy 的介绍:

global_scene = Scene(reader="modis_l1b", filenames=filenames_Aqua)

The following error message happen:出现以下错误消息:

ValueError: Could not load data from file /MODIS_Aqua/Calibrated_Radiances_5-Min_L1B_1km/MYD021KM.A2017131.1320.061.2018032101913.hdf: SD (15): File is supported, must be either hdf, cdf, netcdf

Any ideas?有任何想法吗?

Thanks.谢谢。

I'll repeat my comment here so this question can be considered resolved (you'll need to select this as the accepted answer).我会在这里重复我的评论,这样这个问题就可以被认为已经解决了(你需要 select 作为接受的答案)。

The error message you are getting is coming from the underlying pyhdf library and not Satpy.您收到的错误消息来自底层的 pyhdf 库,而不是 Satpy。 This suggests your HDF4 file is corrupt in some way or maybe not actually an HDF4 file.这表明您的 HDF4 文件在某种程度上已损坏,或者实际上可能不是 HDF4 文件。 You could try running ncdump -h your_file.hdf on the command line and if it succeeds then that suggests the file is NOT corrupt.您可以尝试在命令行上运行ncdump -h your_file.hdf ,如果成功,则表明文件未损坏。

As you commented, it seems the files from Earthdata are corrupt in some way.正如您所评论的,Earthdata 中的文件似乎在某种程度上已损坏。 The same files from LAADS are fine.来自 LADS 的相同文件都可以。 If you're up for it, I would recommend contacting the Earthdata group about the issues you've discovered.如果您愿意,我建议您联系 Earthdata 小组,了解您发现的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM