IDL_HS Command Line & Scripting
Historically IDL_HS began life as a command-line tool for
the simple reason that at the time that it was first conceived, IDL
did not have widgets and many users did not have access to workstations
that supported windows and widgets anyway. After a few years, the
command-line interface became sufficiently large that nobody could
actually remember all the settings without a crib-sheet of some kind.
By this time support for widgets was becoming much more widespread
and so the familiar version 3 widget interface was developed. The
version 3 interface was in effect an additional layer which wrapped
the command-line procedures--effectively acting as a crib-sheet.
With the advent of version 4 the widget interface is integrated into
the object-oriented structure of the environment. In principle it
would be possible to do all the necessary operations that might need
to be done from the command-line (or a user program) using the low-level
object methods, however few users are familiar with IDL objects and
the syntax is not really convenient for interactive use or for quick
scripting. Because of this, a basic command-line interface/scripting
system has been written for IDL_HS version 4; this is essentially
a set of wrappers for the various setting methods.
Unlike the version 3 command-line routines, those in version 4 do
not support interactive operation, however they all have a HELP
keyword which runs DOC_LIBRARY (or XDL if widgets
are present) for the routine.
Generally speaking, when a routine is not applicable, it will generate
an error message and return without doing anything, for example if
you were to call a PAD dataset specific routine when the current dataset
is a rate dataset..
In the listings that follow, the routines and their purpose are listed;
to get more details either use the reference manual or use the help
keyword on the routine itself. Almost all of the routines in the command
line interface are procedures rather than functions. The exceptions
to this are generally routines that allow access to the object-oriented
core of the environment (e.g. get_current_ds which returns
the object reference of the current dataset) and they are generally
intended to be used by the procedures. In the lists that follow, functions
are given in italics.
The top-level CLI routines are those that operate on the overall environment.
Technically, they interface to the hs_container methods of the core.
- Start up a browser to examine the contents of an HSIO
- Select a new current dataset. The current dataset
is the one on which all dataset operations are performed.
- Delete a dataset from the environment.
- Return the object reference of the master
- Return the object reference of the
- Return the object reference of the plot-device
- Start the help system.
- Start up the widget interface.
- Generate a quick list of the datasets present in the
- Add a new dataset to the environment.
- Delete the current environment and create a new
- Replace the current environment with a previously
- Save the whole environment to an IDL save file.
The IDS routines allow you to change the settings of the various Instrument
Definition Files which are used to specify energy ranges, geometry
- Get information from the LAN rates IDF file.
- Set the IDF file for ``ordinary'' LAN rates
- Get the data search path for an IDF definition.
- Get information from the MFSA IDF files.
- Set the IDF file for MFSA data
- Remove a directory from a search path.
- Set the search paths for the various data classes.
- Get information from the track IDF data.
- Set the track map version for Track and PHA matrix
- Add a new UDS data type.
- Remove an instrument fromt eh list of
defined UDS instruments.
- Get information from the UDS IDF files.
- Rescan for new SPEC files.
- Get information from the ULEIS IDF files.
All the dataset routines operate on the current dataset. Not all routines
are applicable to all type of dataset. In general if you attempt to
use a routine on an inappropriate type of dataset or without a current
dataset selected, then a message will be generated and nothing will
be done. The HELP output includes the types of dataset to
which the routine is applicable.
- Set flare classes for activity plots
- Set CMP plotting for activity plots
- Get the data from an activity plot.
- Control plotting of headers on activity plots.
- Set up histograms on activity plots
- Control plotting of unlocated flares in activity
- Set symbol size for activity plots.
- Set rotation system for activity plots.
- Add a dataset-specfic plot control.
- Add a stream to the current dataset.
- Set the averaging interval for a dataset
- Set whether to subtract backgrounds
- Select colour table for matrix and dynamic spectrum
- Return information about the current dataset.
- Delete a panel from the current dataset
- Delete a stream from the current dataset.
- Display the dataset.
- Apply an edit to the current dataset.
- Set layout for dynamic spectrum datasets
- Set the scaling for a dynamic spectrum dataset
- Start the data editor. This needs widgets to be available.
- Set whether to display error bars
- Set whether to plot fluxes of count rates
- Return the plot control object for the
- List the type of stream supported by the current
- Return the data from a matrix dataset.
- Set whether to add a plot header for matrix datasets
- Delete a histogram from a matrix dataset.
- Display a histogram of a matrix dataset.
- Create a new histogram in a matrix dataset.
- Mark positions and give information about them.
- Select maps to display on matrix datasets
- Set scaling options for matrix datasets
- Set summing option for matrix datasets
- Set the view region of a matrix dataset
- Move a panel in the current dataset.
- Move a stream in the current dataset
- Select axis for PAD datasets
- Return the data from a PAD dataset.
- Control last-sector hiding for PAD datasets.
- Set joining option for pad datasets
- Set layout for pad datasets
- Set coordinates for look plots
- Set spacing between plots in PAD dataset
- Return the data from a rate dataset.
- Set the level of mismatch to tolerate in overplotted
- Set layout for rate datasets
- Set trace offsets in rate datasets
- Set the scaling for a rate dataset
- Save the dataset to an IDL save file.
- Set the default sectoring for a dataset
- Select the archive type for LAN rates data
- Select whether to work in MeV or keV.
- Set the name of the dataset
- Set the time range of the dataset
- Show details of the current dataset
- Return the data from a spect dataset.
- Set the joining option of a spect dataset
- Set the layout of a spect dataset.
- Set the scaling of a spect dataset
- Write the dataset to an ascii file.
- Set the highest P channel from which to exclude the Sun
These routines set various options for the plot device. The keywords
control whether this is the global or the dataset control set.
- Mark positions and display information about them.
- Set the character size to use.
- Close (and spool) a plot.
- Set the colours for the various traces
- Return various information about the plot state.
- Open the plotting system.
- Set various PostScript options
- Set the directory in which to put the PostScript files
- Set the command(s) for spooling PostScript files
- Set the plot device.
- Set the size of the page or window for the plot
- Add the current plot transforms to the stack.
- Set the thickness of the lines to use.
- Set various X-window system options.
- Set the part of the page or window to use.
The stream routines act on individual streams of the current dataset.
The stream is specified by a 1-based stream index. For spect and PAD
datasets the index is a 2-element array giving the panel number and
the the position of the stream in the panel.
Not all types of stream support all the operations; neither Matrix
nor activity plot datasets support stream operations as they have
but a single stream.
- Return the data from a single stream of
a dynamic spectrum dataset.
- Calculate spectral index streams
- Return the reference of the selected stream.
- Return the data from a single stream of a PAD dataset
- Compute derived rate streams.
- Return the data from a single stream of a rate
- Compute sector difference streams.
- Compute sector ratio streams.
- Compute derived spectral streams
- Return the data from a single stream of a spect
- Set the background copunt rates for a stream
- Hide/unhide a stream.
- Return various items of information about a stream.
- Set a mnemonic name for a stream
- Set the sectoring for a stream
- Set the y-axis scaling for a stream
These routines allow the manipulation of markers.
- Add a marker to the current dataset
- Delete a marker from the current dataset
- Hide or show a marker in the current dataset
- Modify the properties of a marker.
In addition to the command-line interface outlined above, the rc_maker
and uds_wizard configuration tools are designed to be run
from the IDL> prompt.
This is a short example code to show the use of the command line interface.
It makes a rate dataset that has the ``de1'' electron channels
from both HISCALE and EPAM. It displays the and then makes the data
arrays available to the main program.
; This is a demonstration of the scripting capabilities of
; IDL_HS version 4.3
new_dataset, /rate, name='Scripting demo'
add_stream, 'hiscale', 'de1'
add_stream, 'epam', 'de1'
average, 6, /hours
help, rates, times