Re: Request for feedback: Command line options/arguments in NCL

From: Louis Wicker (Louis.Wicker AT XXXXXX)
Date: Fri Feb 20 2004 - 15:11:43 MST


Rick:

thanks for asking. I would have to say that NCL very much needs the
ability to input from the command line or stdin. I think that the
command line will
satisfy peoples needs very well.

Now, it appears to me that option #1 is a more general approach, and
would permit a very flexible framework for people to use.
"preassigning" flags
as in option 2 is then going to end having people constantly wanting to
add new flags. Or, if you provide placeholders, no relationship
between the placeholder name
and the actual thing it is needed for.

So I would go with #1.

my 2 cents.

Lou Wicker

On Feb 19, 2004, at 4:56 PM, Rick Grubin wrote:

> Dear NCL users,
>
> The NCL Development Team is considering introducing command line
> options
> and arguments into NCL. The Team would appreciate user input before
> any
> decisions are made.
>
> If you would find this functionality useful, please let us know how
> you would use it. Specific examples are welcome.
>
> Below are two possible methods for implementing command line options
> and arguments. Would either, or both, meet your needs? Other ideas
> are welcome.
>
> 1. Command line arguments are user defined, and consist of
> [name=value] pairs
>
> Example arguments and usage:
> mask=5
> smooth=True
>
> ncl mask=5 smooth=True myScript.ncl
>
> Within an NCL script, the method for retrieval of specified information
> from the command line might look something like:
>
> begin
> mask_val = get_ARGS("mask")
> make_smooth = get_ARGS("smooth")
> ...
> end
>
> A function like "get_ARGS()" is currently a placeholder function, to
> illustrate how accessing command line arguments might occur.
>
>
> 2. Command line options are pre-defined, and may take one of two
> forms:
> options with single dashes, or options with double dashes.
>
> Single dash:
> -option=value pairs, or simply -option
>
> Example options and usage:
> -f myData.nc
> -v T
> -r
>
> ncl -f myData.nc -v T -r myScript.ncl
>
> Double dash:
> --option=value pairs, or simply --option
>
> Example options and usage:
> --file=myData.nc
> --variable=T
> --version
>
> ncl --file=myData.nc --variable=T --version
> myScript.ncl
>
> For information provided via command line options, NCL code might look
> something like:
>
> begin
> datafile = get_ARGS("file") ; -f myData.nc or
> --file=myData.nc
> g = addfile(datafile, "r")
>
> tvar = get_ARGS("variable") ; -v T or --variable=T
> var_to_plot = g->$tvar$
> ...
> end
>
>
> Please note that the NCL script name to execute (if one is provided) is
> always the last argument on the command line, regardless of the method
> chosen
> for command line arguments/options. As well, the name of the NCL
> script
> to execute would be available to the user within that script.
>
> Thank you for your input!
>
> The NCL Development Team
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk AT ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
------------------------------------------------------------------------

----
|  Dr. Louis J. Wicker
|  Research Scientist, National Severe Storms Lab
| 1313 Halley Cir, Norman, OK 73069
| E-mail:   Louis.Wicker AT nssl.noaa.gov
| HTTP:  www.nssl.noaa.gov/~lwicker
| Phone:    (405) 366-0416
| Fax:       (405) 366-0472
|
|  "Every job is a self-portrait of the person who does it. Autograph  
your
|     work with excellence."  -Erik Erikson
|
------------------------------------------------------------------------ 
----

_______________________________________________ ncl-talk mailing list ncl-talk AT ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Feb 23 2004 - 08:34:13 MST