FY-4A读取FullMask_Grid.raw查找表

#将FullMask_Grid_4000.raw读取为NC格式的经纬度文件,经纬度维度为2748*2748,以下为MATLAB语言
file ID=fopen('FullMask_Grid_4000.raw');
BB=fread(fileID,[2748*2 2748],'double');
fclose(fileID);
LAT=BB(1:2:2*2748,:);
LON=BB(2:2:2*2748,:);
LAT(find(abs(LAT)>1000))=NaN;
LON(find(abs(LON)>1000))=NaN;
LAT=LAT';
LON=LON';
nccreate('GEO.nc','LON','Dimensions',{'r',2748,'c',2748},...
    'Format','classic');
ncwrite('GEO.nc','LON',LON);
nccreate('GEO.nc','LAT','Dimensions',{'r',2748,'c',2748},...
    'Format','classic');
ncwrite('GEO.nc','LAT',LAT);
#用PYTHON读取RAW文件
import numpy as np
rawfile=r"H:\temp_estimate\FY4A-readanddraw\FullMask_Grid_4000.raw"
dim=2748
data=np.fromfile(rawfile,dtype=float,count=dim*dim*2)
latlon=np.reshape(data,(dim,dim,2))
lat=latlon[:,:,0]
lon=latlon[:,:,1]

FY-4A读取FullMask_Grid.raw查找表_第1张图片

你可能感兴趣的:(风云卫星)