astro-0.4.3.0: Amateur astronomical computations
CopyrightAlexander Ignatyev 2016
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Astro.Sun

Description

Calculation characteristics of the Sun.

Terms

  • perihelion - minimal distance from the Sun to the planet
  • aphelion - maximal distance from the Sun to the planet
  • perigee - minimal distance from the Sun to the Earth
  • apogee - maximal distance from the Sun to the Earth

Example

import Data.Astro.Time.JulianDate
import Data.Astro.Coordinate
import Data.Astro.Types
import Data.Astro.Sun

ro :: GeographicCoordinates
ro = GeoC (fromDMS 51 28 40) (-(fromDMS 0 0 5))

dt :: LocalCivilTime
dt = lctFromYMDHMS (DH 1) 2017 6 25 10 29 0

today :: LocalCivilDate
today = lcdFromYMD (DH 1) 2017 6 25

jd :: JulianDate
jd = lctUniversalTime dt

verticalShift :: DecimalDegrees
verticalShift = refract (DD 0) 12 1012

-- distance from the Earth to the Sun in kilometres
distance :: Double
distance = sunDistance jd
-- 1.5206375976421073e8

-- Angular Size
angularSize :: DecimalDegrees
angularSize = sunAngularSize jd
-- DD 0.5244849215333616

-- The Sun's coordinates
ec1 :: EquatorialCoordinates1
ec1 = sunPosition2 jd
-- EC1 {e1Declination = DD 23.37339098989099, e1RightAscension = DH 6.29262026252748}

hc :: HorizonCoordinates
hc = ec1ToHC ro jd ec1
-- HC {hAltitude = DD 49.312050979507404, hAzimuth = DD 118.94723825710143}


-- Rise and Set
riseSet :: RiseSetMB
riseSet = sunRiseAndSet ro 0.833333 today
-- RiseSet
--    (Just (2017-06-25 04:44:04.3304 +1.0,DD 49.043237261724215))
--    (Just (2017-06-25 21:21:14.4565 +1.0,DD 310.91655607595595))
Synopsis

Documentation

data SunDetails Source #

Details of the Sun's apparent orbit at the given epoch

Constructors

SunDetails 

Fields

Instances

Instances details
Show SunDetails Source # 
Instance details

Defined in Data.Astro.Sun

data RiseSet a Source #

Some Info of Rise and Set of a celestial object

Constructors

RiseSet a a

Some Info of Rise and Set of the celestial object

Circumpolar

The celestial object is always above the horizon

NeverRises

The celestial object is always below the horizon

Instances

Instances details
Eq a => Eq (RiseSet a) Source # 
Instance details

Defined in Data.Astro.CelestialObject.RiseSet

Methods

(==) :: RiseSet a -> RiseSet a -> Bool #

(/=) :: RiseSet a -> RiseSet a -> Bool #

Show a => Show (RiseSet a) Source # 
Instance details

Defined in Data.Astro.CelestialObject.RiseSet

Methods

showsPrec :: Int -> RiseSet a -> ShowS #

show :: RiseSet a -> String #

showList :: [RiseSet a] -> ShowS #

sunDetails :: JulianDate -> SunDetails Source #

Calculate SunDetails for the given JulianDate.

j2010SunDetails :: SunDetails Source #

SunDetails at the Sun's reference Epoch J2010.0

sunMeanAnomaly2 :: SunDetails -> DecimalDegrees Source #

Calculate mean anomaly using the second 'more accurate' method

sunEclipticLongitude1 :: SunDetails -> JulianDate -> DecimalDegrees Source #

Calculate the ecliptic longitude of the Sun with the given SunDetails at the given JulianDate

sunEclipticLongitude2 :: SunDetails -> DecimalDegrees Source #

Calculate the ecliptic longitude of the Sun

sunPosition1 :: SunDetails -> JulianDate -> EquatorialCoordinates1 Source #

Calculate Equatorial Coordinates of the Sun with the given SunDetails at the given JulianDate. It is recommended to use j2010SunDetails as a first parameter.

sunPosition2 :: JulianDate -> EquatorialCoordinates1 Source #

More accurate method to calculate position of the Sun

sunDistance :: JulianDate -> Double Source #

Calculate Sun-Earth distance.

sunAngularSize :: JulianDate -> DecimalDegrees Source #

Calculate the Sun's angular size (i.e. its angular diameter).

sunRiseAndSet :: GeographicCoordinates -> DecimalDegrees -> LocalCivilDate -> RiseSetMB Source #

Calculatesthe Sun's rise and set It takes coordinates of the observer, local civil date, vertical shift (good value is 0.833333). It returns Nothing if fails to calculate rise and/or set. It should be accurate to within a minute of time.

equationOfTime :: JulianDate -> DecimalHours Source #

Calculates discrepancy between the mean solar time and real solar time at the given date.

solarElongation :: EquatorialCoordinates1 -> JulianDate -> DecimalDegrees Source #

Calculates the angle between the lines of sight to the Sun and to a celestial object specified by the given coordinates at the given Universal Time.