Where shall we go with scripting?

This is the place to get help with Digital Atmosphere, suggest improvements, and get tips.
Post Reply
Tim Vasquez
Administrator
Posts: 534
Joined: Sat Nov 22, 2003 10:47 pm

Where shall we go with scripting?

Post by Tim Vasquez »

We are about to enhance the scripting of Digital Atmosphere so that it is possible to combine fields, do true custom analyses, and so on. The idea is to use scripting to form a flexible foundation for Digital Atmosphere, and thus the menu commands (Contour > Temperature, etc) would not drive the program but would simply feed the command line interpreter with a hardcoded command (all behind the scenes of course, for the beginners).

For example, to display an ageostrophic wind we might do: VECT(WIND-GWIND) where DA would subtract the geostrophic wind from the true wind, and the resulting field would be displayed in a vector format. Or to do wind barbs we could do BARB(WIND-GWIND). The user would also be able to create his/her favorite commands and put them into the Contour menu, or a script menu. To do a pressure analysis with a line thickness of 2 we could do CONT(SLP) LINE(2). The question is what is the optimum format to use for such a command?

I had considered the PCGRIDDS script style but decided it was a bit awkward (it strictly reads from right to left). However it is a good start and I think I will draw on some of the conventions it uses. In fact I may begin that way and then make improvements from there. For those interested, the syntax is shown at http://www.lib.noaa.gov/pcgridds/appendix.html in Appendix B.

Anyone here have experience with AWIPS? It would be interesting to see what meteorological scripting conventions it uses (that is, if it has any).

Tim
jrader
Member
Posts: 24
Joined: Mon Nov 24, 2003 8:40 pm

scripting

Post by jrader »

I like the idea to make scripting a driving force. I'm not sure what would be gained in going to a new syntax as far as weather chart products go. Perhaps what is gained is a new granularity of control. Perhaps even some wx chart products previously not producable via the old syntax is part of the goal. Or even a combination of both.

Being that weather is more of a hobby I'm learning, my suggestions are more on the practical and usability side. Thngs I would susgest are things like the following:

* external triggers via tcp ports, pipes, ipc/signals, files and file contents.
* capability to make use of or call external programs, scripts and batch files within DAW scripts, which would be great in your linux version but useful as well in the windows version.
* enhanced file handling/manipulation (just in cause format changes like the ASUS1 -> ASUS01 change happen again)
Mike Deason
Junior Member
Posts: 9
Joined: Wed Nov 26, 2003 12:10 am
Location: Grand Island, NE

Post by Mike Deason »

Actually, I think the PCGRIDDS command mode would be a good base to start with Tim, contingent on reversing it from right to left. For the most part I find the PCGRIDDS command pretty intuitive. For instance, being able to compute one hour field changes by using a TDIF command with the RUC fields would, for me at least, be a nice leap ahead in how I would use DAWS. The PCGRIDDS commands are all pretty much 4 alphanumeric characters and I believe most users would easily grasp their use even without experience using PCGRIDDS.

Maybe you could incorporate an editable menu item (similar to the internet retrieval module) in which a person could program, store and call up their own custom scripts.

Regards,

Mike
Tim Vasquez
Administrator
Posts: 534
Joined: Sat Nov 22, 2003 10:47 pm

Post by Tim Vasquez »

Work on this scripting has been ongoing much of today. It is very much being based on PCGRIDDS (which, I agree, is rather intuitive even though it seems a bit awkward). Here is the type of form that is taking shape.

To plot a simple temperature map in deg C, you would enter
CONT TEMP

A much more elaborate example contours temperatures above 32F every 1F, using dotted lines, and also shows the actual gridded values.
DATA CONT DOTS GRTN=32 CINT=1 DEGF TEMP

Showing temperatures at another level you could do
CONT CINT=5 TEMP H850

Transformation of values will be supported, too... for example to show a grid of winds in km/h you would do:
BARB VKMH WIND
Or to make your own conversion constant you could do:
BARB MULT=1.58324 WIND

Likewise you can do thickness by a scalar field subtraction
CONT CINT=60 SDIF(HGHT H500)(HGHT H000)

Multiparameter forms such as divergence will have this form:
DVRG(WIND)
DVRG(WIND,MIXR) (extra parameter produces a flux value)

I've decided not to support the complexities of formula-style constructs until I have a better idea of where all this is heading.

All of this actually works inhouse and will be released this weekend as a patch. The dropdown Contour selections will drive the scripts using predetermined forms (transparent to beginners).

Tim
Post Reply