CDF supports two distinct types of variables, rVariables and zVariables. IDL can create CDF files representing any data that can be stored in a zero- to eight-dimensional array. Information in a CDF file consists of attributes (metadata) and collections of data records (variables). CDF_ATTPUT, id, att2_id, time_id, 'GMT' FOR I= 0, 9 DO CDF_VARPUT, id, time_id, 8.+ 0.5 * I, rec_start=I temp_id = CDF_VARCREATE(id, 'Temp',, $ /REC_VARY, /ZVAR, DIMENSIONS=) long_id = CDF_VARCREATE(id, 'Longitude',, $ /REC_NOVARY) lat_id = CDF_VARCREATE(id, 'Latitude',, $ /REC_NOVARY) write 10 temperature records: CDF_VARPUT, id, temp_id, FINDGEN( 2, 3, 10), /ZVARIABLE create longitudes: CDF_VARPUT, id, long_id,, , ] create latitudes: CDF_VARPUT, id, lat_id,, ,] CDF_CLOSE, id Variables and Attributes id = CDF_CREATE( 'Temperature.cdf',, /CLOBBER ) att_id = CDF_ATTCREATE(id, 'Title', /GLOBAL) CDF_ATTPUT, id, att_id, 0, 'My Fancy CDF' att1_id = CDF_ATTCREATE(id, 'Planet', /GLOBAL) CDF_ATTPUT, id, 'Planet', 0, 'Mars' time_id = CDF_VARCREATE(id, 'Time',, $ /REC_VARY) att2_id = CDF_ATTCREATE(id, 'Time Standard', /VARIABLE_SCOPE) times are every half hour starting a 8 am GMT. The following example demonstrates the basic procedure for creating a CDF file.
Open cdf files in browser code#
For example, in this code snippet IDL converts the string “12” to a floating-point 12.0 before writing it: varid= CDF_VARCREATE(fileid, 'VarName',$ DIM=,/CDF_FLOAT) CDF_VARPUT, fileid, 'VarName', '12' Reference by variable ID Code Examples Values are converted to the appropriate type before being written to a CDF file. If the structure of the CDF file is already known, you do not need to call the inquiry routines-only CDF_OPEN, CDF_ATTGET, CDF_VARGET, and CDF_CLOSE are needed. Optionally, retrieve the names, scope, and other information about the CDF file's attributes. Retrieve the names, types, sizes, and other information about the variables in the CDF file. The following table lists the basic commands needed to read data from a CDF file: CDF_OPENĬall this function to find the general information about the contents of the CDF file.Ĭall this function to obtain further information about the CDF file Write the appropriate data to the CDF file. Optionally, use attributes to describe the data.
![open cdf files in browser open cdf files in browser](https://www.getmyos.com/upload/files/2018/10/18/windows_7_screenshot_3_1_c4638893dfc43ce5f0230f28d1b61d7b.png)
CDF_CREATE contains a number of keywords which affect the internal format of the new CDF file.ĭefine the variables to be used in the file. The following table lists the basic IDL commands needed to create a new CDF file:Ĭall this procedure to begin creating a new file. IDL’s CDF routines all begin with the prefix “CDF_”. CDF is a product of the National Space Science Data Center (NSSDC). The Common Data Format (CDF) is a file format that facilitates the storage and retrieval of multi-dimensional scientific data. Tip: For information on the current CDF version, enter the following at the IDL prompt: HELP, 'cdf', /DLM