clear;
clc;
ncdisp('D:\LIN\毕业论文\nc文件\NPR_SMOPS_CMAP_D20181106.nc','/', 'full');%浏览nc文件内容
data=ncread('D:\LIN\毕业论文\nc文件\NPR_SMOPS_CMAP_D20181106.nc','Blended_SM');%打开nc文件中'Blended_SM'数据
data=data';
for i=1:1:720
for j=1:1:1440
if data(i,j)>0.5||data(i,j)<0
data(i,j)=NaN;
end
end
end
%imshow(data,maps);%将图像矩阵画图(display)
%imread('xxx.png');%将RGB图像读入工作区
%GeoRef= maprasterref('RasterSize', [720,1440],'YWorldLimits', [912500 913000], 'ColumnsStartFrom','north','XWorldLimits', [207000 208000]);
R = georasterref('RasterSize',size(data));
R.LatitudeLimits = [-90 90];
R.LongitudeLimits = [-180 180];
R.ColumnsStartFrom = 'north';
geotiffwrite('1.tif',data,R);