10. CDF.ct

Contents of this section

This section describes functions from file CDF.ct.

10.1 EPOCHbreakdown

[year,month,day,hour,minute,second,msec] = EPOCHbreakdown(epoch)
 [year,month,day,hour,minute,second,msec] = EPOCHbreakdown(epoch)
   breaks down the epoch value (number of milliseconds since
   01-Jan-0000 00:00:00.000) into year (4-digit), month (1-12), day (1-31),
   minute (0-59), second (0-59) and millisecond (0-999) values (integers).
   The argument must be a real scalar or array.
See also: computeEPOCH , parseEPOCH , encodeEPOCH .
   Error codes:
   -1: Argument not real scalar or array

10.2 computeEPOCH

[epoch] = computeEPOCH(year,month,day,hour,minute,second,msec)
 computeEPOCH(year,month,day,hour,minute,second,msec)
   returns the number of milliseconds since 01-Jan-0000 00:00:00.000
   as a real number.
   The arguments must be integer scalars or arrays.
   The arrays must be of the same sizes, but a mixture of arrays and
   scalars is allowed. The result is array if any of the inputs is.
   If an illegal component is detected the result(ing component) will
   be -1.0.
See also: EPOCHbreakdown , parseEPOCH , encodeEPOCH .
   Error codes:
   -1: Argument not integer
   -2: Arguments of incompatible dimensions

10.3 encodeEPOCH

[s] = encodeEPOCH(epoch)
 encodeEPOCH(epoch) returns the character string
   encoding of the given epoch value (number of milliseconds
   since 01-Jan-0000 00:00:00.000) as dd-mmm-yyyy hh:mm:ss:ccc.
See also: parseEPOCH , computeEPOCH , EPOCHbreakdown .
   Error codes:
   -1: Argument not a real scalar

10.4 export_CDF

[] = export_CDF(fn...)
 export_CDF("fyle"[,flags][,"varables"]...) writes the named global
   variables in CDF file "fyle.cdf". The arguments after the file name
   must be either strings (global variable names) or integer scalars giving
   optional flags.
   export_CDF("fyle"[,flags]) writes all global variables.
   Integer arrays are written using 1-byte or 2-byte if possible.
   Strings and chars are written as CDF_CHAR type if in range -127..127.

   Supported symbolic flags (to combine, use addition):
     CDF_FLOAT    Write reals using 4 bytes
     CDF_DOUBLE   Write reals using 8 bytes (the default)
     CDF_RECORD   Turn first dimension to 'record dimension'
     CDF_NORECORD Do not (the default)
   For example:
     export_CDF("fyle.cdf",CDF_FLOAT+CDF_RECORD,"A",CDF_NORECORD,"B")
   stores global variables A and B using floats, if they are real arrays,
   and turning the first dimension of A into a record dimension.
   Thus the flags are effective for those variables that follow, unless
   turned off by other flags. The flags are not remembered between calls.
See also: import_CDF .
   Error codes:
   -1: First argument not a string
   -2: Fatal CDF library error
   -5: Rest of the args are not strings or int scalars

10.5 import_CDF

[] = import_CDF(fn...)
 import_CDF("fyle") reads the variables in CDF file "fyle.cdf"
   into Tela workspace. Notice that you can leave out the suffix .cdf.

   import_CDF("fyle","var1","var2",...) reads only variables with
   specified names.

   CDF 'record dimensions' are turned into the first dimension of the
   Tela arrays. Likewise, CDF 'number of elements', which is used for
   character strings, is turned into the last dimension. Thus you get
   all the data stored in the file in all cases.
   
   Limitations:
   - The row major/col major flag is ignored
See also: export_CDF .
   Error codes:
   1: Loading INT2/UINT2 CDF data, but this Tela kernel has sizeof(short int) != 2
   2: Loading INT4/UINT4 CDF data, but this Tela kernel has sizeof(int) != 4
   3: Loading FLOAT CDF data, but this Tela kernel has sizeof(float) != 4
   4: Loading DOUBLE CDF data, but this Tela kernel has sizeof(double) != 8
   5: Empty variable name in CDF file - ignoring
   -1: First argument not a string
   -2: Fatal CDF library error
   -3: Unsupported data type
   -4: Too high rank in CDF file for this Tela kernel
   -5: Function called with more than one argument and the rest are not all strings
   -10: Internal error

10.6 parseEPOCH

[epoch] = parseEPOCH(s)
 parseEPOCH(epochstring) parses an epoch string
   and returns the epoch value (number of milliseconds since
   01-Jan-0000 00:00:00.000). The epoch string must be of the
   form dd-mmm-yyyy hh:mm:ss.ccc where
     dd   is the day of month (1-31)
         mmm  is the month (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)
         yyyy is the year
         hh   is the hour (0-23)
     mm   is the minute (0-59)
         sec  is the second (0-59)
         ccc  is the millisecond (0-999)
   If an invalid string is given, -1.0 is returned.
See also: computeEPOCH , EPOCHbreakdown , encodeEPOCH .
   Error codes:
   -1: Argument not a string


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter