Calculating the variations of sunrise, sunset and day length times for Baghdad city.With comparison to different regions of the world in year 2019

The sunrise, sunset, and day length times for Baghdad (Latitude =33.34o N, Longitude =44.43o E) were calculated with high accuracy on a daily basis during 2019. The results showed that the earliest time of sunrise in Baghdad was at 4 h : 53 m from 5 Jun. to 20 Jun while the latest was at 7 h : 07 m from 5 Jan. to 11 Jan. The earliest time of sunset in Baghdad was at16 h : 55 m from 30 Nov. to 10 Dec. whereas the latest was at 19 h : 16 m from 25 Jun. to 5 Jul. The minimum period of day length in Baghdad was 9 h : 57 m ) in 17 Dec. whereas the maximum period was 14 h : 22 m ) in 20 Jun. Day length was calculated and compared among regions of different latitudes(0, 15, 30, 45 and 60 north).


Introduction
The time of sunrise at any place is the moment when the upper edge of the Sun appears above the horizon in the morning. The time of sunset is defined as the moment when the upper edge of the
The sunrise, sunset, and day length times for a certain place vary from day to day during the year, and near the horizon. Atmospheric refraction causes distortion of sunlight rays to such an extent that geometrically the solar disk is already about one diameter below the horizon when a sunset was observed [2] (Figure-1). Light is refracted through the atmosphere on its way to the earth's surface. This causes the sun to appear higher in the sky than it really is ( Figure-1). Sunrise occurs before the Sun actually reaches the horizon because the sunlight is refracted by the Earth's atmosphere. At the horizon, the average amount of refraction is 34 arcminutes, although this amount varies based on atmospheric conditions [4].
In addition, sunrise occurs when the Sun's upper limb, rather than its center, appears to cross the horizon. The apparent radius of the Sun at the horizon is 16 arcminutes. These two angles combine to define sunrise to occur when the Sun's center is 50 arcminutes below the horizon, or 90.83° from the zenith [5].

Date and Julian Date
Julian Date (JD) is the number of days and fractions beginning from mean noon on January 1 st , 4713 BC [6,7]. The program must then starts with a procedure to separate the numbers of years (y), months (m), d = day + U.T / 24 Where U.T: is the epoch universal time in hours. In what follows, we will suppose that separation has been performed. At m = 1 or 2, take (to solve February month problem) y = y -1 and m = m + 12. If the number y, m, and d are equal or larger than 1582/10/15 (that is, in the Gregorian calendar), calculate as [8]:

Coordinates of the Sun 2.1 Ecliptical Coordinates of the Sun
The longitude of the sun on the epoch J2000.0 was 280.46 and the rate at which the Earth is going around the Sun is 0.985647359 per day (from equinox to equinox), and the mean longitude of the Sun was applied as in previous studies [11,12]: (3) The longitude of perigee of Earth's orbit on the epoch J2000.0 was 357°.528 and the rate at which the Sun is moving from perigee to perigee is 00°.985600281 per day, while the mean anomaly was applied as previously described [13]: M s =257°.52911+35999°.05029 T 2 -0°.0001537 T 2 2 (4) The Sun's equation of the center C s is [14]: The true longitude of the Sun L st can be calculated using the formula [14]: L st =L s + C s (6) and Sun's true anomaly V s is: V s =M s + C s (7) Avoiding significant error, the Latitude β s of the Sun can be considered zero as it remains on the ecliptic.

Calculating Sunrise, Sunset and Day length times
To calculate sunrise and sunset times, the steps below were followed [13]: 1. The equatorial coordinates (α, δ) for the Sun were given by equations 8, and 9. 2. The Hour angle of rising and setting was calculated by the following equation [13]: (14) Where: is the declination  is the geographical latitude. ℓ is the geographical longitude . The sidereal times of rising (S.T r ) and setting (S.T s ) were calculated as follows [14]:  (16) Where  o is the right ascension at rising or setting. 3. The corrections of refraction (R) at the moment of rising or setting were calculated according to Schaefer (1990) showed that the refraction values near the horizon fluctuated from 0.234° to 1.678°, while the total refraction varied over a range of R= 0.64° or 34`.4 [15]. 4. Correction of horizontal parallax at rising and setting was calculated and found to equal 8``.79 [13]. 5. The correction of semi diameter at rising and setting for the Sun was calculated and found to equal 0 0 .533 [17]. 6. The total corrections at sunset or sunrise (X sun ) were calculated as: X sun = 0 0 .533 / 2 + 34`.4 + 8``.79 = 0 0 .83560 (17) 7. The times of Sunrise (T ro ) and Sunset(T so ) with corrections in local sidereal time (LST) [13] were calculated as: T ro =-S.T r -X s (18) T so =-S.T s + X s 8. The times from local sidereal time (LST) were converted to Greenwich mean time (GMT) by the following equations [13] : 10. The day length is the interval time between sunrise (LMT r ) and sunset (LMT s ) and can be calculated by [10]: Day length = LMT s -LMT r (23)

Results and discussion
Computer programs were written using Visual-Basic language to calculate the times of sunrise, sunset, and day length during one year for Baghdad city (Latitude =33.34º N, Longitude =44.43º E). All the above calculations during 2019 depended on practical formulas, as in equations 1 to 23.
The results of sunrise, sunset, times, and variations between sunrise and sunset times with date in the year are shown in Figures-(2, 3). Based on these results, we could extract the following information:     Table-1. The results show that day length was the longest at the summer solstice in June and the shortest at the winter solstice in December. In addition, at equinoxes in March and September, the length of the day was about 12hour.
The day length is the time between sunrise and sunset, as shown in Figure-4. Day length changes due to the change in sunrise time and sunset time throughout the year.   The length of the day is a function of the latitude only (longitude has no effect on day length), in addition to the day of the year. The variations in day length period as a function of latitudes (0 ,15N,30N,45N,60N) during 2019 is shown in Figure-6.
From Figure-6, the day length at the equinoxes (21 March and 23 September) was equal, regardless of latitude. Thus it could be observed that summer days in higher latitudes (45N, 60N) were longer than those in lower latitudes (15N, 30N) and that winter days were shorter.
The equator area (latitude 0) had less variation (two minutes only) in day length throughout the year 2019, as shown in Table-