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.81k stars 825 forks source link

Make HipsMgr visible to/part of the scripting API #3613

Open Starvexx opened 10 months ago

Starvexx commented 10 months ago

I have recently started to write scripts to generate a brief Stellarium show as part of the outreach module for the research project I am working on. In the first stage of our outreach module, we created HiPS surveys that are hosted on our project's Homepage, available through aladin light and also importable to aladin Desktop. The next stage of the outreach module includes, as mentioned above, the creation of a brief Stellarium show featuring our image material. Since Stellarium can render Healpix surveys, the easiest way would be to load these HiPS surveys into Stellarium and toggle the HiPS layers when needed. However, the HipsMgr class is not accessible through the scripting language, hence I am unable to toggle the HiPS Sky images from inside the script.

Suggested solution: Make the HipsMgr accessible through the scripting API so that the HiPS layer could be turned on and off, e.g. as follows:

HipsMgr.setFlagShow(true); // Turn HiPS layers on.
core.wait(10); // Wait 10 seconds for the viewer to appreciate the wonderful image in the HiPS surveys.
HipsMgr.setFlagShow(false); // Turn HiPS layers off.

Another quality of life improvement by making the HipsMgr part of the scripting API would be to easily import Healpix surveys into Stellarium via the scripting interface, e.g. something similar to what follows:

HipsMgr.getSurveyByUrl(id="OrionA", url="https://nemesis.univie.ac.at/wp-content/hips_surveys/NEMESIS-Orion_A_full_png-i124"); // Load new HiPS survey and assign ID
HipsMgr.setVisible(id="OrionA", true); // make the survey visible
core.wait(10); // Let the viewer appreciate the beautiful images.
HipsMgr.setVisible(id="OrionA", false); // Hide the survey
HipsMgr.removeSurvey(id="OrionA"); // remove the survey
github-actions[bot] commented 10 months ago

Thanks for adding your first issue to Stellarium. If you have questions, please do not hesitate to contact us.

github-actions[bot] commented 10 months ago

Hello @Starvexx!

Thank you for suggesting this enhancement.

alex-w commented 9 months ago

Hello @Starvexx!

Please check the fresh version (development snapshot) of Stellarium: https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot