SAGA API  v9.6
datetime.h File Reference
#include "api_core.h"

Go to the source code of this file.

Classes

class  CSG_TimeSpan
 
class  CSG_DateTime
 

Functions

SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date (double JDN, int &y, int &m, int &d)
 
SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date (double JDN)
 
SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date (int JDN)
 
SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber (int y, int m, int d)
 
SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber (const CSG_String &Date)
 
SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth (int Month, bool bLeapYear=false)
 
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (double JulianDayNumber, double &RA, double &Dec)
 
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (const CSG_DateTime &Time, double &RA, double &Dec)
 
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (double JulianDayNumber, double Longitude, double Latitude, double &Height, double &Azimuth)
 
SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position (const CSG_DateTime &Time, double Longitude, double Latitude, double &Height, double &Azimuth)
 
SAGA_API_DLL_EXPORT double SG_Get_Day_Length (int DayOfYear, double Latitude)
 
SAGA_API_DLL_EXPORT double SG_Get_Day_Length (const CSG_DateTime &Date, double Latitude)
 

Detailed Description

Simplified wrappers for wxDateTime and related classes including functions for the calculation of the Sun's position and the day length.

See also
CSG_DateTime
CSG_TimeSpan
SG_Get_Sun_Position
SG_Get_Day_Length

Definition in file datetime.h.

Function Documentation

◆ SG_Date_To_JulianDayNumber() [1/2]

SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber ( const CSG_String Date)

◆ SG_Date_To_JulianDayNumber() [2/2]

SAGA_API_DLL_EXPORT double SG_Date_To_JulianDayNumber ( int  y,
int  m,
int  d 
)

Returns the Julian Day Number calculated from Gregorian date (year, month, day).

Definition at line 729 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_Date_To_JulianDayNumber().

◆ SG_Get_Day_Length() [1/2]

SAGA_API_DLL_EXPORT double SG_Get_Day_Length ( const CSG_DateTime Date,
double  Latitude 
)

Definition at line 927 of file datetime.cpp.

References CSG_DateTime::Get_DayOfYear(), and SG_Get_Day_Length().

◆ SG_Get_Day_Length() [2/2]

SAGA_API_DLL_EXPORT double SG_Get_Day_Length ( int  DayOfYear,
double  Latitude 
)

Definition at line 913 of file datetime.cpp.

References M_DEG_TO_RAD, and M_PI.

Referenced by SG_Get_Day_Length().

◆ SG_Get_Day_MidOfMonth()

SAGA_API_DLL_EXPORT int SG_Get_Day_MidOfMonth ( int  Month,
bool  bLeapYear 
)

Returns the day number (starting with zero for the first of January) for the mid of the requested month (January = 0).

Definition at line 784 of file datetime.cpp.

◆ SG_Get_Sun_Position() [1/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position ( const CSG_DateTime Time,
double &  RA,
double &  Dec 
)

Definition at line 862 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [2/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position ( const CSG_DateTime Time,
double  Longitude,
double  Latitude,
double &  Height,
double &  Azimuth 
)

Definition at line 902 of file datetime.cpp.

References CSG_DateTime::Get_JDN(), and SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [3/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position ( double  JulianDayNumber,
double &  RA,
double &  Dec 
)

Calculates the Sun's position for given date and time as declination and right ascension angles (radians). Solar coordinates according to Jean Meeus: Astronomical Algorithms, accuracy of 0.01 degree

Definition at line 835 of file datetime.cpp.

References M_DEG_TO_RAD.

Referenced by SG_Get_Sun_Position().

◆ SG_Get_Sun_Position() [4/4]

SAGA_API_DLL_EXPORT bool SG_Get_Sun_Position ( double  JulianDayNumber,
double  Longitude,
double  Latitude,
double &  Height,
double &  Azimuth 
)

Calculates the Sun's position for given date and time and position on Earth as given by longitude and latitude (radians). Height and Azimuth are calculated as radians. Returns true if Sun is above horizon.

Definition at line 875 of file datetime.cpp.

References M_DEG_TO_RAD, and SG_Get_Sun_Position().

◆ SG_JulianDayNumber_To_Date() [1/3]

SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date ( double  JDN)

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 698 of file datetime.cpp.

References CSG_String::Printf(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [2/3]

SAGA_API_DLL_EXPORT bool SG_JulianDayNumber_To_Date ( double  JDN,
int &  y,
int &  m,
int &  d 
)

Expects 'Value' to be the Julian Day Number.

Definition at line 678 of file datetime.cpp.

Referenced by CSG_Table_Value_Date::Set_Value(), and SG_JulianDayNumber_To_Date().

◆ SG_JulianDayNumber_To_Date() [3/3]

SAGA_API_DLL_EXPORT CSG_String SG_JulianDayNumber_To_Date ( int  JDN)

Calculates Gregorian date from Julian Day Number and returns it as ISO 8601 string (yyyy-mm-dd).

Definition at line 719 of file datetime.cpp.

References SG_JulianDayNumber_To_Date().