|
IDL Reference Guide: Procedures and Functions |
|
The HDF_BROWSER function presents a graphical user interface (GUI) that allows the user to view the contents of a Hierarchical Data Format (HDF), HDF-EOS, or NetCDF file, and prepare a template for the extraction of HDF data and metadata into IDL. The output template is an IDL structure that may be used when reading HDF files with the HDF_READ routine. If you have several HDF files of identical form, the returned template from HDF_BROWSER may be reused to extract data from these files with HDF_READ. If you do not need a multi-use template, you may call HDF_READ directly.
Template = HDF_BROWSER([Filename] [, CANCEL=variable] [, GROUP=widget_id] [, PREFIX=string])
Returns a template structure containing heap variable references, or 0 if no file was selected. The user is required to clean up the heap variable references when done with them.
A string containing the name of an HDF file to browse. If Filename is not specified, a dialog allows you to choose a file.
Set this keyword to a named variable that will contain the byte value 1 (one) if the user clicked the "Cancel" button or the byte value 0 (zero) otherwise.
Set this keyword to the widget ID of a widget that calls HDF_BROWSER. When this ID is specified, a death of the caller results in the death of the HDF_BROWSER. The following example demonstrates how to use the GROUP keyword to properly call HDF_BROWSER from within a widget application. To run this example, save the following code as browser_example.pro:
PRO BROWSER_EXAMPLE_EVENT,ev WIDGET_CONTROL,ev.id,GET_VALUE=val CASE val of 'Browser':BEGIN a=HDF_BROWSER(GROUP=ev.top) HELP,a,/st END 'Exit': WIDGET_CONTROL,ev.top,/DESTROY ENDCASE END PRO BROWSER_EXAMPLE a=WIDGET_BASE(/ROW) b=WIDGET_BUTTON(a,VALUE='Browser') c=WIDGET_BUTTON(a,VALUE='Exit') WIDGET_CONTROL,a,/REALIZE XMANAGER,'browser_example',a END
When HDF_BROWSER reviews the contents of an HDF file, it creates default output names for the various data elements. By default these default names begin with a prefix derived from the filename. Set this keyword to a string value to be used in place of the default prefix.
template = HDF_BROWSER('test.hdf')
output_structure = HDF_READ(TEMPLATE=template)
or,
output_structure = HDF_READ('test.hdf', TEMPLATE=template)
When you call the HDF_BROWSER function from the command line or using the Import HDF macro, the HDF Browser window is displayed.
Use the following steps when working with the HDF Browser dialog:
The result of these actions depends on the location from which you launched the HDF Browser dialog. The HDF_READ function, which reads data from a file according to the template specification, is automatically called when you access the HDF Browser dialog from the Import HDF macro. From the command line, you must explicitly read the HDF data with the template specification. After defining what data to access using the HDF Browser dialog, refer to the appropriate section:
IDL Online Help (March 06, 2007)