general/CDF/obsolete/
makecdf.pro
PROCEDURE: makecdf, datavary, datanovary=datanovary, filename=filename, status=status, $ gattributes=gattr, vattributes=vattr, tagsvary=tagsvary, $ tagsnovary=tagsnovary, overwrite=overwrite PURPOSE: Creates a CDF file given an array of structures KEYWORDS: filename: Name of file to be created. datanovary: a structure containing the time invariant data to be written to CDF (like array descriptors). tagsvary: array of strings that will be used as the CDF variable names for the values stored in the datavary structure. Default CDF variable names are the names of the tags of the datavary structure. Note that, since IDL internally capitalizes all variable and tag names, the CDF variable names will be all caps in the default, so the tagsvary keyword should generally be used to control capitalization of the CDF variable names. tagsnovary: array of strings that will be used as the CDF variable names for the values stored in the datanovary structure. Default CDF variable names are the names of the tags of the datanovary structure. Note that, since IDL internally capitalizes all variable and tag names, the CDF variable names will be all caps in the default, so the tagsnovary keyword should generally be used to control capitalization of the CDF variable names. gattributes: a structure specifying the names, entry numbers, and values of the global CDF attributes that will be written to the CDF file. The tagnames of the gattributes structure are actually dummy placeholders which are not used (but must all be unique, or course). The value of each field is a struture containing three fields, 'name', which contains the name of the attribute, 'entry', which contains the entry number (many attributes contain just a single entry, generally just entry 0, and some contain several entries, generally entries 0,1,2,3, etc), and 'value' which contains the value of the attribute for the specified entry. (see the example below) vattributes: a structure specifying, for each CDF variable that has variable attributes, the names and values of the variable CDF attributes that will be written to the CDF file. The tagnames of the vattributes structure are actually dummy placeholders and are not used. The values of the fields of the vattributes structure should each be a structure, with a 'varname' field containing the name of a CDF variable, and an 'attrlist' field which contains a structure containing the set of attribute names and values for the specified variable. (see the example below) overwrite: if set, overwrite any existing CDF file with the specified name (default is to not overwrite any such existing file). status: status is 0 on successful return, nonzero on unsuccessful return. A routine that calls makecdf should in general use the status keyword parameter and verify that the CDF write has completed successfully. INPUT: datavary: an array of structures containing the time variant data to be written to CDF. Each element of the array is a structure containing the values for one time. Datavary must have a tag named 'time' that contains the time in seconds since 01-01-1970/00:00:00 UT. An additional CDF variable named 'Epoch', of type CDF_EPOCH, will be written to the CDF, and will be computed from 'time'. EXAMPLE: To make a CDF file named 'foo.cdf' containing tplot variables 'el_0' and 'el_high', and with two global attributes, named 'foo' (with one entry with value 'bar') and 'goo' (with two entries, one with value 1.0, and one with value 2.0), and with two variable attributes, 'VALIDMIN' and 'VALIDMAX', with VALIDMIN for el_0 to be set to 1.0, and VALIDMAX of el_0 to be set to 2.0, and VALIDMIN of el_high to be set to 1.0 and VALIDMAX of el_high to be set to 2.0, give the following IDL commands: > make_cdf_structs, ['el_0', 'el_high'], datavary, datanovary > gattr = {foo0: {name:'foo', entry:0, value:'bar'}, $ goo0: {name:'goo', entry:0, value:1.0 }, $ goo1: {name:'goo', entry:1, value:2.0 }} > vattr_el_0 = {VALIDMIN:1.0, VALIDMAX:2.0} > vattr_el_high = {VALIDMIN:1.0, VALIDMAX:2.0} > vattr = {el_0: {varname:'el_0', attrlist:vattr_el_0}, $ el_high: {varname:'el_high', attrlist:vattr_el_high}} > makecdf, file='foo', datavary, datanovary=datanovary, $ tagsvary=['time', 'el_0', 'el_high'], tagsnovary=['el_0_en', 'el_high_pa'], $ gattr=gattr, vattr=vattr Note that, in the above specification of vattr, the names of the CDF variables (el_0 and el_high in this example), appear to be repeated in two places each. The first occurrence of each, in the tagname, is actually just an unused dummy, and the second occurrence of each, in the string value of varname, is the CDF variable name. This is because IDL variable names and tag names can't be used to specify the more general strings that CDF variable names can have. Similarly with gattr. The resulting CDF file will contain an Epoch variable (computed from the time), a time variable (taken by default from the 'x' component of the first named tplot variable, but specifiable otherwise by the 'times' keyword to 'make_cdf_structs'), and, for each tplot variable named in the argument list to 'make_cdf_structs', the 'y' component, with a name taken from 'tagsvary', and the 'v' component, with a name taken from 'tagsnovary'. Thus the CDF file from the above commands will contain the CDF variables Epoch: This is of type CDF_EPOCH, and is calculated from the time variable below time: by default, the 'x' tag from the tplot variable 'el_0' el_0: the 'y' tag from the tplot variable 'el_0' el_high: the 'y' tag from the tplot variable 'el_high' el_0_en: the 'v' tag from the tplot variable 'el_0' el_high_pa: the 'v' tag from the tplot variable 'el_high' SEE ALSO: "loadcdf", "loadcdfstr" "make_cdf_structs.pro", "strarr_to_arrstr.pro" VERSION: @(#)makecdf.pro 1.6 08/13/98
Routines
top source makecdf
makecdf, datavary, datanovary=datanovary, filename=filename, status=status, tagsvary=tagsvary, tagsnovary=tagsnovary, overwrite=overwrite, gattributes=gattributes, vattributes=vattributes
Parameters
- datavary
Keywords
- datanovary
- filename
- status
- overwrite
- gattributes
- vattributes
File attributes
Modification date: | Thu Feb 13 16:43:50 2014 |
Lines: | 122 |