SNOE_DATE
Name
SNOE_DATE
Purpose
This function translates dates for the SNOE S/C and mission,
between various different formats.
Category
SNOE, date, time
Calling Sequence
result = SNOE_DATE( date, /from_xxx, /to_xxx )
Inputs
Date: a date, in one of the formats listed below.
Keyword Parameters
FROM_YMD: A keyword specifing that the input is a 3 element
vector, where the first element is a four digit year between
1998 and 2003. The second element is a month number, and the
third element is the day-of-month. The year can be either 2 or
4 digits
FROM_YYDDD: A keyword specifying that the input is a number
of the form YYDDD. 20 represents 00020, or day 20 of year 2000.
98070 is the first day of the mission.
FROM_YYYYDDD: A keyword specifying that the input is a number
of the form YYYYDDD. This is a four digit year, followed by a
3 digit day-of-year.
FROM_MISSION: A keyword specifying that the input is in day of
mission format, where zero (0) is the first day of the
mission.
FROM_DOM: Same as FROM_MISSION
FROM_DOY: A keyword specifying that the input is in
Day-Of-Year format. 1 is the first day of the year.
FROM_TODAY: This keword makes the output the current UTC date
converted to the format specified by the /TO_xxx keyword. An
input argument is OPTIONAL, and will be ignored if this
keyword is set.
TO_DOY: A keyword specifying that the output should be the day
of year of the input date. Note that there is no distinction
nor way to tell what year this day-of-year belongs to. You
must deduce this based upon the input.
TO_YMD: A keyword specifying that the output should be a 3 element
vector of the form [y,m,d].
TO_YYDDD: Output is in yyddd format
TO_YYYYDDD: Output is in yyyyddd format
TO_MISSION: Output is in day of mission format
TO_DOM: Same as TO_MISSION
Outputs
This function returns a number representing the date specified
by the /TO_xxx keyword.
Side Effects
Hopefully none.
Restrictions
Only works through the following dates:
START: 1998070(yyyyddd), 98070(yyddd), 0(mission), [1998,03,11](ymd)
STOP: 2003365(yyyyddd), 3365(yyddd), 2121(mission),
[2003,12,31](ymd)
Should (?) work if input is [yyyy,1,doy], and keyword from_ymd set.
NOTE: other undocumented features/bugs may exist. For example,
ymd input [1999,01,32], and keyword to_ymd set correctly gives the
output as [1999,02,01]. Or, input 0 and output /TO_DOY gives 365.
Procedure
The code works by translating ALL input formats (ymd, yyyyddd,
doy, etc.) to Day of Mission (or Mission Index, mi). Then, mi
is converted to the output requested by the /FROM_xxx keyword.
Example
print, snoe_date( [2003,12,31], /from_ymd, /to_mission )
2121.00
print, snoe_date( [98,3,11], /from_ymd, /to_yyyyddd )
1998070
print, snoe_date( 0, /from_mission, /to_yyyyddd )
1998070
print, snoe_date( 0, /from_mi, /to_yyd ) ; UNIQUE keywords!
98070
Modification History
Written by: Ken Mankoff, 2001.08.28 (2001240,1266,01240,etc.)
09/06/01 TAF; Added the double keyword so that fractional days
can be handled. Only works for from_yyddd and
from_yyyyddd for now.
09/09/01 KDM; Added Julian day functionality
09/13/01 KDM; Added to_doy keyword, added print warning for
Julian keyword.
09/20/01 KDM; modified to allow [y,m,d] input to have 2 digit year
04/23/02 KDM; Commented out JULIAN functionality. Removed double
keyword (see 09/06/01 revision). Fixed 2 digit
[y,m,d] error, added comments to code. Added
/FROM_TODAY keyword, added /FROM_DOY keyword.
06/24/02 KDM; Added DOM (analogous to MISSION)