readme.txt ---------- The files in this folder are netCDF file procedures and examples for IDL. These files are provided by Tom Woods from LASP/University of Colorado. While written for the NASA TIMED SEE data products, they are also generic enough to use for most other netCDF files. The read_netCDF.pro is a generic reader of netCDF files that returns the data back into an IDL structure and attributes back into a string array. The write_netCDF.pro is a generic writer of netCDF files given an IDL structure variable. Optionally, netCDF file attributes can also be written if an external text file exists for that structure type or specified by the user. The following files are in this folder: example.att File used by write_netCDF.pro in writing "example" data example.ncdf NetCDF file of the "example" data example.sav XDR file of original "example" data example2.att File used by write_netCDF.pro in writing "example2" data example2.ncdf NetCDF file of the "example2" data example2.sav XDR file of original "example2" data read_netCDF.pro IDL procedure to read a netCDF file write_netCDF.pro IDL procedure to write a netCDF file Procedure Usages ---------------- read_netCDF, filename, data, attributes, status write_netCDF, data, filename, status, path=dir_path, att_file=att_filename, /clobber where filename = name of netCDF file data = structure variable attributes = string array of attributes read from netCDF file status = procedure completion status: 0 = OK, other numbers mean an error /path = optional directory path for the *.att file used by write_netCDF /att_file = optional attributes definition file name for write_netCDF (required to use if "data" does not have structure name) /clobber = option to clobber (delete) any old netCDF file with given "filename" Limitations ----------- The variables defined inside "data" structure can only have up to 4 dimensions and can only have nested structure definitions up to 4 levels. Example Usage ------------- The following is listing of commands in IDL to write a file and then to read it. IDL> restore, 'example.sav' ; restore "example" structure back into IDL IDL> write_netCDF, example, 'example.ncdf', status, /clobber ; re-write example.ncdf IDL> read_netCDF, 'example.ncdf', ex, ex_att, status ; read back example.ncdf IDL>help, example, ex, /struct ; to view data structures IDL> for k=0,n_elements(ex_att)-1 do print, ex_att[k] ; print attributes to screen Contact ------- Tom Woods E-mail: tom.woods@lasp.colorado.edu For more information, view the header comments in the *.pro and *.att files. ----------------- END of readme.txt