gr2jul |
Table of contents
ProcedureGR2JUL (Gregorian to Julian Calendar) ENTRY GR2JUL ( YEAR, MONTH, DAY, DOY ) AbstractConvert Year Month and Day on the Gregorian Calendar to the Julian Calendar Required_ReadingNone. KeywordsTIME DeclarationsINTEGER YEAR INTEGER MONTH INTEGER DAY INTEGER DOY Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- YEAR I-O Year of Gregorian Calendar/Julian Calendar MONTH I-O Month of Gregorian Calendar/Julian Calendar DAY I-O Day of Month in Gregorian Calendar/Julian Calendar DOY O Day of Year in Julian Calendar Detailed_InputYEAR is an integer representing the year of an epoch, E, in the Gregorian calendar. Note that the year 0 (zero) and negative values are required to represent years in the pre-Christian era (B.C.) A year, Y B.C. should be represented as -(Y-1). For example the year 435 B.C. should be input as -434. MONTH is an integer representing the month of some epoch, E, in the Gregorian calendar. Months outside the usual range from 1 to 12 are converted to the standard range using modular arithmetic and the input year is adjusted appropriately. DAY is the day of the month of some epoch, E, in the Gregorian calendar. Note to input an epoch as the day of a year, set MONTH to 1 and DAY to the day of the year. Detailed_OutputYEAR is an integer representing the year of the epoch, E, above in the Julian calendar. Note that the year 0 (zero) and negative values are used to represent years in the pre-Christian era (B.C.) A year, Y B.C., is be represented as -(Y-1). For example the year 435 B.C. will be returned as -434. MONTH is an integer representing the month of the epoch, E, above in the Julian Calendar calendar. DAY is the day of the month of the epoch, E, above in the Julian Calendar DOY is the day of the year of the epoch, E, above in the Julian Calendar. ParametersNone. ExceptionsNone. FilesNone. ParticularsThis is a mid-level utility routine to assist in the assignment and presentation of Ancient epochs. The SPICE software deals primarily with epochs represented on in the Gregorian Calendar. However, the Gregorian calendar was not adopted until October 15, 1582. As a result, epochs prior to that time are usually represented in the Julian proleptic calendar. Formally, both calendars can be extended indefinitely forward and backward in time due the algorithmic nature of the determination of calendar representation. This routine allows you to take a numeric representation of an epoch represented in the Gregorian calendar and convert that to an epoch in the Julian calendar. To convert from Julian Calendar to Gregorian calendar, use the entry point JUL2GR. ExamplesSuppose you need to print an epoch (given in seconds past the J2000 epoch) of some ancient epoch that occurred during pre-Christian era, and that you want to represent this epoch using the Julian proleptic calendar. Here's the declarations we'll need INTEGER YEAR INTEGER MONTH INTEGER DAY INTEGER DOY DOUBLE PRECISION TVEC ( 6 ) DOUBLE PRECISION TDB You first need to convert TDB (the epoch in Seconds past J2000) to a calendar representation. TVEC(1) = TDB. CALL TTRANS ( 'TDB', 'YMD', TVEC ) The output time vector will be relative to the Gregorian Calendar. Collect the year, month and day from the time vector. YEAR = INT ( TVEC(1) ) MONTH = INT ( TVEC(2) ) DAY = INT ( TVEC(3) ) The hours, minutes and seconds appear in components 4 through 6 of the time vector. We can ignore them in the conversion of the calendar from Gregorian to Julian. CALL GR2JUL ( YEAR, MONTH, DAY, DOY ) Now create a string from the YEAR, MONTH, DAY and TVEC(4) through TVEC(6). RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 1.1.1, 02-OCT-2021 (JDR) Reordered header sections. Edited the header to comply with NAIF standard. SPICELIB Version 1.1.0, 23-FEB-1998 (WLT) The routine was upgraded so that it will handle without error months that are outside the range from 1 to 12. SPICELIB Version 1.0.0, 13-MAR-1996 (WLT) |
Fri Dec 31 18:36:26 2021