VCS Example: Saving CGM, netCDF, HDF, DRS, and Raster Files     


Description

VCS has the ability to save a display as a file in Computer Graphics Metafile (CGM) or raster format. Data attributes sets can be saved in: the Network Common Data Form (netCDF) format; the Hierarchical Data Format (HDF) format; and the PCMDI Data Retrieval and Storage (DRS) format. This example shows how to create CGM (with extension `.cgm'), raster (with extension `ras'), netCDF files (with extension `.nc'), HDF files (with extension `.hdf'), or DRS files (with extension `.dic' for dictionary, containing metadata). Note, CGM files also can be converted into Postscript--see the Example on Printing CGM Files. VCS creates Sun raster files that can be converted to other raster formats with the aid of imaging tools such as IMCONV (available from the San Diego Supercomputer Center). A netCDF, HDF, or DRS file can be converted to other file formats via the Data and Dimensions Interface (DDI).

Step 1: Displaying Data on the VCS Canvas

To create a CGM or raster file, a plot must be visible on the VCS Canvas. (See the Example on Quick Plotting Data or the Example on Creating Plots by Different Graphics Methods).

Step 2: Viewing the CGM, Raster, netCDF, HDF, and DRS Panels

Access the desired CGM, Raster, netCDF, HDF, or DRS Panel (via Main Menu: `File'-> `Save CGM'; `File'-> `Save Raster'; `File' -> `Save netCDF'; `File' -> `Save HDF'; or `File' -> `Save DRS').

Step 3: Changing the Directory

Change to the directory where the file is to be save by moving the pointer over the `Directory' input text window (see above figures) and clicking the left mouse button. Then enter the appropriate directory name press the `Enter' (or `Return) key on the keyboard--the `Sub_Dir' scroll window will change accordingly. (Note, the the C shell tilde '~ ' designation for the home directory is recognized by VCS.) The directory also can be changed by moving the pointer over the desired subdirectory in the `Sub_Dir' scroll window and clicking the left mouse button.

Step 4: Entering the Output File Name

Enter the chosen name for the CGM, Raster, netCDF, HDF, or DRS output file in the `Output File' text window (see above figures). This is done by moving the pointer over the `Output File' text window, clicking the left mouse button, and typing the desired output file name (e.g., `example') in the text window.

If there are files listed in the `.cgm Files', `.ras Files', 'netCDF Files', 'HDF Files', or `DRS Files' scroll window on the CGM, Raster, netCDF, HDF, or DRS Panels, respectively (see above figures) and a file is to be reused, then select the file name. This action will cause the selected file name to be displayed in the `Output File' text window.

Step 5: Entering the Data Attribute Set Name

(Note, this step is only required when using the netCDF Panel, HDF Panel, or DRS Panel.)

Move the pointer over the desired attribute set name in the red Data Panel (e.g., `psl (3D)') and click the middle mouse button. This action will copy the data attribute set name into the VCS copy buffer and will register the event in the Message Panel. Then move the pointer to the netCDF Panel's, HDF Panel's, or DRS Panel's red data input text window and click the middle mouse button again. This action will copy the data attribute set name (i.e., `psl') into the text input window.

Step 6: Changing the Output Mode

If desired, change the `Output Mode' menu button to either `Append' (the default setting) or `Replace'. `Append' mode adds the output to an existing file, while `Replace' mode overwrites an existing file with new output.

Step 7: Saving the Output File

Depending on the desired `Output Mode', select the green `Append' or the `Replace' button. This action will save the output to a file and cause the CGM, Raster, netCDF, HDF, or DRS Panel to disappear.

Step 8: Deleting an Output File

To delete a CGM, raster, netCDF, HDF, or DRS file, move the pointer over the file name in the output file scroll window and click the left mouse button . Then select the yellow `Delete File' button on the chosen panel (see above figures) with the left mouse button--a popup window will appear. Move the pointer over the `Delete' button and click the left mouse button--file deletion will be confirmed in the popup window.

See also Hints on the CGM Panel, on the Raster Panel, netCDF Panel, HDF Panel, and on the DRS Panel.



Last update December 17, 1996. For further information, contact: Dean N. Williams (vcs@pcmdi.llnl.gov)
This page is maintained by Anna McCravy (mccravy@pcmdi.llnl.gov)
 and LLNL Disclaimers

UCRL-MI-122789