python读取modis数据
python,读取,modis,数据
2025-03-28 09:01:05 时间
大家好,又见面了,我是你们的朋友全栈君。
本期记录只上干活,废话不多说,主要是后面与HEG配合使用,实现一系列研究与反演操作。
python环境:Python 3.5.2 +Pycharm
模块包:pyhdf
安装方法(命令行输入):
pip install pyhdf
一、获取hdf数据集:
from pyhdf.SD import SD
HDF_FILR_URL = "E:\Persona_project\Py-Program\RS\modis\MOD021KM.A2018092.0300.061.2018092134259.hdf"
file = SD(HDF_FILR_URL)
info=file.info()#数据集个数
print(info)
ds_dict=file.datasets()#所有数据集名称
for idx, sds in enumerate(ds_dict.keys()):
print(idx, sds)
二、获取每个数据集数据:
# -*- coding:utf-8 -*-
# author:
from pyhdf.SD import SD
HDF_FILR_URL = "E:\Persona_project\Py-Program\RS\modis\MOD021KM.A2018092.0300.061.2018092134259.hdf"
file = SD(HDF_FILR_URL)
EV_1KM_Emissive = file.select('EV_1KM_RefSB').get()
print(EV_1KM_Emissive.shape)
三、获取每个数据集属性:
# -*- coding:utf-8 -*-
# author:
from pyhdf.SD import SD
HDF_FILR_URL = "E:\Persona_project\Py-Program\RS\modis\MOD021KM.A2018092.0300.061.2018092134259.hdf"
file = SD(HDF_FILR_URL)
EV_1KM_Emissive = file.select('EV_1KM_RefSB')
attributes = EV_1KM_Emissive.attributes()#获取属性
radiance_scales = attributes['radiance_scales']#辐亮度缩放尺度
radiance_offsets = attributes['radiance_offsets']##辐亮度偏移值
reflectance_scales = attributes['reflectance_scales']#反射率缩放尺度
reflectance_offsets = attributes['reflectance_scales']#反射率偏移值
print(radiance_scales)
print(radiance_offsets)
print(reflectance_scales)
print(reflectance_offsets)
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/139247.html原文链接:https://javaforall.cn
相关文章
- Easy Games With Python and Pygame(三)- Pygame Event
- pythoncharm注释快捷键_多行注释以什么开头
- python ZipFile: output zip file,ByteIO
- 【python实战】不让我复制?看我自制个带文字识别的截屏工具
- python进制转换函数
- 【过程记录】python环境离线迁移
- 做自动化测试选择Python还是Java?
- 用Python做图像处理[通俗易懂]
- 毕业设计!Python实现学生教师刷脸签到系统
- Python应用实践——设计一个学生管理系统
- Python字符串与时间相互转换
- 分类变量的卡方检验(python实现&SPSS实现)「建议收藏」
- 用Python写一个百度POST实时推送工具
- python换行符使用_python中怎么换行?「建议收藏」
- Python <算法思想集结>之初窥基础算法
- python的第三方库是用什么实现的_python 第三方库
- Python正则表达式,这一篇就够了!
- python批量获取同程酒店的信息
- pythonrandom函数用法_python之random模块函数的使用
- python win32api messagebox_如何在Python中使用Win32 API?