本文主要是介绍matlab GOCI水色数据画TSS变化过程+批量读取.he5文件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
下载地址:
http://kosc.kiost.ac.kr/eng/
clear all;close all;clc
%% 读取经纬度
file='COMS_GOCI_L2P_GA_20110524031644.LON_1.he5';
LON=h5read(file,'/HDFEOS/GRIDS/Image Data/Data Fields/Longitude Image Pixel Values');
file='COMS_GOCI_L2P_GA_20110524031644.LAT_1.he5';
LAT=h5read(file,'/HDFEOS/GRIDS/Image Data/Data Fields/Latitude Image Pixel Values');
%% 读取TSS数据
datadir='/Users/boopstore3/Desktop/5/'; %指定批量数据所在的文件夹
filelist=dir([datadir,'*.he5']); %指定批量数据的类型
a=filelist(1).name; %查看你要读取的文件的编号
b=filelist(2).name;
k=length(filelist);
TSS=[];TSS2=[];
for s=1:kfilename=[datadir,filelist(s).name];TSS1 = h5read(filename,'/HDFEOS/GRIDS/Image Data/Data Fields/TSS Image Pixel Values'); TSS1(TSS1==-999)=NaN; TSS1(TSS1==0)=NaN;TSS1=double(TSS1);TSS2 = cat(3,TSS2,TSS1);
end;
for i=1:3:30b=nanmean(TSS2(:,:,i:i+2),3);%日均TSSTSS = cat(3,TSS,b);
end;
%% TSS动图
time=[datenum('20130902','yyyymmdd'):datenum('20130911','yyyymmdd')];
date=datestr(time,'yyyymmdd');
Ncy_TSS=log10([0.5,1,2,4,8,16]);
k=1;for i=1:length(time)figure(1)set(gcf,'visible','off')set(gcf,'units','centimeters','position',[0 0 20 15])set(gca,'position',[0.05 0.05 0.95 0.9])m_proj('Mercator','lon',[120.5 123.5],'lat',[26.5 30.5]);TSS(TSS<=0)=NaN;m_pcolor(LON,LAT,log10(squeeze(TSS(:,:,i))));%画TSS分布图caxis([min(Ncy_TSS),max(Ncy_TSS)]);load('/Users/boopstore3/Desktop/matlab/shiyanchengxu/five/GOCIColormaps.mat','mycmap');colormap(mycmap);colorbar('YTick',Ncy_TSS ,'YTickLabel',{10.^Ncy_TSS});shading flat;m_gshhs_i('patch',[.5 .8 .0],'edgecolor','none');m_grid('box','fancy','xtick',5,'ytick',5,'fontsize',10);m_text(122.5,27,date(i,5:8),'color','k','fontsize',30,'FontWeight','bold');m_text(121,29.5,'***','fontsize',15)frame=getframe(gcf);im=frame2im(frame);%制作gif文件,图像必须是index索引图像[I,map]=rgb2ind(im,256);if k==1imwrite(I,map,'eddy_motion_new.gif','gif','Loopcount',inf,...'DelayTime',0.2);%loopcount只是在i==1的时候才有用elseimwrite(I,map,'eddy_motion_new.gif','gif','WriteMode','append',...'DelayTime',0.2);%DelayTime用于设置gif文件的播放快慢endclf; k=k+1;
end
经纬度数据
https://download.csdn.net/download/qq_44913577/12379180
https://download.csdn.net/download/qq_44913577/12379173
之前设置的下载所需积分是0,过了一段时间后才发现系统给我改成了3。如果要下载经纬度数据,可以看下面的图
这篇关于matlab GOCI水色数据画TSS变化过程+批量读取.he5文件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!