[gradsusr] opening text file data

Jennifer Adams jma at cola.iges.org
Wed Feb 9 12:27:08 EST 2011


James,
Before GrADS can handle your data, you need to convert it from text to  
binary. Try something like this:

'open dummy.ctl'
file=7hA01.out.txt
nlinesinfile=755
i=1
'set gxout fwrite'
'set fwrite 7hA01.out.bin'
while (i<=nlinesinfile)
  res = read(file)
  line2=sublin(res,2)
  val = subwrd(line2,2)
  'd 'val
  i=i+1
endwhile
'disable fwrite'

...dummy.ctl looks like this:

dset foo
options template
undef -9.99e8
xdef 1 linear 1 1
ydef 1 linear 1 1
zdef 1 linear 1 1
tdef 755 linear 0Z01JAN1948 1mo
vars 1
foo 0 99 foo
endvars

... and your new GrADS data set looks like this:

dset ^7hA01.out.bin
undef -9.99e8
xdef 1 linear 1 1
ydef 1 linear 1 1
zdef 1 linear 1 1
tdef 755 linear 0Z01JAN1948 1mo
vars 1
var 0 99 var
endvars


--Jennifer



On Feb 7, 2011, at 10:48 AM, James Ciarlo` wrote:

> Hi,
>
> I have several text files such as the one I attached and I need to  
> open them which GrADS but I cannot understand how to do so. Can  
> someone help me please?
>
> James
> <7hA01.out.txt>_______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110209/226c3b40/attachment-0003.html 


More information about the gradsusr mailing list