Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.56k stars 815 forks source link

Calculate time for observing an object #3268

Open marcmayo opened 1 year ago

marcmayo commented 1 year ago

Currently, there is a function that returns the time when a star rises above the horizon, respectively 0.00001° above the horizon. Although such stars or objects can't be observed, we believe to observe an object it should at least be around 10-15° above the horizon, depending on the altitude/light pollution where the observer is. Also, we'd like to count in the sun's position (should be at least 6° below the horizon, so it's dark enough to observe.)

Any idea how we could alter the Vec4d StelObject::getRTSTime to do the above?

Would changing this ho = altitude*M_PI_180;

to ho = 6*M_PI_180; (6 degrees) be suitable to calculate an object above 6 degrees?

Also, we'd have to check if the sun is settled, which means it'd be quite a lot of iterations. Any clue on how to solve it?

gzotti commented 1 year ago

Apply models from the same literature we are using (see the Guide for references). When a few more bugs will have been fixed, I hope I can find time for such visibility criteria. You can have a look into the Observability plugin which I'd however remake from scratch (code is not very reader friendly...)

Our documentation in StelObject.hpp describes the function, including an optional argument "altitude" which is h0 used in some algorithm books:


    //! Compute time of rise, transit and set for celestial object for current location.
    //! @param core the currently active StelCore object
    //! @param altitude (optional; default=0) altitude of the object, degrees.
    //!        Setting this to -6. for the Sun will find begin and end for civil twilight.
    //! @return Vec4d - time of rise, transit and set closest to current time; JD.
    //! @note The fourth element flags particular conditions:
    //!       *  +100. for circumpolar objects. Rise and set give lower culmination times.
    //!       *  -100. for objects never rising. Rise and set give transit times.
    //!       * -1000. is used as "invalid" value. The result should then not be used.
    //! @note This is an abbreviated version of the method implemented in the Planet class.
    virtual Vec4d getRTSTime(const StelCore* core, const double altitude=0.) const;
alex-w commented 1 year ago

@gzotti I think we may add new optional parameter (artificial horizon) and new column (time for observing) into AstroCalc/RTS tool, but this feature will be not scriptable. What you think?

gzotti commented 1 year ago

I am afraid users would see this as "guaranteed to be visible". There are many factors which govern visibility. Point source vs. extended object (and then contrast against local sky background), eyesight, experience, solar altitude, air quality, object altitude, light pollution, to name a few. RTS data in almanachs mean cutting the mathematical horizon, regardless of visibility.

You could use a custom altitude for RTS calculation. Just keep the special cases available for sun & moon. Then add even more flags/settings to allow using sun/moon centre or lower limbs (to allow "sunrise=time when sun is sitting above horizon"). Then perform user testing and find users overwhelmed by too many buttons. We could try apparent-RTS with landscape opacity test as next challenge instead.

alex-w commented 1 year ago

OK. I'm working for an AstroCalc/Almanac tool (episodically, so, a low speed of progress) and this task ("estimated time for observing") may be a good sub-tool for it (with extra flags/buttons).

nik-nenkov commented 8 months ago

This makes so much sense! People loose so much time on other websites and platforms! The pure joy of using your brain to solve actual practical problems can not be matched!