MISR Toolkit  1.5.1
MtkTaiToTaiJd.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkTaiToTaiJd =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2006, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #include "MisrUtil.h"
18 #include "MisrError.h"
19 #include <math.h>
20 
34  double secTAI93,
35  double jdTAI[2] )
36 {
37  double dayFraction;
38 
39  dayFraction = fmod(secTAI93,SECONDSperDAY);
40  jdTAI[0] = EPOCH_DAY + ((secTAI93 - dayFraction) / SECONDSperDAY);
41  jdTAI[1] = dayFraction / SECONDSperDAY + EPOCH_DAY_FRACTION;
42 
43  if (jdTAI[1] >= 1.0)
44  {
45  jdTAI[0] += 1.0;
46  jdTAI[1] -= 1.0;
47  }
48  else if (jdTAI[1] < 0)
49  {
50  jdTAI[0] -= 1.0;
51  jdTAI[1] += 1.0;
52  }
53 
54  return MTK_SUCCESS;
55 }
#define SECONDSperDAY
Definition: MisrUtil.h:145
MTKt_status
Definition: MisrError.h:11
MTKt_status MtkTaiToTaiJd(double secTAI93, double jdTAI[2])
Convert TAI93 to TAI Julian date.
Definition: MtkTaiToTaiJd.c:33
#define EPOCH_DAY
Definition: MisrUtil.h:143
#define EPOCH_DAY_FRACTION
Definition: MisrUtil.h:144

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52