[gradsusr] printim error due to variable in filename

Stephen McMillan smcmillan at planalytics.com
Sun Sep 4 11:51:07 EDT 2011


Hello Joe,

Your time query is introducing a space into the "day" variable.  PRINTIM
doesn't like spaces in the filename string.  Try this instead:
day=substr(result, 11, 9)

It should work with above change.

Stephen McMillan
On Sat, Sep 3, 2011 at 4:53 PM, Joe Moore <joe at wxjoe.com> wrote:

> Greetings!
>
> I'm just getting started with GrADS and I'm still a beginner, but I'm
> having a problem that I can't seem to resolve from reading the documentation
> and searching online, including the archives of this mailing list.
>
> Problem: When using a variable in the filename to save the output, I'm
> getting an error.
>
> Here's the relevant code:
>
> 'printim out/RTMA_TMP_'day'_'hr'.png'
>
> where I am defining the variable day and hour using the following:
> 'q time'
> hr=substr(result, 8, 2)
> day=substr(result, 11, 10)
>
> The result of which, when I print as a string or in the title, comes out to
> be 23 for the hour and 16AUG2011.
>
> Expect result: I should have a file output called RTMA_TMP_16AUG2011_23.png
>
> What actually is happening: The file output is just called
> RTMA_TMP_23AUG2011 (that's it- no .png) and when I run I get the following
> error: PRINTIM error: Invalid option; ignored
>
> I've been able to sometimes get this to work, like if I put a few
> characters (not including an underscore or period) in the output filename -
> but I can't figure it out. I'd like to use either underscores, dashes or
> periods to separate the variables in the output file name, and I've seen it
> done in example scripts I've found on the web.
>
> Configuration: I am running OpenGrADS 2.0.a9.oga.1 on Ubuntu 11.04. The
> data is coming from the RTMA grib2 from the NOAA NOMADS server. Here is my
> full grads config info:
> ga-> q config
> Config: v2.0.a9.oga.1 little-endian readline printim grib2 netcdf hdf4-sds
> hdf5 opendap-grids,stn athena geotiff shapefile
> Grid Analysis and Display System (GrADS) Version 2.0.a9.oga.1
> Copyright (c) 1988-2010 by Brian Doty and the
> Institute for Global Environment and Society (IGES)
> This program is distributed WITHOUT ANY WARRANTY
> See file COPYRIGHT for more information.
>
> Built Mon Oct  4 14:16:26 EDT 2010 for i686-pc-linux-gnu
>
> This version of GrADS has been configured with the following options:
>   o Built on a LITTLE ENDIAN machine
>   o Athena Widget GUI ENABLED
>   o Command line editing ENABLED
>       http://tiswww.case.edu/php/chet/readline/rltop.html
>   o printim command for image output ENABLED
>       http://www.zlib.net
>       http://www.libpng.org/pub/png/libpng.html
>       http://www.libgd.org/Main_Page
>   o GRIB2 interface ENABLED
>       http://www.ijg.org
>       http://www.ece.uvic.ca/~mdadams/jasper
>       http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2
>       g2clib-1.1.8
>   o NetCDF interface ENABLED
>       http://www.unidata.ucar.edu/software/netcdf
>       netcdf 4.1.1 of Jul 10 2010 23:36:25 $
>   o OPeNDAP gridded data interface ENABLED
>   o OPeNDAP station data interface ENABLED
>       http://iges.org/grads/gadoc/supplibs.html
>       libgadap 2.0.oga.1
>   o HDF4 and HDF5 interfaces ENABLED
>       http://hdfgroup.org
>       HDF 4.2r3
>       HDF5 1.8.4
>   o GeoTIFF and KML/TIFF output ENABLED
>       http://www.libtiff.org
>       http://geotiff.osgeo.org
>   o KML contour output ENABLED
>   o Shapefile interface ENABLED
>       http://shapelib.maptools.org
>
> For additional information please consult http://iges.org/grads
>
> Not sure if its needed, but here is also the code I am using:
> http://pastebin.com/hHuXR6ae (There's a few comments and irrelevant things
> as this has been my sandbox script to learn new things.)
>
> Thanks in advance for any and all assistance!
>
> -Joe Moore
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>

***************************************************
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/20110904/34f9cdf8/attachment-0003.html 


More information about the gradsusr mailing list