MISR Toolkit  1.5.1
Macros | Functions
MtkJulianToCal.c File Reference
#include "MisrUtil.h"
#include "MisrError.h"
#include <math.h>
#include <string.h>

Go to the source code of this file.

Macros

#define GREGORIAN_EPOCH   1721425.5
 

Functions

static int leap_gregorian (int year)
 
static double gregorian_to_jd (int year, int month, int day)
 
static double mod (double a, double b)
 
static void jd_to_gregorian (double jd, int *y, int *m, int *d)
 
static void jhms (double j, int *hour, int *min, int *sec)
 
MTKt_status MtkJulianToCal (double jd, int *year, int *month, int *day, int *hour, int *min, int *sec)
 Convert Julian date to calendar date. More...
 

Macro Definition Documentation

◆ GREGORIAN_EPOCH

#define GREGORIAN_EPOCH   1721425.5

Definition at line 32 of file MtkJulianToCal.c.

Function Documentation

◆ gregorian_to_jd()

static double gregorian_to_jd ( int  year,
int  month,
int  day 
)
static

Definition at line 34 of file MtkJulianToCal.c.

◆ jd_to_gregorian()

static void jd_to_gregorian ( double  jd,
int *  y,
int *  m,
int *  d 
)
static

Definition at line 58 of file MtkJulianToCal.c.

◆ jhms()

static void jhms ( double  j,
int *  hour,
int *  min,
int *  sec 
)
static

Definition at line 101 of file MtkJulianToCal.c.

◆ leap_gregorian()

static int leap_gregorian ( int  year)
static

Definition at line 24 of file MtkJulianToCal.c.

◆ mod()

static double mod ( double  a,
double  b 
)
static

Definition at line 50 of file MtkJulianToCal.c.

◆ MtkJulianToCal()

MTKt_status MtkJulianToCal ( double  jd,
int *  year,
int *  month,
int *  day,
int *  hour,
int *  min,
int *  sec 
)

Convert Julian date to calendar date.

Returns
MTK_SUCCESS if successful.
Example:
In this example, we convert from the julian date 2453728.27313 to calendar date.
status = MtkJulianToCal(2453728.27313, &year, &month, &day, &hour, &min, &sec);
Note
Julian date must be >= 1721119.5
Parameters
[in]jdJulian date
[out]yearYear
[out]monthMonth
[out]dayDay
[out]hourHour
[out]minMinutes
[out]secSeconds

Definition at line 126 of file MtkJulianToCal.c.


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