爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6849|回复: 5

批量读取一个文件夹里的二进制文件出错,求大神帮忙看看!!!

[复制链接]

新浪微博达人勋

发表于 2020-8-3 18:31:45 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 RDSHQEASUIAYRIW 于 2020-8-3 22:17 编辑

刚接触ncl很多都不太会想要批量读取一个文件夹里的所有二进制文件,一直报错
这是我写的命令:
ncl 0> diri = "/usr/bin/2020/"
ncl 1> filenames = systemfunc("ls " + diri + "PRCP_CU_GAUGE_V1.0GLB_0.50deg.lnx*                                                                                                                ")
ncl 2> setfileoption("bin", "ReadByteOrder", "LittleEndian")
ncl 3> ps = fbindirread (filenames, 0, (/213,360,720/), "float")
fatal:Number of elements of dimension (0) of argument (0) is (213) in function (                                                                                                                fbindirread), expected (1) elements
fatal:["Execute.c":8635]:Execute: Error occurred at or near line 3


这是数据的ctl文件
dset E:\ZILIAO\2020\PRCP_CU_GAUGE_V1.0GLB_0.50deg.lnx.%y4%m2%d2.RT
options  little_endian template
title global daily analysis (grid box mean, the grid shown is the center of the grid box)
undef -999.0
xdef 720 linear    0.25 0.50
ydef 360  linear -89.75 0.50
zdef 1 linear 1 1
tdef 213 linear 01jan2020 1dy
vars 2
rain     1  00 the grid analysis (0.1mm/day)
gnum     1  00 the number of stn
ENDVARS

求指点呀!

PRCP_CU_GAUGE_V1.0GLB_0.50deg.lnx.20200731.RT

1.98 MB, 下载次数: 0, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2020-8-3 20:18:22 | 显示全部楼层
没人么
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 成长值: 0
发表于 2020-8-3 22:02:45 | 显示全部楼层
你也没发数据呀
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-8-3 22:18:42 | 显示全部楼层
kermit 发表于 2020-8-3 22:02
你也没发数据呀

文件太大了,只上传了一天的数据,可以帮忙看看吗?是2020年1月-7月每天的逐日降水资料
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-8-4 08:37:30 | 显示全部楼层
你确定第一维是时间维?ncl处理数据的方式与grads不同,尤其各自默认的时间维不一样。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-12-7 22:00:19 | 显示全部楼层
楼主 你的问题解决了没?我要读取2m气温,也遇到了同样的问题,求帮忙
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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