爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4545|回复: 2

[程序设计] 求:如何读取raw文件中的数据

[复制链接]

新浪微博达人勋

发表于 2015-12-22 16:05:42 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 bing 于 2015-12-22 17:22 编辑

     求问:如何读取'MST2-IR1.raw'中的ir,我是将下面的这段Fortran程序改的,
parameter (m=2750)
integer*1 ir(m,m)
dimension x(m,m),y(m,m)
integer*1 ir1(1100,600)
C read IR1 channel  and geolocation data ---------------      
        open(1,file='MST2-IR1.raw',form='binary')
        read(1) ir
        close(1)
  open(1,file='Mtsat_IJ_LL.dat',form='binary')
  read(1) x,y
  close(1)
m文件程序内容:
% aera
% MST2-IR1.raw from MATLAB "ir1.m"
% Mtsat_IJ_LL.dat: Longitude and Latitude data (2750,2750)
char  m = [1,1:2750];
int (sym('ir(m,m)'));
char  [x(m,m),y(m,n)];
  int (sym('ir1(1100,600)'));
%read IR1 channel  and geolocation data ---------------      
        fid=fopen('MST2-IR1.raw','wb');
        data=rawread('MST2-IR1.raw','ir');
        fclose(fid);

  dat=fopen('Mtsat_IJ_LL.dat','w');
  data2=dlmread('Mtsat_IJ_LL.dat','x','y');
  fclose(dat);        
%--------------------------------------------------------
%interpolate to 0.1x0.1 degree grids +++++++++++++++
for j1=1:m
    for i1=1:m
   if (x(i1,j1)>=70)&&(x(i1,j1)<=180)&&(y(i1,j1)<=60)&&(y(i1,j1)>=0)
           i=(x(i1,j1)-70)*10+1;
           j=(60-y(i1,j1))*10+1;
           ir1(i,j)=ir(i1,j1);
      end
    end
end
        一直没运行正确,想知道如何正确读取'MST2-IR1.raw'中的ir,求提示
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-12-22 21:35:09 | 显示全部楼层
已解决,感谢~
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-1-4 16:35:20 | 显示全部楼层
楼主是怎么解决的,求解惑
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表