LIBRARIES_NCDF_PUT
Name
NCDF_PUT
Purpose
Write given data to a NetCDF file.
Category
Calling Sequence
ncdf_put, file
Inputs
file = Name of NetCDF file to write or add to. in
Keyword Parameters
Keywords
GATT=gatt Global attributes in a hash or structure.
Attributes must be scalars or 1-D arrays (no text arrays).
VARIABLES=var Data variables in a hash or structure.
/NEW Start a new NetCDF file if file exists.
ERROR=err Error flag, 0=ok.
ERR_TXT=err_txt Error text.
/DETAILS gives details of inputs to this routine:
ncdf_put,/details
/VERBOSE list processing steps.
Outputs
Common Blocks
Notes
Notes: a fairly simple call can be used with this routine.
gatt = {lon:'27.2 W', lat:'13.1 N', hgt:'3.8 km'}
var = {azi:'283.4 deg',alt:'-8.9 deg',fl:'300 mm', $
img:bytarr(640,480),time:systime()}
ncdf_put,'image.nc',var=var,gatt=gatt
Check the created file:
ncdf_list,'image.nc',/gatt,/var
Read in the data:
ncdf_get,'image.nc',['AZI','ALT','IMG','FL','TIME'],gatt=gg,s,/struct
See the details using /DETAILS if dimensions or attributes
are needed. In this case the setup will be more complex
and will involve nested hashes or structures.
Modification History
R. Sterner, 2012 Jan 03
R. Sterner, 2012 Jun 22 --- Changing from structures to hashes.
R. Sterner, 2012 Jun 25 --- Renamed from netcdf_write.pro.
R. Sterner, 2012 Jun 26 --- Got working.
R. Sterner, 2012 Jun 27 --- Handled text strings.
R. Sterner, 2012 Aug 07 --- Allowed structures or hashes as inputs.
R. Sterner, 2013 Jan 14 --- Forced structure keys to lower case.
R. Sterner, 2013 Jan 14 --- Fixed case of existing file with no dims.
R. Sterner, 2013 Mar 08 --- Fixed typo in /details text.
R. Sterner, 2013 Mar 18 --- Automatically add 1st dim of text array.
R. Sterner, 2013 Mar 19 --- Text arrays can have any dimensions now.
Copyright (C) 2012, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.