Calculate time when star is above altitude 30° 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.


Is this the correct approach?
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|&gt;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.