APPENDIX
Analysis scripting

Analysis scripting is slightly different from scheduler scripting. While scheduler scripts are designed to accomplish tasks in Digital Atmosphere such as accessing data, displaying fronts, and so forth, the analysis script language is based solidly on logic and mathematics, and is meant to build display products in a very flexible manner. (Note that you can run any analysis script command in a schedule script by using the ANALYZE command.)

A script is made up of a group of commands on one line. There are two ways of executing a script:

(1) On the command line (in the Toolbox under the Scripting tab).

(2) In the DIGATMOS.MNU file, which is used to build the Analysis dropdown menu. This may be edited by hand. The pipe, |, symbol is used to separate the title from the script form and may be placed anywhere between the two providing it is padded with spaces only. The Standard version is limited to 50 defined script commands; the Professional version is unlimited.

 

Command sentences

A sentence of analysis script code follows the strict order:

[output] [transform] [base] [setup]

(1) Digital Atmosphere processes the script from RIGHT TO LEFT , so that any optional setup is done (such as setting the level), then defining the base field to be worked on (such as temperature), then transforming (such as converting m/s to kts), then producing output (such as setting a contour interval and then displaying contours. Deviation from this form may cause unpredictable results.

(2) Users must be vigilant as to whether a scalar or vector field is being processed. For example, CONT WIND will result in a nonsensical output, because wind is a vector field and cannot be contoured (you can streamline it, but that command hasn't been provided yet). To view wind speed, you will need to extract a magnitude by using CONT WSPD (contour windspeed) or using a vector-to-magnitude function (which has not been provided yet).

(3) The active level is always taken from the Active Level setting on the toolbar. It can be overridden using a Setup command. The same is true for data Time settings.

(4) Multiple fields are handled by using the output form to write a field to a slot, such as STOR=5 to store the result in slot 5. Various transformations which depend on a field number, such as SDIF (scalar difference), are supplied with two field slots with which to read.

(5) Commands can be strung together to produce multiple fields. Currently there is a limit of 255 characters to a script command.

(6) Suggestions for transformation commands, output commands, operators, and so forth are greatly welcomed at this time. Much more is planned; this is only a start! For an idea of what is possible see the PCGRIDDS documentation at http://www.lib.noaa.gov/pcgridds/appendix.html#C

(7) Scripts are not case-sensitive.

 

Examples

CONT CINT=4 SLPR
Explanation: Take the sea level pressure field. Set the contour interval to 4. Now contour it. Note that the color is not set, so the result color is unpredictable. Also the level is not set, so if the current height setting is 500 mb, an invalid fieldwill result.

DATA VKNT WSPD
Explanation: Take the wind speed field (which will be in m/s). Convert it to knots. Now view it as a numerical grid.

CONT CINT=60 DASH COLOR=200,0,0 SDIF=1,2 STOR=2 HGHT H000 STOR=1 HGHT H500
Explanation: Take the 500 mb height field. Store it in slot 1. Take the 1000 mb height field. Store it in slot 2. Compute a difference between field 1 and2.Nowsetthepencolorto200,0,0(lightred,i.e.red=200,green=0,blue=0. Set lines to dashed, and set a contour interval of60. Nowcontour theresult. This produces the1000-500 mb thickness.

For other examples please open the DIGATMOS.MNU file and study the examples provided. They drive the Analysis dropdown menu.

 

Summary of commands

SETUP

HSFC Set level to surface
H000 Set level to 1000 mb
H925 Set level to 925 mb
H850 Set level to 850 mb
H700 Set level to 700 mb
H500 Set level to 500 mb
H400 Set level to 400 mb
H300 Set level to 300 mb
H250 Set level to 250 mb
H200 Set level to 200 mb
H150 Set level to 150 mb
H100 Set level to 100 mb

Analysis method: if not specified, setting in Preferences > Analysis will be used
ANLN Sets analysis method to Nearest Neighbor
ANLW Sets analysis method to Weighted
ANLC Sets analysis method to Cressman
ANLB Sets analysis method to Barnes

BASE FIELDS

TEMP Temperature (deg C)
THTA Theta, or potential temperature (deg K)
DWPT Dewpoint (deg C)
RELH Relative humidity (%)
BULB Wet bulb temperature (deg C)
MIXR Mixing ratio (g/kg)
HIDX Heat index (deg F)
HGHT Geopotential height (m)
GHGT Geostrophically balanced height field (m)
THTE Theta-e, or equivalent potential temperature (deg K)
PTEN Reported pressure tendency
WCHL Wind chill (deg F)
HIDX Heat index (deg F)
HUMX Humidex (deg C)
WSPD Wind, speed (m/s)
WIND Wind, vector (m/s) (referenced to true north)
WDRC Wind, direction (deg)
UGRD Wind, west-to-east component (m/s) (referenced to true north)
VGRD Wind, south-to-north component (m/s) (referenced to true north)
HGHT Geopotential height (m)
SLPR Sea level pressure (QFF) (mb)
ALST Altimeter setting (QNH) (in Hg)
PRES Pressure (mb) (used for upper-level heights)
LATT Latitude (deg)
LONG Longitude (deg)
ELEV Elevation (m)
TSEA Temperature, sea-surface (deg C)
PC01 Precipitation (1 hr)
PC02 Precipitation (2 hr)
PC03 Precipitation (3 hr)
PC06 Precipitation (6 hr)
PC09 Precipitation (9 hr)
PC12 Precipitation (12 hr)
PC15 Precipitation (15 hr)
PC18 Precipitation (18 hr)
PC24 Precipitation (24 hr)
PCXX Precipitation (unknown time period; used in Australian AXF data)
WSWP Wave period (sec)
WSWH Wave height (m)
WWWP Wind wave period (sec)
WWWH Wind wave height (m)
WLP1 Sea swell period 1 (sec)
WLP2 Sea swell period 2 (sec)
WLH1 Sea swell height 1 (m)
WLH2 Sea swell height 2 (m)
WLD1 Sea swell direction 1 (screen relative)
WLD2 Sea swell direction 2 (screen relative)

TRANSFORMATIONS

VKNT m/s to kt
VMPH m/s to mph
VKMH m/s to km/h
DEGF deg C to deg F
MAGN Magnitude of a vector field (produces speed for a wind field)
DVRG Divergence of a vector field
RVRT Relative vorticity of a vector field (pure; used mainly at surface)
AVRT Absolute vorticity of a vector field (adds Earth's rotation; used for upper air)
SMTH Apply Haltiner smoother
SMTP=[number] Allow this number of smoothing passes (default 1)
SMTC=[number] Set smoothing coefficient (0 to 1 only) (default 0.5)
SSUM=[f1,f2] Calculates sum of fields f1 and f2
SDIF=[f1,f2] Calculates difference of fields f1 and f2
SAVG=[f1,f2] Calculates average of fields f1 and f2
SMLT=[f1,f2] Calculates product of fields f1 and f2
SDVD=[f1,f2] Calculates quotient of fields f1 and f2
SADC=[f1,#] Calculates sum of field f1 and any number #
SSBC=[f1,#] Calculates difference of field f1 and any number #
SMLC=[f1,#] Calculates product of field f1 and any number #
SDVC=[f1,#] Calculates quotient of field f1 and any number #

OUTPUT

* UNIVERSAL OUTPUT COMMANDS

COLOR=r,g,bSetdrawcolortocolorr=red,g=green,b=blue (each is 0-255)
STOR= nStorefieldin slot n (1-9)

* SCALAR OUTPUT COMMANDS

DATA Data grid values
CONT Contour (defaults to contour interval of 1)

VAON Allow plotting of numeric values below minimum/maximum (default)
VAOF Prohibit plotting of numeric values below minimum/maximum
NMCY Plot highs and lows in special NMC font (default is according to Preferences > Analysis)
NMCN Plot highs and lows in standard font (default is according to Preferences > Analysis)
HILO Plots H or L above data at gridpoint maximum/minimum
HIID Plots H above data at gridpoint maximum
LOWD Plots L above data at gridpoint minimum
MXMN Plots H or L above data at gridpoint maximum/minimum
MAXD Plots H above data at gridpoint maximum
MIND Plots L above data at gridpoint minimum
DVCV Plots H or L above data at gridpoint maximum/minimum
DVVD Plots H above data at gridpoint maximum
CVVD Plots L above data at gridpoint minimum
PLMN Plots H or L above data at gridpoint maximum/minimum
PLLD Plots H above data at gridpoint maximum
MNND Plots L above data at gridpoint minimum

OVER Overlay basemap translucently (good for fills)
CINT=[number] Contour interval (must be an nonzero positive number)
GRTN=[number] Contours or fills greater than this number
LSTN=[number] Contours or fills less than this number
EQUA=[number] Plot a contour equal to this number
LINE=[number] Set line width (must be nonzero positive integer)
FILL Fill using fill color
SOLD Plot contours as solid line
DASH Plot contours as dashes
DOTS Plot contours as dots
DADO Plot contours as dash-dot
DADD Plot contours as dash-dot-dot
FILL Perform a floodfill
FILS=[number] Set fillstyle to one of the following (must appear to right of FILL command):  0, Solid (default); 1, Cross; 2, Diagonal cross; 3, Diagonal 1; 4, Diagonal 2; 5, Horizontal stripes; 6, Vertical stripes

* VECTOR OUTPUT COMMANDS

BARB Wind barbs (m/s)
BKNT Wind barbs (m/s shown as kt)
BMPH Wind barbs (m/s shown as mph)
BKMH Wind barbs (m/s shown as km/h)
VECT Vector grid
STRM Streamline