IDL/Solarsoft time routines
This file tries to summarize some of the huge variety of ways to re-formulate times using Solarsoft.
TAI and UTC formats
First note that a time expressed in TAI units is different to that expressed in UTC units. The difference can be about 30 seconds (it varies with time!).
To convert a TAI time to a UTC time, do the following:
To create a time in a useful string format, try one of the following:
IDL> print,anytim2utc(time_tai, /ccsds)
IDL> print,anytim2utc(time_tai, /ccsds, /truncate)
IDL> print,anytim2utc(time_tai, /ccsds, /truncate, /time)
IDL> print,anytim2utc(time_tai, /ccsds, /date)
If you want the month given as string, then do:
IDL> print,anytim2utc(time_tai, /vms, /date)
Converting to EX format
The EX format is sometimes handy as it breaks the time into a 7-element array containing year, month, day, hour, minute, second and millisecond, with each given as an integer. The best way seems to be
IDL> extime = anytim(time, /ex)
The routine anytim2ex() does not seem to work very well.
Day-of-year (DOY) format
This is the number of a day counted from 1-January, which is useful in some circumstances:
Note that leap years are correctly handled, and 1-January is
Converting to year-month-day directory structure
A standard time format can be converted to a year-month-day format directory structure with:
Convert a time to file ID (fid) format
This can be useful if you have a data file corresponding to a specific time, and you want to save some derived data into a file that contains the data and time as part of the filename. For example,
IDL> print,time2fid('23-oct-2010 09:40',/full_year,/time)
Getting current time in SSW format
I'm not aware of a SSW routine to do this so my procedure is
to make use of the built-in systime.pro routine. This can return the
current time in Julian Day (JD) format, which can then be reformatted
into the modified Julian Day (MJD) structure that the SSW anytim
routines use. For example:
Page maintained by Dr Peter R Young.