Fanning Example Programs
The following is a listing of the entire contents of this library for IDL.
Click on an individual procedure name to view its header and
source code. This listing
is a shortened form of the much longer
entire library help file. This may be handy for
text searchs, be beware that some of these are huge and may take a long
time to load or even crash your browser.
Last modified: Thu Dec 21 21:18:56 2000.
List of Routines
- ALLDIR This function returns the names of all the directories rooted at the "target" directory. The function is specific for the Windows operating system. The return names are given with respect to the target name.
- ASPECT This function calculates and returns the normalized position coordinates necessary to put a plot with a specified aspect ratio into the currently active graphics window. It works on the display output window as well as in a PostScript output window.
- BEST_BINARY Returns the binary representation of a number of any numerical type.
- BETTER_BINARY This function returns the binary representation of byte, integer, and long integer numbers. ; What kind of number is this?
- BINARY This function returns the binary representation of byte, integer, and long integer numbers. ; What kind of number is this?
- CHGCOLOR The purpose of this routine is to allow the user to change the color at a particular color index. The user is able to mix their own color by manipulating red, green, and blue sliders. This routine is ideal for changing axes or background colors of a plot, for example. The routine works on 8-bit, 16-bit, and 24-bit displays.
- CINDEX colortable with their index numbers overlayed on each color.
- COLOR24 The purpose of this function is to convert a RGB color triple into the equivalent 24-big long integer.
- COLORBAR The purpose of this routine is to add a color bar to the current graphics window.
- COLORBAR__DEFINE The purpose of this routine is to implement a COLORBAR object class. The ColorBar is rendered in the direct graphics system.
- CONGRID Shrink or expand the size of an array by an arbitrary amount. This IDL procedure simulates the action of the VAX/VMS CONGRID/CONGRIDI function.
- COUNT_COLUMNS This utility routine is used to count the number of columns in an ASCII data file. It uses the first row. as the count example.
- COUNT_ROWS This utility routine is used to count the number of rows in an ASCII data file.
- COYOTELIST__DEFINE The purpose of this program is to implement a list that is linked in both the forward and backward directions. There is no restriction as to what can be stored in a linked list node. The linked list is implemented as an object.
- DATE Format an axis for showing dates.
- DISPLAY Very simple event handler. Get array, execute the "command".
- DRAWBOX This function draws a rubberband box in the window specified by the positional parameter (or the current graphics window, by default). The coordinates of the final box are returned by the function. Click in the graphics window and drag to draw the box. ; Catch possible errors here.
- DRAWBOX_WIDGET This is the event handler for the draw widget graphics window. ; Deal only with DOWN, UP, and MOTION events.
- DRAWLINE All program button events handled here.
- FILE_LINE This function finds the number of lines in an ASCII data file. It should be platform independent (well Windows and UNIX at least!).
- FILE_SIZE This function finds the number of bytes in an ASCII data file. It should be platform independent (well Windows and UNIX at least!).
- GETCOLOR The purpose of this function is to return the value of a "named" color. The result is a 1-by-3 vector containing the values of the color triple if the user specified a a particular color. Or it is a 5-by-3 array containing the color triples of all 5 supported color if no positional parameter is passed.
- GETIMAGE The purpose of this function is to allow the user to open either regular or XDR binary image files of two or three dimensions.
- GET_TAGS This is a function that recursively searches through a structure tree, finding ALL of the structure's field names. It returns a pointer to an array of pointers, each pointing to the names of structure fields.
- HCOLORBAR The purpose of this program is to create a horizontal colorbar object to be used in conjunction with other IDL 5 graphics objects.
- ICON_EX FUNCTION NAME: ICON_BUTTON This is a compound widget to put up a small button with an image on it. It is implemented as a draw widget, but acts like a button. The event structure that is returned is a WIDGET_BUTTON event structure for a SELECT event.
- INSIDE x - The x coordinate of the point. y - The y coordinate of the point. px - The x coordinates of the polygon. py - The y coordinates of the polygon. The return value of the function is 1 if the point is inside the polygon and 0 if it is outside the polygon.
- LINKEDLIST The purpose of this program is to implement a list that is linked in both the forward and backward directions. There is no restriction as to what can be stored in a linked list node. The linked list is implemented as an object.
- MAKEY Make simulated data. Useful for software development.
- MAKEZ Make simulated 2-d data. Useful for software development.
- NORMALIZE NORMALIZE This is a utility routine to calculate the scaling vector required to position a graphics primitive of specified range at a specific position in an arbitray coordinate system. The scaling vector is given as a two-element array like this: scalingVector = [translationFactor, scalingFactor]
- OBJECT_SHADE_SURF OBJECT_SHADE_SURF This program shows you the correct way to write an elevation-shaded surface in object graphics. This would be the equivalent of these direct graphics commands: Surface, data, Shades=BytScl(data) Shade_Surf, data, Shades=BytScl(data)
- OWINDOW The purpose of this program is to create an object window. I use it mostly when I am creating and testing object graphics programs, but it is also a nice template for larger object graphics programs. The window is resizeable and it destroys its objects when it is destroyed.
- PARSELINE This function accepts a string as an argument and returns an array which contains the numerical values in that string. It can handle space or comma delimited numerical values. It returns a value of -1 if non-numerical stuff is found in the line.
- POLARPLOT Device, Decomposed=0 ; Establish plot coordinates.
- POWER_SPECTRUM Display an image next to its power spectrum.
- PRINT_IT This program sends the contents of the specified window to the default printer. The current window is used if a window index number is not provided. This program was originally written by David Fanning using advice from RSI. It was extensively modified and improved by Armand J.L. Jongen and others on the IDL newsgroup.
- PROCESS The purpose of this routine is to demonstrate a simple image processing program that runs as a "color aware" application. The program works on 8-bit, 16-bit, and 24-bit displays. The image is displayed in a resizeable graphics window and the window contents can be saved as GIF or JPEG images. The application can "protect" its colors from other applications that change colors. The color protection is implemented via draw widget EXPOSE events or the Refresh Colors button in the menubar.
- PSWINDOW This function is used to calculate the size of a PostScript window that has the same aspect ratio (ratio of height to width) as the current display graphics window. It creates the largest possible PostScript output window with the desired aspect ratio. This assures that graphics output looks similar, if not identical, to PostScript output.
- PS_FORM PS_FORM This function displays a form the user can interactively manipulate to configure the PostScript device driver (PS) setup. The function returns a structure of keywords that can be sent directly to the DEVICE command via its _EXTRA keyword FANNING SOFTWARE CONSULTING
- READTAB READTAB Read any kind of ASCII-tables into floating point array Empty Lines or lines starting with ';','#' or '!' are ignored CATEGORY: Input/Output CALLING SEQUENCE:
- SCALE_VECTOR SCALE_VECTOR This is a utility routine to scale the points of a vector (or an array) into a given data range. The minimum value of the vector (or array) is set equal to the minimun data range. And the maximun value of the vector (or array) is set equal to the maximun data range.
- SELECT_OBJECTS The purpose of this program is to demonstrate how to select and move objects in an object graphics window. Once the objects appear in the window, use your mouse to select the objects and move them in the window. The window is resizeable.
- SLICE This is a routine to display a 3D data set and slice through it at arbitrary orthographic angles. The display window (when run with the GUI) is resizeable. The output can be sent either to the display, to a GUI, or to a PostScript printer (as true PostScript output, not a screen dump.) When run with the GUI, slices can be animated and displays can be saved and restored
- SMOOTH2 Do multiple smoothing. Gives near Gaussian smoothing.
- STR_SIZE STR_SIZE The purpose of this function is to return the proper character size to make a specified string a specifed width in a window. The width is specified in normalized coordinates. The function is extremely useful for sizing strings and labels in resizeable graphics windows.
- SURF_CLIP SURF_CLIP: clip a 2D Z array, and two matching 1D arrays for x and y. The function returns a 2D array that is truncated in x and y. XRANGE, YRANGE -> the range for x and y in data coordinates XCLIP, YCLIP -> return the truncated x and y arrays author: Martin Schultz, Harvard University (1998)
- TVIMAGE This purpose of TVIMAGE is to allow you to display an image on the display or in a PostScript file in a particular position. The position is specified by means of the POSITION keyword. In this respect, TVIMAGE works like other IDL graphics commands. Moreover, the TVIMAGE command works identically on the display and in a PostScript file. You don't have to worry about how to "size" the image in PostScript. The output on your display and in the PostScript file will be identical. The major advantage of TVIMAGE is that it can be used in a natural way with other IDL graphics commands in resizeable IDL graphics windows. TVIMAGE
- TYPE Finds the type class of a variable.
- UNDEFINE The purpose of this program is to delete or undefine an IDL program variable from within an IDL program or at the IDL command line. It is a more powerful DELVAR.
- VCOLORBAR The purpose of this program is to create a vertical colorbar object to be used in conjunction with other IDL 5 graphics objects.
- WHERETOMULTI NAME: wheretomulti.pro FUNCTION: Convert WHERE output to 2d or 3d indices USAGE: WhereToMulti, Array, Indices, Col, Row, Frame INPUT ARGUMENTS: Array: the array that was WHERE'd Indices: the indices returned by WHERE
- WRITE_MPEG Write a sequence of images as an mpeg movie
- XCD Change current directory via mouse.
- XCOLORS The purpose of this routine is to interactively change color tables in a manner similar to XLOADCT. No common blocks are used so multiple copies of XCOLORS can be on the display at the same time (if each has a different TITLE). XCOLORS has the ability to notify a widget event handler or an object method if and when a new color table has been loaded. The event handler or object method is then responsibe for updating the program's display on 16- or 24-bit display systems.
- XCONTOUR The purpose of this program is to demonstrate how to create a contour plot with axes and a title in the new IDL 5 object graphics.
- XIMAGE The purpose of this program is to demonstrate how to create a image plot with axes and a title in the new IDL 5 object graphics.
- XMOVIE This program is a simplified version of XINTERANIMATE. It is written to illustrate the proper way to write an animation loop in a widget program using the WIDGET_TIMER functionality.
- XPLOT The purpose of this program is to demonstrate how to create a line plot with axes and a title in the new IDL 5 object graphics.
- XSTRETCH The purpose of this program is to interactively apply a simple linear stretch to an image by moving two lines on a histogram plot of the image. The portion of the image data between the two lines is stretched over the available colors in the color table.
- XSURFACE The purpose of this program is to demonstrate how to create a surface with axes and a title in the new IDL 5 object graphics.
- XWINDOW This routine implements a "smart" resizeable graphics window. It is used as a wrapper for built-in IDL graphics procedures such as SURFACE, CONTOUR, PLOT, SHADE_SURF, etc. In additon, it can be used to display any user-written graphics procedure so long as that procedure follows three simple rules: (1) It does not open it's own graphics windows, (2) It is defined with no more than three positional arguments (an unlimited number of keyword arguments are allowed), and (3) It is defined with an _EXTRA keyword.
- ZIMAGE The purpose of this program is to display an image which can be zoomed by drawing a rubberband box on top of it. The "zoomed" image appears in its own window.