爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 13639|回复: 14

[求助] 如何将dat文件转成nc文件?

[复制链接]

新浪微博达人勋

发表于 2012-7-5 09:29:04 | 显示全部楼层 |阅读模式

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

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

x
下面给出的是dat文件的ctl:
dset ^wrfout_d02.dat                          
undef 1.e35
pdef 312 285 lcc  39.511  121.599    1.000    1.000  60.  30.  126.500   3000.   3000.
xdef 1098 linear  119.9   0.01351351
ydef  748 linear   38.4   0.01351351
zdef    7 levels  
1000.00000
  925.00000
  850.00000
  700.00000
  500.00000
  300.00000
  200.00000
tdef        85 linear 12z04jul2012  1hr
vars   27
UMET             7 0 U Compoment of wind - rotated (diagnostic)        
VMET             7 0 V Component of wind - rotated (diagnostic)        
W                7 0 W Component of wind                              
THETA            7 0 Theta                                             
TK               7 0 Temperature in K                                 
Z                7 0 Height (m)                                       
QVAPOR           7 0 Vapor (kg/kg)                                    
TD               7 0 Dewpoint Temperature in C (diagnostic)            
RH               7 0 Relative Humidity (diagnostic)                    
RAINC           0  0 ACCUMULATED TOTAL CUMULUS PRECIPITATION           
RAINNC          0  0 ACCUMULATED TOTAL GRID SCALE PRECIPITATION        
slvl            0  0 sea level pressure                                
T2              0  0 TEMP at 2 M                                       
U10M            0  0 U at 10 M - rotated                              
V10M            0  0 V at 10 M - rotated                              
XLAT            0  0 LATITUDE, SOUTH IS NEGATIVE                       
XLONG           0  0 LONGITUDE, WEST IS NEGATIVE                       
PSFC            0  0 SURFACE PRESSURE(PA)                              
RH2             0  0 Relative humidity(%) at 2m (diagnostic)           
TD2             0  0 Dewpoint temperature(K) at 2m (diagnostic)        
T2MAX           0  0 Maximum temperature(K) at 2m (diagnostic)         
T2MIN           0  0 Minimum temperature(K) at 2m (diagnostic)         
HIGHCLD         0  0 High cloud fraction[%] (diagnostic)               
MIDCLD          0  0 Middle cloud fraction[%] (diagnostic)            
LOWCLD          0  0 Low cloud fraction[%] (diagnostic)               
TOTCLD          0  0 Total cloud fraction[%] (diagnostic)              
VIS             0  0 Visibility in km (diagnostic)                     
endvars
想把该文件转换成nc格式或micaps格式,请高手指点。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-7-5 10:40:16 | 显示全部楼层
这个用matlab可以转吧,但是具体怎么做的不太清楚啊,坐等高手
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-7-5 10:55:20 | 显示全部楼层
我也想学学
密码修改失败请联系微信:mofangbao

新浪微博达人勋

0
早起挑战累计收入
发表于 2012-7-5 11:20:06 | 显示全部楼层
micaps的好办点,转成四类格点数据就行了,每层一个文件。你需要看一下四类数据的格式说明,在micaps的帮助手册里面。转换中如果有具体问题再讨论了,你先试试看
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-7-5 14:54:31 | 显示全部楼层
用NCL应该会比较方便些
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-7-5 15:08:54 | 显示全部楼层
本帖最后由 hzwjy 于 2012-7-5 15:09 编辑

据NCL网站介绍:

The Climate Data Operators (CDO) can convert GrADS binary file to netCDF
The following CDO command will convert a binary data file to netCDF:

   cdo -f nc import_binary file.ctl ofile.nc

The import_binary operator imports gridded binary data sets via a GrADS data descriptor file. The GrADS data descriptor file contains a complete description of the binary data as well as instructions on where to find the data and how to read it.

不过我也没用过。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-8 11:01:12 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-12-11 17:24:28 | 显示全部楼层
良辰 发表于 2012-7-8 11:01
谢谢,ncl一点不懂呀

楼主这个问题解决了么?我要做的事情和你一模一样,请问楼主是怎么解决的,能不能指导我一下呢?万分感谢。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-12-11 17:26:31 | 显示全部楼层
半个瞎子 发表于 2013-12-11 17:24
楼主这个问题解决了么?我要做的事情和你一模一样,请问楼主是怎么解决的,能不能指导我一下呢?万分感谢 ...

我用 cdo 转,结果提示Open Error:  Unknown keyword in description file
  --> The invalid description file record is:
  --> pdef  359 299 lcc  37.000  102.000  180.000  150.000  60.00000  30.00000  102.00000  15000.000  15000.000
  The data file was not opened.
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-7-7 12:36:50 | 显示全部楼层
hzwjy 发表于 2012-7-5 15:08
据NCL网站介绍:

The Climate Data Operators (CDO) can convert GrADS binary file to netCDF

回复好赞 解决了我现在遇到的问题 多谢
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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