<p>Yes, this is the correct approach.  The $h$ in the equation is the altitude above the horizon of the object at which you consider it to be rising or setting.  This is typically non-zero, because of atmospheric refraction, and, in the case of the Sun or the Moon, because of their finite diameters.  In your case, the object 'rises' when it climbes above $h=30^\circ$ and 'sets' when it drops below that altitude.</p>

<p>If $\left|\cos(LHA)\right|&gt;1$, there is no solution, because your object never crosses the $h=30^\circ$ line.  $LHA$ is the <em>local hour angle</em>, and you can find the <em>local sidereal time</em> $\theta$ using</p>

<p>$LHA = \theta - \alpha,$</p>

<p>where $\alpha$ is the right ascension of your object.</p>

CC BY-SA 3.0
2016-07-18T20:23:11.520Z
2016-07-18T20:23:11.520Z
AstroFloyd
<p>The answer is there on the <a href="http://www.stjarnhimlen.se/comp/riset.html" rel="nofollow">stjarnhimlen.se site</a> and also <a href="http://www.stargazing.net/kepler/altaz.html" rel="nofollow">stargazing.net</a>.  </p>

<blockquote>
  <p>Now we can compute the Sun's altitude above the horizon:</p>

<pre><code>sin(h) = sin(lat) * sin(Decl) + cos(lat) * cos(Decl) * cos(LHA)
LHA = LST - RA
</code></pre>
</blockquote>

<p>h=Altitude=30$^\circ$,
LHA = Local Hour Angle,
lat= Your latitude on Earth,
Decl = Object's declination,
Ra = Object's right ascension, and
LST = Local Standard Time. 
Just need to solve for LST. </p>

CC BY-SA 3.0
2015-06-15T20:11:42.333Z
2015-06-15T20:11:42.333Z
eshaya
<p>You're not saying what programming language you're using. If it's Python, or if you could link Python libraries from it, then PyEphem would provide everything you need.</p>

<p><a href="http://rhodesmill.org/pyephem/" rel="nofollow">http://rhodesmill.org/pyephem/</a></p>

CC BY-SA 3.0
2015-07-16T17:43:38.277Z
2015-07-16T17:43:38.277Z
Florin Andrei
<p>To find the best observation time for an object, I'd like to calculate the time when it is 30° or more above the horizon. Local Sideral Time would be sufficient.</p>

<p>To include that in my program, I need the formula.</p>

<p>Example:
On June 4th, Jupiter has the coordinates
RA= 9h 19m 28.0s
Dekl= 16° 32' 0"</p>

<p>It rises at 10:32 and sets at 00:05.</p>

<p>After rise, when is it at altitude 30°, and after transit, when is it at altitude 30° again ?</p>

<hr>

<p>I found this formula at <a href="http://www.stjarnhimlen.se/comp/riset.html" rel="nofollow noreferrer">http://www.stjarnhimlen.se/comp/riset.html</a>. Although it's for the sun, it seems to be what I'm looking for.</p>

<p>$$\cos (\text{LHA}) = \frac{\sin (\text{h}) - \sin (\text{lat}) \times \sin (\text{Decl})}{\cos (\text{lat}) \times \cos (\text{Decl})}$$</p>

<p>Applied to the sample assuming a latitude of 45° I get.</p>

<p><img src="https://i.sstatic.net/KW7yI.png" alt="Sample caluclation">
<br/>Is this the correct approach?</p>

CC BY-SA 3.0
2015-06-04T09:01:44.690Z
Check out [catserver.ing.iac.es/staralt](http://catserver.ing.iac.es/staralt/).
pela
CC BY-SA 3.0
2015-06-04T09:04:37.977Z
Thanks, but I need the formula, not a tool.
ratlan
CC BY-SA 3.0
2015-06-04T12:41:08.283Z
The earth rotates 15 degrees every hour.
andy256
CC BY-SA 3.0
2015-06-04T12:52:27.510Z
15 degrees per hour: That's one part of the formula.
ratlan
CC BY-SA 3.0
2015-06-04T12:59:12.007Z
I think you'd better explain what you know about the object(s) you want to observe. It's not at all clear what it is you don't understand. Given the coordinates of an object and the date, time, latitude and longitude, these are straight forward coordinate translations.
andy256
CC BY-SA 3.0
2015-06-04T15:12:21.043Z
@andy256 Thanks for your comment. I added an example to clarify my question. In the meantime I found a formula, but I'm not sure if I'm doing it right.
ratlan
CC BY-SA 3.0
2015-06-05T06:51:21.830Z
@barrycarter Thanks. Comparing with Stellarium will not proove this is the correct approach. However if no one here neither posts an answer nor confirms the formula, I will test all relevant scenarios and hope for the best. The formula you mention would probably work, but as a non-mathematician I'm not able to bring d1 to the left side of the equation. Further the problem described requires two results. One when object rises, and one when it us about to set. In addition to that there are two special cases to be handled: 1)The object never gets below 30deg 2)The object never gets above 30deg.
ratlan
CC BY-SA 3.0
2015-06-10T23:46:00.970Z
You might want to look into PyEphem (if you're developing in Python) or its underpinning library libastro (if in C). http://rhodesmill.org/pyephem/
Russell Borogove
<observational-astronomy><fundamental-astronomy><positional-astronomy>
Calculate time when star is above altitude 30°
ratlan
# Calculate time when star is above altitude 30°

(Asked by: username_0 on 2015-06-04)

To find the best observation time for an object, I'd like to calculate the time when it is 30° or more above the horizon. Local Sideral Time would be sufficient.

To include that in my program, I need the formula.

Example:
On June 4th, Jupiter has the coordinates
RA= 9h 19m 28.0s
Dekl= 16° 32' 0"

It rises at 10:32 and sets at 00:05.

After rise, when is it at altitude 30°, and after transit, when is it at altitude 30° again ?

---

I found this formula at <http://www.stjarnhimlen.se/comp/riset.html>. Although it's for the sun, it seems to be what I'm looking for.

$$\cos (\text{LHA}) = \frac{\sin (\text{h}) - \sin (\text{lat}) \times \sin (\text{Decl})}{\cos (\text{lat}) \times \cos (\text{Decl})}$$

Applied to the sample assuming a latitude of 45° I get.

![Sample caluclation](https://i.sstatic.net/KW7yI.png)
  
Is this the correct approach?

**Tags:** observational-astronomy, fundamental-astronomy, positional-astronomy

> **Comments:**
> **username_1**: Check out [catserver.ing.iac.es/staralt](http://catserver.ing.iac.es/staralt/).  
> **username_0**: Thanks, but I need the formula, not a tool.  
> **username_2**: The earth rotates 15 degrees every hour.  
> **username_0**: 15 degrees per hour: That's one part of the formula.  
> **username_2**: I think you'd better explain what you know about the object(s) you want to observe. It's not at all clear what it is you don't understand. Given the coordinates of an object and the date, time, latitude and longitude, these are straight forward coordinate translations.  
> **username_0**: @username_2 Thanks for your comment. I added an example to clarify my question. In the meantime I found a formula, but I'm not sure if I'm doing it right.  
> **username_0**: @barrycarter Thanks. Comparing with Stellarium will not proove this is the correct approach. However if no one here neither posts an answer nor confirms the formula, I will test all relevant scenarios and hope for the best. The formula you mention would probably work, but as a non-mathematician I'm not able to bring d1 to the left side of the equation. Further the problem described requires two results. One when object rises, and one when it us about to set. In addition to that there are two special cases to be handled: 1)The object never gets below 30deg 2)The object never gets above 30deg.  
> **username_3**: You might want to look into PyEphem (if you're developing in Python) or its underpinning library libastro (if in C). http://rhodesmill.org/pyephem/  

---

## 3 answers

### Answer by username_4 on 2016-07-18. Score: 2

Yes, this is the correct approach. The $h$ in the equation is the altitude above the horizon of the object at which you consider it to be rising or setting. This is typically non-zero, because of atmospheric refraction, and, in the case of the Sun or the Moon, because of their finite diameters. In your case, the object 'rises' when it climbes above $h=30^\circ$ and 'sets' when it drops below that altitude.

If $\left|\cos(LHA)\right|>1$, there is no solution, because your object never crosses the $h=30^\circ$ line. $LHA$ is the *local hour angle*, and you can find the *local sidereal time* $\theta$ using

$LHA = \theta - \alpha,$

where $\alpha$ is the right ascension of your object.


---

### Answer by username_5 on 2015-06-15. Score: 1

The answer is there on the [stjarnhimlen.se site](http://www.stjarnhimlen.se/comp/riset.html) and also [stargazing.net](http://www.stargazing.net/kepler/altaz.html).

> Now we can compute the Sun's altitude above the horizon:
>
> ```
> sin(h) = sin(lat) * sin(Decl) + cos(lat) * cos(Decl) * cos(LHA)
> LHA = LST - RA
>
> ```

h=Altitude=30$^\circ$,
LHA = Local Hour Angle,
lat= Your latitude on Earth,
Decl = Object's declination,
Ra = Object's right ascension, and
LST = Local Standard Time.
Just need to solve for LST.


---

### Answer by username_6 on 2015-07-16. Score: 0

You're not saying what programming language you're using. If it's Python, or if you could link Python libraries from it, then PyEphem would provide everything you need.

<http://rhodesmill.org/pyephem/>


---

