Scripting is a powerful function that allows Digital Atmosphere to do various tasks while unattended. You can have it download data every half hour and always have the latest map displayed, or send charts to the printer automatically. The possibilities are up to you.
To run a single script command
Simply type in the script command in the "command" line on the scripts toolbar. Hit return or click "Enter" and it will be processed. Note that this does not run a script; it just runs a script command. A list of commands is below.
To write a script
Use any text editor or click on Create Script on the scripts toolbar and you can begin typing your script. Note that scripts should use the file extension .dsf in order to be properly recognized in Digital Atmosphere. To "comment out" a line of code simply place a # (octothorpe), : (colon), or ; (semicolon) at the beginning of the line. Commands are generally not case-sensitive.
To run a script in run-time
Go to the scripts toolbar and select the Run Script button.
To run a script at startup
Advanced users can run scripts on Digital Atmosphere startup by using standard command-line parameters. A space and the full name of the script file is simply appended after the filename at the command prompt or in the shortcut property for Digital Atmosphere.
To use the scheduler
Go to the scripts toolbar and select the Scheduler button (it will say "Scheduler on..." or "Scheduler off..."). This will bring up a configuration window (see below) where the scheduler will coordinate which script files run at which time.
|Valid script commands|
|DATA DISPLAY COMMANDS|
Overlays a meteorological product on the map. The appropriate data must have already been imported. Valid type parameters are documented at the end of this section. Levels are specified as follows: for surface data, the level is 0 (zero); for millibar levels the level equals the millibar level (500, etc); and for FT height levels the level equals the ten-thousands and thousands digits multiplied by -1 (so 34,000 ft equals -34). The title parameter is optional and contains a text title that will be placed in the legend. Derived fields are not supported at this time.
Performs an analysis using an analysis script command. For information on building an analysis script command please see the Analysis section.
Forces workchart fonts to TrueType mode. Takes effect when new products or contours are displayed.
Forces workchart fonts to NCEP raster font mode. Takes effect when new products or contours are displayed.
Loads a particular surface plot model. Filename must be the fully qualified filename with path and extension (*.sps).
|DATA MANAGEMENT COMMANDS|
Downloads a product from an Internet source. The url is the fully qualified, RFC 1738 standard URL (including filename), and filename is the full local name where the file will be stored.
Uploads a product to an Internet source. The url is the fully qualified, RFC 1738 standard URL (including filename), and filename is the full local name of the file to be uploaded.
Note that you can set a
password privately by using the DIGATMOS.PWD file (if there isn't one, you may
create it). This will make your scripts secure and prevent passwords
from showing up in the status windows. This file must be located in the Digital
Atmosphere directory. Make entries as follows:
So if you have a login for your blog site, you might have something like this in your DIGATMOS.PWD file:
When Digital Atmosphere encounters %%something%% in your URL, it will replace it with the values you defined in DIGATMOS.PWD. Thus, in the example above %%myusername%% would get replaced with joeblow, and %%mypassword%% would get replaced with 12341234.
Imports the specified data file (filename is a fully qualified file name).
Retrieves the desired radar product from the given station. Station is a 3-letter station identifier (e.g. FWS, EWX, etc). Multiple stations are separated by one space character. Product is the Radar Product Code from the table below.
Plots the latest retrieved radar data.
Saves the latest retrieved radar data to a given filename.
Imports an imagemap radar, using parameters selected in Radar > Import Radar Images.
|DERIVED PRODUCT COMMANDS|
Imports hurricane bulletins.
Plots hurricane models. The type is as follows: 0, splines only; 1, splines and datapoints; 2, splines, datapoints, and labels.
Plots all fleetcode information.
Plots fleetcode bulletins with only highs and lows.
Plots fleetcode bulletins with only fronts.
Plots fleetcode bulletins with only isobars.
Loads a map. IMPORTANT: You must specify the .dmf file in your filename, e.g. c:\da20\bin\mymap.dmf . The associated map will also be loaded.
Saves a map. The filename parameter is the fully qualified filename without the extension (i.e. without .bmp).
Exports a map (i.e. saves it to a variety of formats and without the accompanying .atr file). The filename parameter is the fully qualified filename with a valid extension (may be bmp, gif, jpg, png, pcx, or tif). Compressed TIFF saving is not available.
Imports a map.
Plots a sounding for the given station.
Erases all of the overlays on the map.
Erases the overlays as well as the basemap.
Imprints a timestamp at the top of the map that says "GENERATED (date) (time)".
Copies the map to the clipboard.
Sets one of the File > Preferences > Misc > settings to a particular value. This allows the script to change a contour gradient scheme on the fly.
Sets a specified keyword (1 through 9) to a certain value. You can then use this keyword later on in the same script simply by placing the token $$x anywhere in the code, where x is the keywordnumber. This is useful for managing large scripts.
SET 1 500 Sets keyword 1 to "500"
PRODUCT $$1 HGT $$1 indicates "500", so here 500 mb heights are plotted
PRODUCT $$1 TMP $$1 indicates "500", so here 500 mb temperatures are plotted
Enables the script timer. It will adhere to the current timer script schedule.
Turns off the script timer.
Prints the map to the default printer using default settings.
Causes Digital Atmosphere to pause for the specified number of seconds. An hourglass cursor will be displayed during this time.
Executes an executable file or MS-DOS batch file specified by filename (must be a fully qualified filename with correct path; e.g. "c:\utilities\myprogram.exe").
The Digital Atmosphere application window is minimized.
The Digital Atmosphere application window is maximized.
The Digital Atmosphere application window is neither minimized nor maximized.
Quits the program
Makes a topographic underlay on the map (takes some time).
Plots the basemap.
Plots county outlines.
Plots county names
Plots Interstate highways (U.S. only).
Plots major roads (U.S. only).
Plots custom overlays.
Removes the last product from the display.
THESE COMMANDS ARE NOT SUPPORTED AS OF THIS BUILD
Makes a map with the chosen station in the center of the screen. Zoom is a value equal to 3964/x, where x is the width of the map in statute miles. Width and height are the map sizes in pixels.
|LIST OF VALID PRODUCT TYPES|
This script downloads synoptic data from Albany, imports it, displays plots and sea level pressure, and outputs it to a file. Note that this will probably not work on your computer without changes, and is only intended to demonstrate the appearance of script commands.
This script plots a series of upper air charts for 1200 UTC August 27, 1990 from our Upper Archives CD-ROM and saves the completed charts for 250 mb, 500 mb, 700 mb, and 850 mb to individual files (1990082712250.gif, etc). Again this may not work on your computer without some changes.