Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Stellarium Scripting - get ecliptic lat/long of constellation boundaries?

Software
  • Please log in to reply
4 replies to this topic

#1 beanfrog

beanfrog

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 13 Dec 2024

Posted 12 March 2025 - 05:15 PM

Hello,

I'm working on a Stellarium Script to help with something we're doing in class(Astrophysics). 

Does anyone know if there's a way to get the ecliptic latitude and longitude of the boundaries of a given constellation?
Pic related, I'm hoping to figure out where the boundaries cross the ecliptic. For reference if necessary, this is to locate where a planet is within a constellation, as I am able to get a planet's ecliptic position.

Looking at the ConstellationMgr docs (https://stellarium.o...llationMgr.html), there are flags to get whether or not the lines are enabled, and to select all constellations (from what I can see, no way to select just one?)

Someone with more experience here, is what I'm asking even possible through the scripting engine?
 

Thanks!

Attached Thumbnails

  • 2025-03-12T15:00:57,076860509-07:00.png


#2 triplemon

triplemon

    Apollo

  • *****
  • Posts: 1,456
  • Joined: 07 Nov 2023
  • Loc: Portland, OR

Posted 12 March 2025 - 06:02 PM

All scripting API functions in Stellarium are geared towards controlling on-screen display, not querying a database and certainly not doing spherical math computations.

At most you can take the constellation boundary definitions on disk and use it to calculate your own intersections.
Or, likely more involved, write a plugin in c++ to access the datastructures underlying the on-screen displays.

 

A easier way would be to get constellation boundaries from the web, so ask google 
https://www.google.c...undary polygons

The University of Strasbourg is likely the single biggest treasure chest of open source astronomy data and code. Its where stellariums constellation data comes from.
https://cdsarc.cds.u...z-bin/cat/VI/49

 

If you're into coding - for most problems in life your're likely not the first to have to solve them, so always look at StackExchange first
https://astronomy.st...tial-body-is-in


 


Edited by triplemon, 12 March 2025 - 06:41 PM.

  • gzotti and beanfrog like this

#3 beanfrog

beanfrog

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 13 Dec 2024

Posted 12 March 2025 - 10:46 PM

All scripting API functions in Stellarium are geared towards controlling on-screen display, not querying a database and certainly not doing spherical math computations.

At most you can take the constellation boundary definitions on disk and use it to calculate your own intersections.
Or, likely more involved, write a plugin in c++ to access the datastructures underlying the on-screen displays.

 

A easier way would be to get constellation boundaries from the web, so ask google 
https://www.google.c...undary polygons

The University of Strasbourg is likely the single biggest treasure chest of open source astronomy data and code. Its where stellariums constellation data comes from.
https://cdsarc.cds.u...z-bin/cat/VI/49

 

If you're into coding - for most problems in life your're likely not the first to have to solve them, so always look at StackExchange first
https://astronomy.st...tial-body-is-in


 

Thanks - the stackexchange discussion led me to a few helpful-looking json files.
I know some basic c++, I'll probably end up trying that. Thanks for pointing me in the right direction, I'm pretty new to Stellarium and astronomy in general.


  • triplemon likes this

#4 gzotti

gzotti

    Stellarium

  • -----
  • Vendors
  • Posts: 188
  • Joined: 20 Mar 2017
  • Loc: Vienna, Austria

Posted 13 March 2025 - 05:47 PM

If you retrieve planet data (core.getObjectInfo("Mars") or so), key iauConstellation includes the object's constellation.



#5 beanfrog

beanfrog

    Lift Off

  • -----
  • topic starter
  • Posts: 3
  • Joined: 13 Dec 2024

Posted 18 March 2025 - 11:36 PM

Hello all - just wanted to give an update

I was able to get some rough Ra/Dec values from https://www.cantab.n...ery/zodiac.html which required a little bit of manual tweaking.
They're definitely not astrophotography levels of accurate, but as I'm just approximating some distances they're perfectly fine.

as triplemon noted, Stellarium scripting is definitely not the best for spherical computations, but I ended up making a couple of simple calculations work to a reasonable degree of accuracy.

All I really needed was the angular separation in radians, which isn't difficult:

where (α11) and (α22) are points (ra, dec)
cosΘ = sin(δ1)sin(δ2) + cos(δ1)cos(δ2)cos(α2 - α1)
Θ = arccos(cos(Θ))

As I believe I mentioned, the object of this script is to approximate an objects position within constellation boundaries, which I'm doing using an array where the closest index is replaced with a dot to represent the object.

I've attached a photo of what that ends up looking like.

I'm posting this to share what I learned and if someone has similar needs, whether in high school astrophysics like myself, or anything else.

You can find the script on my GitHub at https://github.com/b...sp-tracking.ssc

(edit: add image)

Attached Thumbnails

  • 2025-03-19T07:49:17,178359668-07:00.png

Edited by beanfrog, 19 March 2025 - 09:52 AM.



CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics





Also tagged with one or more of these keywords: Software



Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics