[gradsusr] opening text file data

James Ciarlo` james.ciarlo at physics.org
Fri Feb 11 05:40:45 EST 2011


Hi,

sorry I took long to answer. Thank you all for your help

Jennifer, I have copied the first script you wrote into a script.gs, and the
second into a dummy.ctl
Then I opened grads and ran script.gs and got the following error:

Warning: OPTIONS keyword "template" is used, but the
   DSET entry contains no substitution templates.

Then I changed the contents of dummy.ctl to the third set and ran
script.gsand I obtained 7hA01.out.bin
However when I tried using open with grads I got the following error

ga-> open 7hA01.out.bin
Scanning description file:  7hA01.out.bin
Open Error:  Unknown keyword in description file
  --> The invalid description file record is:
  -->
o-ER`0Ej.Eá¦3E=E3;E;E5:E{7E¤ø1E\31Eá0Eáº+Eͼ+EÍL5E2E)<9Eu;Eׯ;Eq)<EH=EÉ2E
û9EìY1E¤¨2E-Eq¥/E\[6Ef6Eìq9Ef¦;E)ô=E
  The data file was not opened.

James


On 9 February 2011 18:27, Jennifer Adams <jma at cola.iges.org> wrote:

> 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
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110211/12f70b6f/attachment-0003.html 


More information about the gradsusr mailing list