AVS Local Modules read netcdf U.S. Geological Survey Dec. 1992 NAME read netcdf - read a netCDF file that follows certain conventions SUMMARY Name read netcdf Version 2.0 Author Evelyn Wright (ew@orpheus.er.usgs.gov) Type data input Input none Output field scalar float {uniform or rectilinear} Parameters Name Type Default Min Max Read netCDF File browser *.cdf Data Variables string Var0 boolean off Var1 boolean off Var2 boolean off Var3 boolean off Var4 boolean off Var5 boolean off Var6 boolean off Var7 boolean off Dimensions string Dim0 boolean off Dim1 boolean off Dim2 boolean off Dim3 boolean off Dim4 boolean off Dim5 boolean off Dim6 boolean off Dim7 boolean off Activate Dimension Selections string OK boolean off Enable Reader boolean off Hyperslab Selections string Min0 integer 0 INT_UNBOUND INT_UNBOUND Max0 integer 0 INT_UNBOUND INT_UNBOUND Min1 integer 0 INT_UNBOUND INT_UNBOUND Max1 integer 0 INT_UNBOUND INT_UNBOUND Min2 integer 0 INT_UNBOUND INT_UNBOUND Max2 integer 0 INT_UNBOUND INT_UNBOUND Min3 integer 0 INT_UNBOUND INT_UNBOUND Max3 integer 0 INT_UNBOUND INT_UNBOUND Single Record Selections string Record0 integer 0 INT_UNBOUND INT_UNBOUND Record1 integer 0 INT_UNBOUND INT_UNBOUND Record2 integer 0 INT_UNBOUND INT_UNBOUND Record3 integer 0 INT_UNBOUND INT_UNBOUND Save Settings boolean off DESCRIPTION This module reads data from netCDF files into uniform or rectilinear AVS fields. The data variables must be of dimension 8 or less. Variables that are one-dimensional and have the same name as a dimension name are assumed to be coordinate variables. Coordinate variables, if present, define the coordinate values along each axis of the data space. A maximum of 8 data variables that are NOT coordinate variables may be present. The variables may be short, long, float, or double. They may have a scale factor and an offset stored as float attributes scale_factor and add_offset. The number of dimensions in the AVS output field is determined by the number of dimensions selected by the user; the maximum is 4. The output field will have the same number of coordinates as dimensions. If 1-D coordinate variables are present, the coordinate data for each user- selected dimension is read automatically; the AVS output field will be rectilinear. If no coordinate variables are present, the AVS output field will be uniform. This module allows the user to select a hyperslab of data to be read. OUTPUT The output data is a scalar float field that is uniform or rectilinear and has 1, 2, 3, or 4 dimensions (and the same number of coordinates). PARAMETERS Read netCDF File This is a file browser that displays filenames with the .cdf extension. The user selects the desired netCDF file. Data Variables This is the title for the next group of parameters. Var0 Var1 Var2 These boolean parameters display the names of the data variables Var3 found in the user-selected netCDF file. Only variables that Var4 are NOT coordinate variables are displayed. The user selects Var5 the desired variable to be read. Var6 Var7 Dimensions This is the title for the next group of parameters. Dim0 Dim1 Dim2 These boolean parameters display the names of the dimensions Dim3 of the user-selected data variable. The user selects 1, 2, 3, Dim4 or 4 of these dimensions. The number of selections determines Dim5 the number of dimensions of the AVS output field. Dim6 Dim7 Activate Dimension Selections This is the title for the next parameter. OK This boolean parameter is selected by the user to indicate completion of user-selection of the desired dimensions. Enable Reader This boolean parameter is selected by the user to indicate completion of user-selection of the desired hyperslab of data and to activate reading the selected data from the netCDF file. Hyperslab Selections This is the title for the next group of parameters. Min0 Max0 Min1 These integer type-in parameters display the name and the Max1 currently selected minimum and maximum index value of each Min2 user-selected dimension. The values determine the hyperslab Max2 of data to be read. Min3 Max3 Single Record Selections This is the title for the next group of parameters. Record0 Record1 These integer type-in parameters display the name and the Record2 currently selected index value of each dimension NOT user- Record3 selected. The values determine the hyperslab of data to be read. Save Settings This boolean parameter is selected by the user to enable saving the current dimension and hyperslab settings. This is useful when the user wishes to save and later restore the current AVS network. USAGE Begin by selecting a netCDF file name (only files with the extension .cdf are displayed by the file browser). The names of the data variables that are NOT coordinate variables are displayed on boolean buttons. Selections are made by clicking on them using the left mouse button. Selecting the desired variable displays the dimension names for that variable on boolean buttons. Up to 4 dimensions may be selected. The number of dimensions selected will be the number of dimensions of the AVS output field. Click on the OK button to display the hyperslab selections. If you change the dimension selections, click on the OK button again. This causes the hyperslab portion of the menu to be re-initialized. Two type-in integer parameters are displayed for each dimension selected. They are the minimum and maximum index values of the data to be read for that dimension. Also displayed are single index values of the data to be read for each dimension NOT selected. The user may modify these values. When the hyperslab of data is selected, click on Enable Reader. Select the Save Settings button to preserve the current dimension and hyperslab selections before saving the current AVS network. This allows all current "read netcdf" settings to be reinstated. Otherwise, only the file and variable name selections will be reinstated. EXAMPLE AVS NETWORK The following network converts netCDF data into an AVS field, displays the contents of the new field, and also writes the new AVS field to disk. READ NETCDF | |______________ | | | | PRINT FIELD WRITE FIELD ACKNOWLEDGEMENTS This module uses some of the ideas and code of a similar module written by Tim Scheitlin. SEE ALSO Unidata Program Center, 1991, NetCDF User's Guide: An Interface for Data Access, University Corporation for Atmospheric Research, Boulder, CO.