Skip to content

developer.book.time

Jeremy Faden edited this page Dec 18, 2024 · 5 revisions

It's worthwhile to have a section to talk about how time is handled in Autoplot.

Units, LocationUnits, and TimeLocationUnits

Times are stored in Autoplot as a type of Datum, which is a number and a unit representation of the number. Location units have a basis, like "north from equator", and Time Location Units have a basis instant in time. This means that there is no single way that times are represented. They might be expressed in microseconds since 2000-01-01T00:00Z, or they might be in days since 1970-01-01T00:00Z. This allows data to be preserved in many formats. For example, CDF data in recent missions is tagged by CDF_TT2000, which is the number of nanoseconds since 2000-01-01T00:00:00.000000000Z, including leap seconds. This data can be read into Autoplot and represented using the same numbers, and a units converter converts the data to different epochs if needed.

Most time formats skip leap seconds. This has the benefit that calculation of decomposed times (Year, Month, Day, Hour, ..., Nanosecond) can be done without depending on a table of leap seconds which could become outdated. Note however that events which occur during the leap second are not properly represented, and subtractions used to calculate distances will be missing the leap second as well.

In Autoplot scripting, the object Units is automatically imported, so that many units are available. For example, Units.us2000 is the number of non-leap microseconds since 2000-01-01T00:00Z. Units.us2000 was the standard unit for many operators in Das2. Note as we use it to represent later and later times, its resolution becomes poorer, and Units.us2020 can also be used. Units.t1970 is commonly used in many systems, though its resolution is limited for times in 2020. Units.cdfTT2000 is interesting because it is typically backed by a 64-bit long integer, so its resolution does not degrade with time, though times after about 2170 cannot be represented. Presumably Units.CDF_TT2100 would be introduced, if this software is still useful.

name example value as string resolution
t1970 1.7356896E9 2025-01-01T00:00:00.000Z 2.384186e-007 s
ms1970 1.7356896E12 2025-01-01T00:00:00.000Z 2.441406e-004 ms
mj1958 24472.0 2025-01-01T00:00:00.000Z 3.637979e-012 days
cdfTT2000 7.88961669184E17 2025-01-01T00:00:00.000Z 1ns
us2000 7.890048E14 2025-01-01T00:00:00.000Z 1.250000e-001 microseconds

Other topics suggested by Ivar

  • different formats (cdfTT2000, ...)
  • internal representation/expected precision
  • converting between formats
  • creating epoch variables/arrays (sec. 9.13 in cookbook, ...)
  • addition/subtractions issues
  • an index of epoch-related functions
  • input/output (including time sting parsing and output formatting) (sec. 7.2 in cookbook, ...)
  • events lists (sec. 2.3 in cookbook, ...)

Table Of Contents

URIs that Point to Data Files

Download a CDF and Plot it with Autoplot

Load a CDF directly from a website

URIs that Point to Data Servers

Saving to vap files

Loading vap files

Data Sources

CDF Files

HDF/NetCDF Files

Aggregation

CDAWeb

HAPI Servers

Exporting Data

Export Types

Additional controls

Aggregation

Tools

PNGWalk Tool

Data Mash Up

Events List

Run Batch

Advanced Topics

TimeSeriesBrowse and other Capabilities

Events Lists

Caching

Autoranging

Managing Autoplot's Data Cache

Using Autoplot with Python, IDL, and Matlab

Reading data into Python

Reading data into IDL

Reading data into Matlab

QDataSet Data Model

Clone this wiki locally