grads输出文件

#将GrADS读取的数据写到ASCII文件(txt等)

(引用由sunny2008在 2008/01/10 10:13am 发表的内容)

使用到了'set gxout print' 将产生的ASCII变量输出到缓存,并用临时变量temp存储起来,接着使用write函数把临时 变量写到ASCII文件

file="out.txt"

'set gxout print'

*'set prnopts %f 10 1'

'd U10m'

rc=write(file,result,append)

资源二:

file='*.txt' 

'set gxout print' 

'set prnopts *' 

'd var' 

'a=write(file,result) '

资源三:

set prnopts 

set prnopts format numl numb  

Controls the way values are printed when set gxout print is used. 

format   a C language template for formatting ascii output. Default is %g. 

numl     number of values to print per record. Default is 8. 

numb     number of blanks to insert between values. Default is 1. 

u        print 'Undef' instead of the numerical value for missing data. 

Usage Notes 

The first line of the ascii output will tell the user how many data values are being printed as well as the missing data value. 

Examples 

This example will print all the values in exponential notation: 

set gxout print 

set prnopts %10.3e 5 1 

d t 

The output might look like this: 

Printing Grid -- 30 Values -- Undef = -2.56e+33 

-2.560e+33 -2.560e+33  3.014e+02  3.011e+02  3.001e+02 

-2.560e+33 -2.560e+33  3.010e+02 -2.560e+33 -2.560e+33 

-2.560e+33 -2.560e+33 -2.560e+33 -2.560e+33 -2.560e+33 

-2.560e+33 -2.560e+33 -2.560e+33  2.993e+02  2.995e+02 

-2.560e+33 -2.560e+33  3.004e+02  3.008e+02  3.010e+02 

-2.560e+33 -2.560e+33  2.999e+02  3.010e+02  3.012e+02 

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Introduction What is Bowtie 2? Bowtie 2 is an ultrafast a...
    wzz阅读 5,816评论 0 5
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,936评论 0 0
  • 水墨丹青天上画,知了蛙声争仲夏。 静坐楼台听风语,携我云端采晚霞。
    风中的白杨阅读 494评论 0 1