.\
cgdemodata.pro
Utilities
The purpose of this function is to read a selection of standard data sets that are found in the normal IDL distribution in the subdirectory $IDL_DIR/examples/data. At least 25 data sets are available in all categories of data. The user selects one of the possible data sets with the mouse. Several of the data sets simply create data used to illustrate graphics commands (numbers 1-3), and two of the data sets produce random data. Data set 17 produces a random vector of 101 elements. Data set 18 produces a 2D array of random values, suitable for display as a contour plot or image.
Examples
To load the world elevation data set:
image = cgDemoData(7)
Author information
- Author
FANNING SOFTWARE CONSULTING:
David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com
- Copyright
Copyright (c) 2011-2013, Fanning Software Consulting, Inc.
- History
Change History:
Written by: David W. Fanning, 5 March 1999. Added some additonal random data capability. 29 April 99. DWF Added IMAGES keyword. 31 March 2000. DWF. Fixed a problem with the CANCEL button. 25 Oct 2002. DWF. Added new JPEG, DICOM, TIFF, and PGN images. 30 Oct 2002. DWF. Modified old program units to work with IDL strict arrays. 29 June 2003. DWF Yikes! Somehow lost the event handler for the CANCEL button! Fixed. 1 Jan 2012. DWF. Added 2D Combined Gaussian data set. Renamed utility routines. 22 Jan 2013. DWF.
Routines
result = cgdemodata_smooth2(i, w [, /help])
Does multiple smoothing.
result = cgdemodata_makez(nx, ny, w [, /help] [, lastseed=lastseed] [, /periodic] [, seed=seed])
Make simulated 2-d data.
result = cgdemodata_makey(n, w [, seed=seed] [, lastseed=lastseed] [, /periodic] [, /help])
Make simulated data vector.
cgdemodata_gauss2d, nx, ny, x, y, fwhm [, array]
Creates a two-dimensions Gaussian data set.
cgDemoData_Cancel, event
This event handler responds to the CANCEL button.
result = cgDemoData_ReadData(number)
Reads the data set from its current location.
cgDemoData_EVENT, event
Reads the data set from its current location.
result = cgDemoData( [selection] [, /CANCEL] [, GROUP_LEADER=long] [, /IMAGES])
Select a dataset either interactively or by selection.
Routine details
top cgdemodata_smooth2
result = cgdemodata_smooth2(i, w [, /help])
Does multiple smoothing. A routine from the JHUAPL IDL Library.
Parameters
- i in required
The input array to be smoothed.
- w in required type=integer
The size of the smoothing window. Forced to be an odd integer.
Keywords
- help in optional type=boolean default=0
Set this keyword to print function syntax help.
top cgdemodata_makez
result = cgdemodata_makez(nx, ny, w [, /help] [, lastseed=lastseed] [, /periodic] [, seed=seed])
Make simulated 2-d data. A routine from the JHUAPL IDL Library.
Parameters
- nx in required
The X size of the data to be created.
- ny in required type=integer
The Y size of the data to be created.
- w in required type=integer
The smoothing window size.
Keywords
- help in optional type=boolean default=0
Set this keyword to print function syntax help.
- lastseed out optional
Returns the last random seed used.
- periodic in optional type=boolean default=0
Set this keyword to force the data to match at either end.
- seed in optional
Sets the random seed for repeatable results.
top cgdemodata_makey
result = cgdemodata_makey(n, w [, seed=seed] [, lastseed=lastseed] [, /periodic] [, /help])
Make simulated data vector. A routine from the JHUAPL IDL Library.
Parameters
- n in required
The size of the data vector to be created.
- w in required type=integer
The smoothing window size.
Keywords
- seed in optional
Sets the random seed for repeatable results.
- lastseed out optional
Returns the last random seed used.
- periodic in optional type=boolean default=0
Set this keyword to force the data to match at either end.
- help in optional type=boolean default=0
Set this keyword to print function syntax help.
top cgdemodata_gauss2d
cgdemodata_gauss2d, nx, ny, x, y, fwhm [, array]
Creates a two-dimensions Gaussian data set.
Parameters
- nx in required type=integer
The X size of the output array.
- ny in required type=integer
The Y size of the output array.
- x in required type=integer
The X location of the Gaussian in the array.
- y in required type=integer
The Y location of the Gaussian in the array.
- fwhm in required type=float
The full width at half-maximum of Gaussian.
- array out optional type=float
The output array containing the Gaussian.
top cgDemoData_Cancel
cgDemoData_Cancel, event
This event handler responds to the CANCEL button.
Parameters
- event in required type=structure
The event structure passed by the window manager from the CANCEL button.
top cgDemoData_ReadData
result = cgDemoData_ReadData(number)
Reads the data set from its current location.
Parameters
- number in required type=integer
The selection number.
top cgDemoData_EVENT
cgDemoData_EVENT, event
Reads the data set from its current location.
Parameters
- event in required type=structure
The event handler for the graphical user interface.
top cgDemoData
result = cgDemoData( [selection] [, /CANCEL] [, GROUP_LEADER=long] [, /IMAGES])
Select a dataset either interactively or by selection.
Parameters
- selection in optional type=integer
The data set selection number. If not present, a graphical user interface is presented to the user so that a data set may be selected.
Keywords
- CANCEL out optional type=boolean
If a graphical user interface is used for the data selection, this output keyword is set to 1 if the user clicks the CANCEL button. Otherwise, it is set to 0.
- GROUP_LEADER in optional type=long
The identifier of a widget group leader for this widget application. If the group leader dies, this program will die as well.
- IMAGES in optional type=boolean default=0
Set this keyword if you wish to see only 2D images in the selection widget.
File attributes
Modification date: | Fri Mar 27 11:07:37 2015 |
Lines: | 829 |
Docformat: | rst rst |