makeCDF

Allowed Time Formats

All ISTP CDF's must be time-ordered by the 'Epoch' variable. The CDF 'Epoch' is stored as an REAL*8 (as CDF_EPOCH) and is displayed as yyyy-mon-dd hh:mm:ss.ms. A new data type, an 8-byte integer (as CDF_TIME_TT2000), has been added to CDF since CDF V3.4.0 and is displayed as yyyy-mm-ddThh:mm:ss.mmmuuunnn.

makeCDF can compute the CDF 'Epoch' time from any of the following cases by identifying the algorithm from the list of 15 possible algorithms below. For each algorithm, there are 10 operands, numbered 0-9 below. The operands have the value 0 (zero) if not-applicable for the specified algorithm. Otherwise, the operands denote which variable (starting with 1) in the input data record contains the indicated value (with the exception of all operands in algorithm 5, operand 8 in algorithm 6, and operands 5, 6, 8 and 9 in algorithm 7 below). See examples by clicking on the individual formats in the first column.

For those formats that use a "base time", the complete time of any data point is the "base time" plus the offset time for that data point.

The year can be either two digits or four digits. If the year is less than 100, it will be changed into the corresponding year in the 1900's if the value is 57 or greater. If less than 57, the year will be in the 2000's.

Time values can be integer or real numbers. Ranges of certain time units are limited, as follows: hh < 24 (24 not allowed); minutes < 60; seconds < 60 for CDF_EPOCH, or seconds <= 60 for CDF_TIME_TT2000 (if leap second); and milliseconds < 1000; microseconds < 1000; and nanoseconds < 1000. However, in time formats where ddd is used as the day of the year, the minutes, seconds or milliseconds values can exceed these limits as needed.

The first ten (10) algorithms, Algorithm 0 to 9, are for CDF_EPOCH data type. Algorithms 10, 11, 12, 13 and 14 are added for CDF_TIME_TT2000 data type. The CDF_EPOCH, a double word, is in milliseconds since 0AD, and CDF_TIME_TT2000 (as TT2000 in short), an 8-byte integer, is in nanoseconds since 2000-01-01T12:00:00.000000000 (as J2000) with leap seconds included. The format for Algorithm 10 is similar to that of Algorithm 0, with extra fields for micro and nano-second. Algorithm 11 is similar to Algorithm 4, Algorithm 12 is similar to Algorithm 11, Algorithm 13 is similar to Algorithm 2, and Algorithm 14 is similar to Algorithm 3.


        Format of time         | Algorithms |            Operands
       in the data file        |            |
----------------------------------------------------------------------------------
A set of independent variables |     0      | 0:year, 1:month, 2:day, 3:hour,
(year, month, day, etc.)       |            | 4:min, 5:sec, 6:msec, 7-9:n/a
                               |            |Example: 1 0 3 0 0 0 4 0 0 0
                               |            |indicates that the 1st variable in
                               |            |the input data is the year, 3rd is
                               |            |the day, 4th is the msec.
----------------------------------------------------------------------------------
A character string             |     1      | 0:string_variable, 1-9:n/a
(dd-MON-yyyy hh:mm:ss.mmm)     |            |
Any punctuation mark may exist |            |
between the fields.            |            |
Not restricted to "-" or ":".  |            |
Only dd, MON, yyyy required;   |            |
other fields are assumed = 0   |            |
unless present.                |            |
----------------------------------------------------------------------------------
A character string             |     2      | 0:string_variable, 1-9:n/a
(yyyy-mm-ddThh:mm:ss.mmmZ)     |            | 
Any punctuation mark may exist |            |
between the fields.            |            |
Not restricted to "-" or ":".  |            |
Only yyyy, mm, dd required;    |            |
other fields are assumed = 0   |            |
unless present.                |            |
----------------------------------------------------------------------------------
A character string             |     3      | 0:string_variable, 1-9:n/a
(yyyy-ddd hh:mm:ss.mmmZ)       |            |
Any punctuation mark may exist |            |
between the fields.            |            |
Not restricted to "-" or ":".  |            |
Only yyyy, ddd required;       |            |
other fields are assumed = 0   |            |
unless present.                |            |
----------------------------------------------------------------------------------
A CDF 'Epoch'                  |     4      | 0:Epoch_variable, 1-9:n/a
----------------------------------------------------------------------------------
A variable which is the offset |     5      | 0:base_year, 1:base_month,
from some base time.           |            | 2:base_day, 3:base_hour,
The base time is specified     |            | 4:base_min, 5:base_sec,
directly in the operands.      |            | 6:base_msec, 7:offset_variable,
                               |            | 8:offset_units (0=y, 1=mo, 2=d,
                               |            |   3=h, 4=min, 5=s, 6=ms), 9:n/a
                               |            |Example: 1976 0 34 12 0 0 0 3 5 0
                               |            |indicates that the 3rd variable 
                               |            |of the input data is the time, in 
                               |            |seconds, after the base time of 
                               |            |Feb. 3, 1976 at 1200 UT.
                               |            |Equivalently, the operands could
                               |            |also be: 1976 2 3 12 0 0 0 3 5 0
----------------------------------------------------------------------------------
A variable which is the offset |     6      | 0:base_year, 1:base_month,
from some base time.           |            | 2:base_day, 3:base_hour,
The base time is given by      |            | 4:base_min, 5:base_sec,
the variables indicated by the |            | 6:base_msec, 7:offset_variable,
operands.                      |            | 8:offset_units (0=y, 1=mo, 2=d,
                               |            |   3=h, 4=min, 5=s, 6=ms), 9:n/a
----------------------------------------------------------------------------------
A variable which is the offset |     7      | 0-4:n/a
from some base time.           |            | 5:number of characters in "yr" format
The base time is embedded in   |            |   below in filename (either 2 or 4),
the input data filename in a   |            | 6:character number (starting with 1)
string of digits in the format |            |   of start of time string in filename,
denoted by operand 9 and maybe |            | 7:offset_variable,
modified by operand 5.         |            | 8:offset_units (0=y, 1=mo, 2=d, 
                               |            |   3=h, 4=min, 5=s, 6=ms),
                               |            | 9:time_format (0=yrmmdd, 1=yrmmddhh,
                               |            |   2=yrmmddhhmm, 3=(deleted; see 11), 
                               |            |   4=yrddd, 5=yrdddhh,
                               |            |   6=yrdddhhmm, 7=yrdddhhmmss,
                               |            |   8=(deleted; see 9), 
                               |            |   9=yrdddmsec (msec is 8 digits),
                               |            |   10=yrdddsec (sec is 5 digits),
                               |            |   11=yrmmddhhmmss, 12=yrmmddhhmmssms)
----------------------------------------------------------------------------------
Two independent variables,     |     8      | 0:year, 1:n/a=0, 2:DOY, 3-9:n/a=0
year and day-of-year (DOY),    |            |Example: 1 0 2 0 0 0 0 0 0 0
where DOY is given in days and |            |indicates that the 1st variable in the
fraction of day. DOY is a      |            |input data is the year, 2nd is the
double-precision variable.     |            |day-of-year, including the fraction.
                               |            |If DOY=3.5, time is 12:00 UT, Jan. 3.
----------------------------------------------------------------------------------
A set of independent variables |     9      | 0-1:n/a=0, 2:offset_day,
that give the time offset from |            | 3:offset_hour, 4:offset_min,
the base of January 1, 1950.   |            | 5:offset_sec, 6:offset_msec
The offset time variables are  |            | 7-9:n/a
indicated by the operands.     |            |Example: 0 0 0 0 0 0 1 0 0 0
Offset year and offset month   |            |indicates that the 1st variable
are not used, so the first two |            |of the input data is the time, in
operands (0: and 1:) are       |            |milli-seconds, since the beginning
always 0.                      |            |of Jan. 1, 1950.
                               |            |Offset_day=1 indicates Jan. 2, 1950.
----------------------------------------------------------------------------------
A set of independent variables |    10      | 0:year, 1:month, 2:day, 3:hour,
(year, month, day, etc.)       |            | 4:min, 5:sec, 6:msec, 7:usec,
This is for TT2000 data type.  |            | 8:nsec, 9:n/a
                               |            |Example: 1 0 3 0 0 0 4 0 0 0
                               |            |indicates that the 1st variable in
                               |            |the input data is the year, 3rd is
                               |            |the day, 4th is the msec.
----------------------------------------------------------------------------------
A CDF 'TT2000' value           |    11      | 0:TT2000_variable, 1-9:n/a
----------------------------------------------------------------------------------
A TT2000 character string      |    12      | 0:string_variable, 1-9:n/a
(dd-Mon-yyyy hh:mm:ss.mmmuuunnn|            |
). Any punctuation mark may    |            |
exist between the fields.      |            |
Not restricted to "-" or ":".  |            |
Only dd, Mon, yyyy required;   |            |
other fields are assumed = 0   |            |
unless present. mmmuuunnn is   |            |
millisecond, microsecond and   |            |
nanosecond.                    |            |
----------------------------------------------------------------------------------
A TT2000 character string      |    13      | 0:string_variable, 1-9:n/a
(yyyy-mm-ddThh:mm:ss.mmmuuunnn)|            | 
Any punctuation mark may exist |            |
between the fields.            |            |
Not restricted to "-" or ":".  |            |
Only yyyy, mm, dd required;    |            |
other fields are assumed = 0   |            |
unless present. mmmuuunnn is   |            |
millisecond, microsecond and   |            |
nanosecond.                    |            |
----------------------------------------------------------------------------------
A TT2000 character string      |    14      | 0:string_variable, 1-9:n/a
(yyyy-ddd hh:mm:ss.mmmuuunnn)  |            |
Any punctuation mark may exist |            |
between the fields.            |            |
Not restricted to "-" or ":".  |            |
Only yyyy, ddd required;       |            |
other fields are assumed = 0   |            |
unless present. mmmuuunnn is   |            |
millisecond, microsecond and   |            |
nanosecond.                    |            |
----------------------------------------------------------------------------------


Go to input data file examples

Go to translation file examples


Example of Algorithm 0


Input Data File:

94 101  3.25 0.440  215.6  6060.8
94 101  5.75 0.659  195.3  5026.2
94 101  8.15 0.604  185.1  5177.3

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    0                      ;algorithm id
operands                     1 0 2 0 0 3 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
Year         1    i    n n 1  0  1     0     n   0 n n  n  n  n  0
DOY          1    i    n n 0  0  1     0     n   0 n n  n  n  n  0
seconds      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 3


Input Data File:

__________________________________________________________
SpaceCraft Event Time  Density   Vx     Vy    Vz     Temp
year/day hh:mm:ss.mm (cm-3.amu) km/s   km/s  km/s     eV
__________________________________________________________
1993/072 19:19:48 085  0.440   -215.6  34.5   7.1   6060.8
1993/072 19:21:56 023  0.659   -195.3  56.4   4.8   5026.2
1993/072 19:24:03 953  0.604   -185.1  18.9   6.8   5177.3

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    3                      ;algorithm id
operands                     1 0 0 0 0 0 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
datestring   1  c21    n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Velocity     3    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 5


Input Data File:


3.25  0.440  -215.6  34.5   7.1  6060.8
5.75  0.659  -195.3  56.4   4.8  5026.2
8.15  0.604  -185.1  18.9   6.8  5177.3

The base time is not included in the data file, but is 
known to be Year = 76, Day= 34.

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    5                      ;algorithm id
operands                  1976 0 34 0 0 0 0 1 5 0   ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
seconds      1    r    n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Velocity     3    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 6


Input Data File:

Year= 94 Day= 101
3.25  0.440  -215.6  34.5   7.1  6060.8
5.75  0.659  -195.3  56.4   4.8  5026.2
8.15  0.604  -185.1  18.9   6.8  5177.3

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    6                      ;algorithm id
operands                     2 0 4 0 0 0 0 5 5 0    ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
string1      1    s    y n 1  0  1     0     n   0 n n  n  n  n  0
Year         1    i    y n 0  0  1     0     n   0 n n  n  n  n  0
string2      1    s    y n 0  0  1     0     n   0 n n  n  n  n  0
DOY          1    i    y y 0  1  1     0     n   0 n n  n  n  n  0
seconds      1    r    n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Velocity     3    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 7


Input Data File:


(Input data filename is "PROJ_A_19760341521.TXT")

3.25  0.440  -215.6  34.5   7.1  6060.8
5.75  0.659  -195.3  56.4   4.8  5026.2
8.15  0.604  -185.1  18.9   6.8  5177.3

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    7                      ;algorithm id
operands                     0 0 0 0 0 4 8 1 5 6    ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
seconds      1    r    n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Velocity     3    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 10


Input Data File:

2010 101  12 23 3 25 123 0.440  215.6  6060.8
2010 101  13 34 5 75 456 0.659  195.3  5026.2
2010 101  14 45 8 15 789 0.604  185.1  5177.3

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    10                     ;algorithm id
operands                     1 0 2 3 4 5 6 7 0 0    ;operands
END_EPOCH_DESCRIPTION
;
VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
Year         1    i    n n 1  0  1     0     n   0 n n  n  n  n  0
DOY          1    i    n n 0  0  1     0     n   0 n n  n  n  n  0
hours        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
minutes      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
seconds      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
millisecs    1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
microsecs    1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 11


Input Data File:

324216069186005025 0.440  215.6  6060.8
324216071191005025 0.659  195.3  5026.2
324216074185005025 0.604  185.1  5177.3
324216077186000025 0.576  167.6  3847.0
324216080190005025 0.378  151.9  988.2
These TT2000 values correspond to the following date/time: 2010-04-11T00:00:03.002005025 2010-04-11T00:00:05.007005025 2010-04-11T00:00:08.001005025 2010-04-11T00:00:11.002000025 2010-04-11T00:00:14.006005025

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    11                     ;algorithm id
operands                     1 0 0 0 0 0 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
tt2000       1    d    n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 12


Input Data File:

11-Apr-2010 00:00:03.002005025 0.440  215.6  6060.8
11-Apr-2010 00:00:05.007005025 0.659  195.3  5026.2
11-Apr-2010 00:00:08.001005025 0.604  185.1  5177.3
11-Apr-2010 00:00:11.002000025 0.576  167.6  3847.0
11-Apr-2010 00:00:14.006005025 0.378  151.9  988.2

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    12                     ;algorithm id
operands                     1 0 0 0 0 0 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
tt2000       1    c30  n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 13


Input Data File:

2010-04-11T00:00:03.002005025 0.440  215.6  6060.8
2010-04-11T00:00:05.007005025 0.659  195.3  5026.2
2010-04-11T00:00:08.001005025 0.604  185.1  5177.3
2010-04-11T00:00:11.002005025 0.576  167.6  3847.0
2010-04-11T00:00:14.006005025 0.378  151.9  988.2

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    13                     ;algorithm id
operands                     1 0 0 0 0 0 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
tt2000       1    c29  n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Example of Algorithm 14


Input Data File:

2010-111 00:00:03.002005025 0.440  215.6  6060.8
2010-111 00:00:05.007005025 0.659  195.3  5026.2
2010-111 00:00:08.001005025 0.604  185.1  5177.3
2010-111 00:00:11.002005025 0.576  167.6  3847.0
2010-111 00:00:14.006005025 0.378  151.9  988.2

Translation File (Sections 3 & 4 Only):

EPOCH_DESCRIPTION
algorithm                    14                     ;algorithm id
operands                     1 0 0 0 0 0 0 0 0 0    ;operands
END_EPOCH_DESCRIPTION
;VARIABLE_DESCRIPTIONS
;vname       Size form H E br er nreps delta #/r M C aV aS aF Fc fill
tt2000       1    c27  n n 1  0  1     0     n   0 n n  n  n  n  0
Density      1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Speed        1    r    n n 0  0  1     0     n   0 n n  n  n  n  0
Temp         1    r    n y 0  1  1     0     n   0 n n  n  n  n  0
END_VARIABLE_DESCRIPTIONS

Return to the time formats table


Author and Curator

H. Kent Hills, howard.k.hills@nasa.gov, (301)286-9431
ADNET/NSSDC, Code 690.1, NASA/Goddard Space Flight Center
Greenbelt, MD 20771, USA


NASA Official: R.E. McGuire, Head, Space Physics Data Facility (Code 670, NASA/GSFC)
Robert.E.McGuire@gsfc.nasa.gov, (301)286-7794.
Last Updated: February 2012, MHL