MeteoIODoc 20241221.207bde49
mio::SunTrajectory Class Referenceabstract

Detailed Description

A class to calculate the Sun's position This class is purely virtual.

Author
Mathias Bavay
Date
2010-06-10

#include <Suntrajectory.h>

Public Member Functions

 SunTrajectory ()
 
 SunTrajectory (const double &i_latitude, const double &i_longitude)
 
virtual ~SunTrajectory ()
 
virtual void setDate (const double &i_julian, const double &i_TZ=0.)=0
 Set the date and time if no timezone is specified, GMT is assumed. More...
 
virtual void setLatLon (const double &i_latitude, const double &i_longitude)=0
 
virtual void setAll (const double &i_latitude, const double &i_longitude, const double &i_julian, const double &i_TZ=0.)=0
 
virtual void reset ()=0
 
virtual double getSolarElevation () const =0
 
virtual double getSolarAzimuth () const =0
 
virtual void getHorizontalCoordinates (double &azimuth, double &elevation) const =0
 
virtual void getHorizontalCoordinates (double &azimuth, double &elevation, double &eccentricity) const =0
 
virtual void getDaylight (double &sunrise, double &sunset, double &daylight)=0
 
virtual double getSolarTime () const
 Return the current solar time. Since the Sun reaches its zenith at a time different than the local noon, the solar noon does not happen at 12:00 local time. This defines a solar time that has a negative or positive offset with the local time, depending on the seasons (see http://www.jaloxa.eu/resources/daylighting/sunpath.shtml). More...
 
virtual double getSolarTimeOfDay () const
 Return the current solar time of day. Since the Sun reaches its zenith at a time different than the local noon, the solar noon does not happen at 12:00 local time. This defines a solar time that has a negative or positive offset with the local time, depending on the seasons (see http://www.jaloxa.eu/resources/daylighting/sunpath.shtml). More...
 
virtual void getEquatorialCoordinates (double &right_ascension, double &declination)=0
 (http://en.wikipedia.org/wiki/Equatorial_coordinate_system) More...
 
double getAngleOfIncidence (const double &slope_azi, const double &slope_elev) const
 radiation projection methods More...
 
double getRadiationOnHorizontal (const double &radiation) const
 
double getRadiationOnSlope (const double &slope_azi, const double &slope_elev, const double &radiation) const
 
double getHorizontalOnSlope (const double &slope_azi, const double &slope_elev, const double &H_radiation, const double &elev_threshold=5.) const
 Project a given horizontal radiation to a given slope. The sun position is the current one, the radiation intensity is given as well as the slope parameters. This should be used after correcting the radiation on the horizontal (by applying atmospheric effects or special handling for dawn/dusk) in order to compute consistent radiation on slopes. More...
 
const std::string toString () const
 

Static Public Member Functions

static void getEaster (const int &year, int &month, int &day)
 Return the date of easter for the given year. More...
 
static double getAngleOfIncidence (const double &sun_azi, const double &sun_elev, const double &slope_azi, const double &slope_elev)
 static helper for radiation projection More...
 
static double projectHorizontalToSlope (const double &sun_azi, const double &sun_elev, const double &slope_azi, const double &slope_elev, const double &H_radiation, const double &elev_threshold=5.)
 
static double projectSlopeToHorizontal (const double &sun_azi, const double &sun_elev, const double &slope_azi, const double &slope_elev, const double &S_radiation)
 
static double projectHorizontalToBeam (const double &sun_elev, const double &H_radiation)
 

Protected Member Functions

virtual void update ()=0
 

Protected Attributes

double julian_gmt
 
double TZ
 
double latitude
 
double longitude
 
double SolarAzimuthAngle
 
double SolarElevation
 
double eccentricityEarth
 >this is the TRUE solar elevation, not the apparent one More...
 
double SunRise
 
double SunSet
 
double SunlightDuration
 
double SolarNoon
 
double SunRightAscension
 
double SunDeclination
 
double HourAngle
 

Static Protected Attributes

static const double nodata
 

Constructor & Destructor Documentation

◆ SunTrajectory() [1/2]

mio::SunTrajectory::SunTrajectory ( )

◆ SunTrajectory() [2/2]

mio::SunTrajectory::SunTrajectory ( const double &  i_latitude,
const double &  i_longitude 
)

◆ ~SunTrajectory()

virtual mio::SunTrajectory::~SunTrajectory ( )
inlinevirtual

Member Function Documentation

◆ getAngleOfIncidence() [1/2]

double mio::SunTrajectory::getAngleOfIncidence ( const double &  slope_azi,
const double &  slope_elev 
) const

radiation projection methods

Compute the solar incidence (rad), i.e. the angle between the incident sun beam and the normal to the slope (simplified by Funk (1984 pp.139-140)).

Parameters
slope_azislope azimuth in degrees, bearing
slope_elevslope angle in degrees
Returns
double angle of incidence of the sun to the local slope

◆ getAngleOfIncidence() [2/2]

double mio::SunTrajectory::getAngleOfIncidence ( const double &  sun_azi,
const double &  sun_elev,
const double &  slope_azi,
const double &  slope_elev 
)
static

static helper for radiation projection

◆ getDaylight()

virtual void mio::SunTrajectory::getDaylight ( double &  sunrise,
double &  sunset,
double &  daylight 
)
pure virtual

Implemented in mio::SunMeeus.

◆ getEaster()

void mio::SunTrajectory::getEaster ( const int &  year,
int &  month,
int &  day 
)
static

Return the date of easter for the given year.

This is the method given in Meeus citing Butcher's Ecclesiastical Calendar. It is valid for all years after October 1582 (since this was the year of introduction of the
Gregorian calendar, suppressing 10 days (jumping from 4.10 to 15.10) compared to the previous Julian calendar).

Parameters
[in]yearthe year of interest
[out]monththe month of Easter
[out]daythe day of Easter

◆ getEquatorialCoordinates()

virtual void mio::SunTrajectory::getEquatorialCoordinates ( double &  right_ascension,
double &  declination 
)
pure virtual

◆ getHorizontalCoordinates() [1/2]

virtual void mio::SunTrajectory::getHorizontalCoordinates ( double &  azimuth,
double &  elevation 
) const
pure virtual

Implemented in mio::SunMeeus.

◆ getHorizontalCoordinates() [2/2]

virtual void mio::SunTrajectory::getHorizontalCoordinates ( double &  azimuth,
double &  elevation,
double &  eccentricity 
) const
pure virtual

Implemented in mio::SunMeeus.

◆ getHorizontalOnSlope()

double mio::SunTrajectory::getHorizontalOnSlope ( const double &  slope_azi,
const double &  slope_elev,
const double &  H_radiation,
const double &  elev_threshold = 5. 
) const

Project a given horizontal radiation to a given slope. The sun position is the current one, the radiation intensity is given as well as the slope parameters. This should be used after correcting the radiation on the horizontal (by applying atmospheric effects or special handling for dawn/dusk) in order to compute consistent radiation on slopes.

Parameters
slope_azislope azimuth (compass orientation, in degrees)
slope_elevslope angle (in degrees)
H_radiationradiation intensity on the horizontal
elev_thresholdall solar elevations less than this threshold will be use this threshold (in degrees, default 5 degrees)
Returns
radiation projected on the slope

◆ getRadiationOnHorizontal()

double mio::SunTrajectory::getRadiationOnHorizontal ( const double &  radiation) const

◆ getRadiationOnSlope()

double mio::SunTrajectory::getRadiationOnSlope ( const double &  slope_azi,
const double &  slope_elev,
const double &  radiation 
) const

◆ getSolarAzimuth()

virtual double mio::SunTrajectory::getSolarAzimuth ( ) const
pure virtual

Implemented in mio::SunMeeus.

◆ getSolarElevation()

virtual double mio::SunTrajectory::getSolarElevation ( ) const
pure virtual

(see http://en.wikipedia.org/wiki/Horizontal_coordinate_system) please remember that zenith_angle = 90 - elevation

Implemented in mio::SunMeeus.

◆ getSolarTime()

double mio::SunTrajectory::getSolarTime ( ) const
virtual

Return the current solar time. Since the Sun reaches its zenith at a time different than the local noon, the solar noon does not happen at 12:00 local time. This defines a solar time that has a negative or positive offset with the local time, depending on the seasons (see http://www.jaloxa.eu/resources/daylighting/sunpath.shtml).

Returns
actual solar time

◆ getSolarTimeOfDay()

double mio::SunTrajectory::getSolarTimeOfDay ( ) const
virtual

Return the current solar time of day. Since the Sun reaches its zenith at a time different than the local noon, the solar noon does not happen at 12:00 local time. This defines a solar time that has a negative or positive offset with the local time, depending on the seasons (see http://www.jaloxa.eu/resources/daylighting/sunpath.shtml).

Returns
actual solar time of day, ie between 0 and 1

◆ projectHorizontalToBeam()

double mio::SunTrajectory::projectHorizontalToBeam ( const double &  sun_elev,
const double &  H_radiation 
)
static

◆ projectHorizontalToSlope()

double mio::SunTrajectory::projectHorizontalToSlope ( const double &  sun_azi,
const double &  sun_elev,
const double &  slope_azi,
const double &  slope_elev,
const double &  H_radiation,
const double &  elev_threshold = 5. 
)
static

◆ projectSlopeToHorizontal()

double mio::SunTrajectory::projectSlopeToHorizontal ( const double &  sun_azi,
const double &  sun_elev,
const double &  slope_azi,
const double &  slope_elev,
const double &  S_radiation 
)
static

◆ reset()

virtual void mio::SunTrajectory::reset ( )
pure virtual

Implemented in mio::SunMeeus.

◆ setAll()

virtual void mio::SunTrajectory::setAll ( const double &  i_latitude,
const double &  i_longitude,
const double &  i_julian,
const double &  i_TZ = 0. 
)
pure virtual

Implemented in mio::SunMeeus.

◆ setDate()

virtual void mio::SunTrajectory::setDate ( const double &  i_julian,
const double &  i_TZ = 0. 
)
pure virtual

Set the date and time if no timezone is specified, GMT is assumed.

Parameters
i_julianjulian date in the time zone of interest
i_TZtime zone

Implemented in mio::SunMeeus.

◆ setLatLon()

virtual void mio::SunTrajectory::setLatLon ( const double &  i_latitude,
const double &  i_longitude 
)
pure virtual

Implemented in mio::SunMeeus.

◆ toString()

const std::string mio::SunTrajectory::toString ( ) const

◆ update()

virtual void mio::SunTrajectory::update ( )
protectedpure virtual

Member Data Documentation

◆ eccentricityEarth

double mio::SunTrajectory::eccentricityEarth
protected

>this is the TRUE solar elevation, not the apparent one

◆ HourAngle

double mio::SunTrajectory::HourAngle
protected

◆ julian_gmt

double mio::SunTrajectory::julian_gmt
protected

◆ latitude

double mio::SunTrajectory::latitude
protected

◆ longitude

double mio::SunTrajectory::longitude
protected

◆ nodata

const double mio::SunTrajectory::nodata
staticprotected

◆ SolarAzimuthAngle

double mio::SunTrajectory::SolarAzimuthAngle
protected

◆ SolarElevation

double mio::SunTrajectory::SolarElevation
protected

◆ SolarNoon

double mio::SunTrajectory::SolarNoon
protected

◆ SunDeclination

double mio::SunTrajectory::SunDeclination
protected

◆ SunlightDuration

double mio::SunTrajectory::SunlightDuration
protected

◆ SunRightAscension

double mio::SunTrajectory::SunRightAscension
protected

◆ SunRise

double mio::SunTrajectory::SunRise
protected

◆ SunSet

double mio::SunTrajectory::SunSet
protected

◆ TZ

double mio::SunTrajectory::TZ
protected

The documentation for this class was generated from the following files: