GrADS output to textfile?
Stephen R McMillan
smcmillan at PLANALYTICS.COM
Wed Jan 7 01:35:23 EST 2009
Teddy,
The fwrite command produces binary, not text output. To produce ascii
text output of what you're currently displaying, use 'set gxout print'.
You control the output with 'set prnopts....' Display your data, then
write to file using the write command. Here's a simple example (assuming
file is open and appropriately dimensioned):
'set gxout print'
'set prnopts %0.1f 10 1'
'd air-273.16'
dummy=write('c:/temp/output.txt',result)
Your output might look something like this:
Printing Grid -- 77 Values -- Undef = 32766
11.1 10.7 8.4 9.0 12.9 15.4 16.3 17.1 17.5 17.5
17.6 8.3 8.6 7.0 6.3 8.2 10.3 11.7 12.4 13.0
13.8 13.9 7.0 7.8 6.8 4.2 3.1 4.7 7.0 7.9
-2.2 0.1 2.4 3.2 3.5 0.8 0.2 -2.3 -4.3 -4.7
You could also output one grid value at a time without using 'set gxout
print' and 'set prnopts.' The opengrads cookbook listing you referenced
goes into more detail on the above and alternate methods. Additional
references:
set gxout print: http://grads.iges.org/grads/gadoc/gradcomdsetgxout.html
set prnopts: http://grads.iges.org/grads/gadoc/gradcomdsetprnopts.html
write command: http://grads.iges.org/grads/gadoc/script.html#intrinsic
Stephen McMillan
Teddy Allen <teddyallen at YAHOO.COM>
Sent by: GRADSUSR at LIST.CINECA.IT
01/06/2009 05:36 PM
Please respond to
teddyallen at yahoo.com
To
GRADSUSR at LIST.CINECA.IT
cc
Subject
GrADS output to textfile?
Dear GrADS users,
I have seen traces of information leading to the creation of .txt files
from GrADS output generated from NetCDF files. Unfortunately, I am having
a bit of trouble trying to accomplish this. One method says to:
'set gxout fwrite'
'set fwrite file.txt'
'd [variable]'
'disable fwrite'
While another points to a script from the cookbook:
http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file
I also try :
set gxout fwrite
d [variable]
disable fwrite
GrADS then sends an output to my hard-drive, but it is not in an ascii
.txt format.
Does anybody have a simple method to produce text output files from GrADS?
I am not having any success in the above options. I am using GrADS 2.0 on
a windows XP system.
Thank you very much.
Sincerely,
teddy
web: http://personal.ecu.edu/tla0923/HOME.html
"To move quickly, go alone. To move far, go together."
African
Proverb
*
***************************************************
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary. If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
***************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090107/db67d703/attachment.html
More information about the gradsusr
mailing list