<p>The declination and latitude are sufficient to determine if an object rises and sets, is circumpolar, or never rises. Based on the following figure for the northern hemisphere,</p>
<ul>
<li>The object is circumpolar if the declination is closer to the pole than 90-latitude.</li>
<li>The object never rises if the declination is farther from the equator than latitude-90.</li>
<li>The object rises and sets if the declination is between those extremes.</li>
</ul>
<p>If including atmospheric refraction, the declination needs to be adjusted so that the refracted object has 0 altitude when it touches the horizon.</p>
<p>The diameter of the Sun also needs to be included so that the top limb, not the center, appears at 0 altitude when it touches the horizon.</p>
<p><a href="https://i.sstatic.net/BOFGPwHz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BOFGPwHz.png" alt="Cut through the sky along the plane of the meridian" /></a></p>

CC BY-SA 4.0
2024-10-03T05:33:17.900Z
Thanks for you answer, 1- so if `declination >= 90 - |Latitude|` the sun must be circumpolar, and if `declination > |Latitude| - 90` the sun must never rise? 2- and if I had the atmospheric refraction value I should recalculate the declination as `adjustedDeclination = declination - atmospheric refraction` before checking? 3- declination's value changes throughout the day so at what time should I check if the sun is circumpolar or never rises?
Ahmed Dyaa
CC BY-SA 4.0
2024-10-03T17:24:18.170Z
1 - close except you need to consider the sign of the declination also. May be easier to use If Lat >0 then ... else ....End If than try to create 1 equation that covers both hemispheres. 2 - is correct, and you can subtract the semi-diameter if you do not account for that elsewhere. (continued)
JohnHoltz
CC BY-SA 4.0
2024-10-03T17:29:46.250Z
3- The Sun moves more in right ascension per day than in declination. You need to compensate for the RA, too. Ideally you use the RA and Dec at the time of rise, time of transit, and time of set. Some how I derived a linear equation (many years ago) to interpolate the times based on the RA and Dec at 0 hr and 24 hr. For example, RA = RA0+(RA24-RA0)/24*t. Transit is easy since (sidereal time)-(RA) = 0. This gives (sidereal time at 0 + 1.00273*t)-(RA0+(RA24-RA0)/24*t)=0. Solve for t. I probably did something similar for rising and setting by calculating what hour angle was needed at 0 and 24 hr
JohnHoltz
CC BY-SA 4.0
2024-10-03T17:36:00.033Z
3 - continued. and interpolating to find at what time t the required hour angle occurred. The Moon moves much faster and the change in RA and Dec are not linear. For the Moon (or other fast moving body) you can calculate the RA and Dec at three times (0, 12, 24 hr) and write a quadratic equation for the RA versus time and Dec vs time. Then the solution becomes a direct solution to the quadratic equation. If the Sun (or Moon) is circumpolar (or below the horizon) at 0 and 24 hrs based on declination, you know is it above (or below) the horizon all day long.
JohnHoltz
CC BY-SA 4.0
2024-10-01T20:02:37.773Z
2024-10-01T20:02:37.773Z
JohnHoltz
<p>I made a tool to get Noon, Sunrise, and Sunset times But sometimes errors appear like at:</p>
<p>Lat: N 67°8'5.07''</p>
<p>Long: W 121°10'17.93'</p>
<p>Date: 2024/06/14 15:07 (UTC-7)</p>
<p>Because there is no sunrise or sunset times at this location and date and all I need to specify the reason for these either &quot;the sun is circumpolar&quot; or &quot;The sun never rises&quot; to write it in the debug log.</p>
<p>So, Is there a way to know if the sun is <strong><code>circumpolar</code></strong> or <strong><code>never rises</code></strong> at a specific date and specific location?</p>

CC BY-SA 4.0
2024-09-30T15:50:23.983Z
How do you get the rise and set times? You surely have the geocentric coordinates of the Sun. Thus compare its declination value against the latitude
planetmaker
CC BY-SA 4.0
2024-09-30T15:54:24.297Z
Yes, I know it's Right Ascension, Declination, Altitude, and Azimuth at any date and location I want.
Ahmed Dyaa
CC BY-SA 4.0
2024-09-30T15:58:32.897Z
Should I compare it's declination value against the latitude for both cases? And what is the formula for comparison?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-30T16:49:39.903Z
What "error" are you getting? I think the error tells you that there is no Sunrise.
JohnHoltz
CC BY-SA 4.0
2024-09-30T16:57:14.093Z
Yes, so I need to specify the reason either "sun is circumpolar" or "The sun never rises" to write it in the debug log.
Ahmed Dyaa
CC BY-SA 4.0
2024-09-30T18:14:15.500Z
In your equations that calculate Altitude from RA & Declination, when the sun doesn't rise or doesn't set you'll get a step where you need to get the arccos of a value that's not in the range [-1, 1]. So you need to test that value before you try to calculate its arccos (or use some kind of exception handling).
PM 2Ring
CC BY-SA 4.0
2024-10-01T14:03:17.670Z
@PM2Ring I'm sorry, I don't understand what you're saying.
Ahmed Dyaa
CC BY-SA 4.0
2024-10-01T16:30:07.303Z
The equation for calculating the altitude angle from the latitude, declination and hour angle uses the inverse sine or inverse cosine function. See https://en.wikipedia.org/wiki/Astronomical_coordinate_systems#Equatorial_%E2%86%94_horizontal How are you calculating the Sun's altitude and azimuth?
PM 2Ring
CC BY-SA 4.0
2024-10-01T16:44:02.410Z
I calculate Julian Day then Julian centuries since 2000/01/01 at 12 UT, then the ecliptic longitude of the Sun, then I convert the ecliptic longitude to right ascension and declination, then I compute the sidereal time (degree) at Greenwich, then local sidereal time at longitude 10° E and local hour angle, then I convert (local hour angle, declination) to horizon coordinates (Altitude, Azimuth) of the observer
Ahmed Dyaa
<the-sun><sunrise><sunset>
How to Know if the sun is circumpolar or never rises?
Ahmed Dyaa
# How to Know if the sun is circumpolar or never rises?

(Asked by: username_0 on 2024-09-30)

I made a tool to get Noon, Sunrise, and Sunset times But sometimes errors appear like at:

Lat: N 67°8'5.07''

Long: W 121°10'17.93'

Date: 2024/06/14 15:07 (UTC-7)

Because there is no sunrise or sunset times at this location and date and all I need to specify the reason for these either "the sun is circumpolar" or "The sun never rises" to write it in the debug log.

So, Is there a way to know if the sun is **`circumpolar`** or **`never rises`** at a specific date and specific location?

**Tags:** the-sun, sunrise, sunset

> **Comments:**
> **username_1**: How do you get the rise and set times? You surely have the geocentric coordinates of the Sun. Thus compare its declination value against the latitude  
> **username_0**: Yes, I know it's Right Ascension, Declination, Altitude, and Azimuth at any date and location I want.  
> **username_0**: Should I compare it's declination value against the latitude for both cases? And what is the formula for comparison?  
> **username_2**: What "error" are you getting? I think the error tells you that there is no Sunrise.  
> **username_0**: Yes, so I need to specify the reason either "sun is circumpolar" or "The sun never rises" to write it in the debug log.  
> **username_3**: In your equations that calculate Altitude from RA & Declination, when the sun doesn't rise or doesn't set you'll get a step where you need to get the arccos of a value that's not in the range [-1, 1]. So you need to test that value before you try to calculate its arccos (or use some kind of exception handling).  
> **username_0**: @username_3 I'm sorry, I don't understand what you're saying.  
> **username_3**: The equation for calculating the altitude angle from the latitude, declination and hour angle uses the inverse sine or inverse cosine function. See https://en.wikipedia.org/wiki/Astronomical_coordinate_systems#Equatorial_%E2%86%94_horizontal How are you calculating the Sun's altitude and azimuth?  
> **username_0**: I calculate Julian Day then Julian centuries since 2000/01/01 at 12 UT, then the ecliptic longitude of the Sun, then I convert the ecliptic longitude to right ascension and declination, then I compute the sidereal time (degree) at Greenwich, then local sidereal time at longitude 10° E and local hour angle, then I convert (local hour angle, declination) to horizon coordinates (Altitude, Azimuth) of the observer  

---

## 1 answers

### Answer by username_2 on 2024-10-01. Score: 3

The declination and latitude are sufficient to determine if an object rises and sets, is circumpolar, or never rises. Based on the following figure for the northern hemisphere,

* The object is circumpolar if the declination is closer to the pole than 90-latitude.
* The object never rises if the declination is farther from the equator than latitude-90.
* The object rises and sets if the declination is between those extremes.

If including atmospheric refraction, the declination needs to be adjusted so that the refracted object has 0 altitude when it touches the horizon.

The diameter of the Sun also needs to be included so that the top limb, not the center, appears at 0 altitude when it touches the horizon.

[![Cut through the sky along the plane of the meridian](https://i.sstatic.net/BOFGPwHz.png)](https://i.sstatic.net/BOFGPwHz.png)

> **Comments:**
> **username_0**: Thanks for you answer, 1- so if `declination >= 90 - |Latitude|` the sun must be circumpolar, and if `declination > |Latitude| - 90` the sun must never rise? 2- and if I had the atmospheric refraction value I should recalculate the declination as `adjustedDeclination = declination - atmospheric refraction` before checking? 3- declination's value changes throughout the day so at what time should I check if the sun is circumpolar or never rises?  
> **username_2**: 1 - close except you need to consider the sign of the declination also. May be easier to use If Lat >0 then ... else ....End If than try to create 1 equation that covers both hemispheres. 2 - is correct, and you can subtract the semi-diameter if you do not account for that elsewhere. (continued)  
> **username_2**: 3- The Sun moves more in right ascension per day than in declination. You need to compensate for the RA, too. Ideally you use the RA and Dec at the time of rise, time of transit, and time of set. Some how I derived a linear equation (many years ago) to interpolate the times based on the RA and Dec at 0 hr and 24 hr. For example, RA = RA0+(RA24-RA0)/24*t. Transit is easy since (sidereal time)-(RA) = 0. This gives (sidereal time at 0 + 1.00273*t)-(RA0+(RA24-RA0)/24*t)=0. Solve for t. I probably did something similar for rising and setting by calculating what hour angle was needed at 0 and 24 hr  
> **username_2**: 3 - continued. and interpolating to find at what time t the required hour angle occurred. The Moon moves much faster and the change in RA and Dec are not linear. For the Moon (or other fast moving body) you can calculate the RA and Dec at three times (0, 12, 24 hr) and write a quadratic equation for the RA versus time and Dec vs time. Then the solution becomes a direct solution to the quadratic equation. If the Sun (or Moon) is circumpolar (or below the horizon) at 0 and 24 hrs based on declination, you know is it above (or below) the horizon all day long.  

---

