Standard CRS specification
Would be nice to have a standard default CRS specification, instead of having to fully redefine the Frame (Reference position, Time Coordinate, Spectral Coordinate) in each file.
For time representation, the Astropy.time
documentation provides a nice set of options (see Time-format section of Astropy.time
):
Format | Class | Definition | Example |
---|---|---|---|
byear | TimeBesselianEpoch | Besselian Epoch year as floating point value | 1950.0 |
byear_str | TimeBesselianEpochString | Besselian Epoch year as string value | ‘B1950.0’ |
cxcsec | TimeCxcSec | Chandra X-ray Center seconds from 1998-01-01 00:00:00 TT | 63072064.184 |
datetime | TimeDatetime | Python standard library datetime object | datetime(2000, 1, 2, 12, 0, 0) |
decimalyear | TimeDecimalYear | Time as a decimal year, with integer values corresponding to midnight of the first day of each year | 2000.45 |
fits | TimeFITS | FITS format: “[±Y]YYYY-MM-DD[THH:MM:SS[.sss]]” | ‘2000-01-01T00:00:00.000’ |
gps | TimeGPS | seconds from 1980-01-06 00:00:00 UTC | 630720013.0 |
iso | TimeISO | ISO 8601 compliant date-time format “YYYY-MM-DD HH:MM:SS.sss…” | ‘2000-01-01 00:00:00.000’ |
isot | TimeISOT | ISO 8601 compliant date-time format “YYYY-MM-DDTHH:MM:SS.sss…”. This is the same as TimeISO except for a “T” instead of space between the date and time | ‘2000-01-01T00:00:00.000’ |
jd | TimeJD | Julian Date time format. This represents the number of days since the beginning of the Julian Period. | 2451544.5 |
jyear | TimeJulianEpoch | Julian Epoch year as string value | 2000.0 |
jyear_str | TimeJulianEpochString | ‘J2000.0’ | |
mjd | TimeMJD | Modified Julian Date time format. This represents the number of days since midnight on November 17, 1858. | 51544.0 |
plot_date | TimePlotDate | Matplotlib plot_date input: 1 + number of days from 0001-01-01 00:00:00 UTC | 730120.0003703703 |
unix | TimeUnix | seconds from 1970-01-01 00:00:00 UTC, ignoring leap seconds. | 946684800.0 |
unix_tai | TimeUnixTai | Seconds from 1970-01-01 00:00:08 TAI (see notes), including leap seconds. | 946684800.0 |
yday | TimeYearDayTime | Year, day-of-year and time as “YYYY:DOY:HH:MM:SS.sss…”. The day-of-year (DOY) goes from 001 to 365 (366 in leap years) | 2000:001:00:00:00.000 |
ymdhms | TimeYMDHMS | A Time format to represent Time as year, month, day, hour, minute, second (thus the name ymdhms). | {‘year’: 2010, ‘month’: 3, ‘day’: 1} |
datetime64 | TimeDatetime64 | Numpy datetime64 object | np.datetime64(‘2000-01-01T01:01:01’) |
The CDF documentation also defines useful time representations:
Format | Class | Definition |
---|---|---|
Epoch | CDF_EPOCH | Milliseconds since 0000-01-01 00:00:00.000, no leap seconds, floating point value |
Epoch16 | CDF_EPOCH16 | Picoseconds since 0000-01-01 00:00:00.000.000.000.000, no leap seconds, 1 floating point value for seconds since epoch, and 1 floating point value for picoseconds in current second |
TT2000 | CDF_TIME_TT2000 | Number of nanoseconds since 2000-01-01 12:00:00.000000000, leap seconds included, integer value |
Edited by Cecconi Baptiste