astro-0.4.1.0: Astro

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

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

Constructors

 SunDetails FieldssdEpoch :: JulianDateEpochsdEpsilon :: DecimalDegreesEcliptic longitude at the EpochsdOmega :: DecimalDegreesEcliptic longitude of perigee at the EpochsdE :: DoubleEccentricity of the orbit at the Epoch

Instances

 Source # MethodsshowList :: [SunDetails] -> ShowS #

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

 Eq a => Eq (RiseSet a) Source # Methods(==) :: RiseSet a -> RiseSet a -> Bool #(/=) :: RiseSet a -> RiseSet a -> Bool # Show a => Show (RiseSet a) Source # MethodsshowsPrec :: Int -> RiseSet a -> ShowS #show :: RiseSet a -> String #showList :: [RiseSet a] -> ShowS #

Calculate SunDetails for the given JulianDate.

SunDetails at the Sun's reference Epoch J2010.0

Calculate mean anomaly using the second 'more accurate' method

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

Calculate the ecliptic longitude of the Sun

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

More accurate method to calculate position of the Sun

Calculate Sun-Earth distance.

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

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.

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

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.