smap卫星 h5文件怎么打开
答案:2 悬赏:0 手机版
解决时间 2021-03-30 10:05
- 提问者网友:轮囘Li巡影
- 2021-03-29 13:57
smap卫星 h5文件怎么打开
最佳答案
- 五星知识达人网友:底特律间谍
- 2021-03-29 14:40
clear;
clc;
% Open the HDF5 File.
FILE_NAME = 'SMAP_L1B_TB_01767_A_20150601T084152_R13080_001.h5';
file_id = H5F.open (FILE_NAME, 'H5F_ACC_RDONLY', 'H5P_DEFAULT');
% Open the dataset.
DATAFIELD_NAME = 'Brightness_Temperature/tb_h';
data_id = H5D.open(file_id, DATAFIELD_NAME);
Lat_NAME='Brightness_Temperature/tb_lat';
lat_id=H5D.open(file_id, Lat_NAME);
Lon_NAME='Brightness_Temperature/tb_lon';
lon_id=H5D.open(file_id, Lon_NAME);
% Read the dataset.
data=H5D.read (data_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
lat=H5D.read(lat_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
lon=H5D.read(lon_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
% Read the fill value.
ATTRIBUTE = '_FillValue';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
fillvalue=H5A.read (attr_id, 'H5T_NATIVE_DOUBLE');
% Read the units.
ATTRIBUTE = 'units';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
units = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read the valid_max.
ATTRIBUTE = 'valid_max';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
valid_max = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read the valid_min.
ATTRIBUTE = 'valid_min';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
valid_min = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read title attribute.
ATTRIBUTE = 'long_name';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
long_name=H5A.read (attr_id, 'H5ML_DEFAULT');
% Close and release resources.
H5A.close (attr_id)
H5D.close (data_id);
H5F.close (file_id);
% Replace the fill value with NaN.
data(data==fillvalue) = NaN;
% Replace the invalid range values with NaN.
data(data < double(valid_min)) = NaN;
data(data > double(valid_max)) = NaN;
clc;
% Open the HDF5 File.
FILE_NAME = 'SMAP_L1B_TB_01767_A_20150601T084152_R13080_001.h5';
file_id = H5F.open (FILE_NAME, 'H5F_ACC_RDONLY', 'H5P_DEFAULT');
% Open the dataset.
DATAFIELD_NAME = 'Brightness_Temperature/tb_h';
data_id = H5D.open(file_id, DATAFIELD_NAME);
Lat_NAME='Brightness_Temperature/tb_lat';
lat_id=H5D.open(file_id, Lat_NAME);
Lon_NAME='Brightness_Temperature/tb_lon';
lon_id=H5D.open(file_id, Lon_NAME);
% Read the dataset.
data=H5D.read (data_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
lat=H5D.read(lat_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
lon=H5D.read(lon_id,'H5T_NATIVE_DOUBLE', 'H5S_ALL', 'H5S_ALL', 'H5P_DEFAULT');
% Read the fill value.
ATTRIBUTE = '_FillValue';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
fillvalue=H5A.read (attr_id, 'H5T_NATIVE_DOUBLE');
% Read the units.
ATTRIBUTE = 'units';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
units = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read the valid_max.
ATTRIBUTE = 'valid_max';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
valid_max = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read the valid_min.
ATTRIBUTE = 'valid_min';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
valid_min = H5A.read(attr_id, 'H5ML_DEFAULT');
% Read title attribute.
ATTRIBUTE = 'long_name';
attr_id = H5A.open_name (data_id, ATTRIBUTE);
long_name=H5A.read (attr_id, 'H5ML_DEFAULT');
% Close and release resources.
H5A.close (attr_id)
H5D.close (data_id);
H5F.close (file_id);
% Replace the fill value with NaN.
data(data==fillvalue) = NaN;
% Replace the invalid range values with NaN.
data(data < double(valid_min)) = NaN;
data(data > double(valid_max)) = NaN;
全部回答
- 1楼网友:十年萤火照君眠
- 2021-03-29 15:45
CCTV3 5 6 8 是加密节目,大锅是收不到的。 中星6B 115.5\x27E C波束 \r\n3840H27500中央3880H27500新闻\r\n4000H27500中央教育\r\n4115H21374中央4\r\n3960H3570辽宁\r\n3750H10490湖南\r\n3786H5440四川\r\n3796H6930贵州\r\n3808H880...
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯