## sdfopen

`sdfopen filename <template #timesteps>`

Opens a NetCDF or HDF-SDS format file that conforms to the COARDS conventions. The sdfopen command does not support the HDF5 format, but is does support netcdf4. The arguments and options are as follows:

`filename`

The name of the COARDS-compliant NetCDF or HDF-SDS file.

`template`

This optional argument is used when you want to aggregate multiple data files and handle them as if they were one individual file. The individual data files must be identical in all dimensions except time. `template` has a similar structure to the substitution template in a GrADS data descriptor file. See Using Templates for details.

`#timesteps`

This argument must be included whenever `template` is invoked. The `#timesteps` is the sum of the timestep counts in all the files to be examined, not the count in any one file.

### Usage Notes

1. The template option with sdfopen was removed in version 2.0. If you want to aggregate multiple files together use the xdfopen command with the 'options template" keyword and a complete TDEF entry.
2. Here's a brief summary of the metadata that sdfopen is looking for when it tries to open a self-describing file. As it goes through the list of dimension variables in the file, it checks each one for attributes named "units", "axis", and "grads_dim". Acceptable values for these attributes and the GrADS dimension the coordinate variable maps to are outlined in this table:

   GrADS Dimension | Acceptable Attribute Values
   X | units: degrees_east, degree_east, degrees_E, degree_E axis: x, X
   Y | unit: degrees_north, degree_north, degrees_N, degree_N axis: y, Y
   Z (pressure) | units: mb, millibar, hybrid_sigma_pressure
   Z (not pressure) | units: sigma_level, degreesk, degrees_k, level, layer, layers axis: z, Z
   T | units: yyyymmddhhmmss, yymmddhh, or a Udunits-acceptable time unit axis: t, T
   E | grads_dim: e axis: e, E

3. If the sdfopen command fails to open your self-describing file, try using the `xdfopen` command which requires a special descriptor file to supplement or override the metadata in the file, or use the open command with a complete descriptor file.

### Examples

1. If you had daily U-Wind data in two files, `uwnd.1989.nc` and `uwnd.1990.nc`, you could access them both as one GrADS data set by entering:

   `sdfopen /data/uwnd.1989.nc uwnd.%y4.nc 730`