Connecting Stellarium script to mySQL database

Asked by Adam Tartanto

Hi all,

I am attempting to loop through a large number of queries and would like to save the results of each loop somewhere for later analysis.

Is it possible to connect to a mySQL db from within a Stellarium script?

Alternatively I would be happy to dump all output from my script into a .txt file.

If either of these methods are possible a worked example would be greatly appreciated - I am new to the stellarium syntax.

Cheers,

Adam

Question information

Language:
English Edit question
Status:
Solved
For:
Stellarium Edit question
Assignee:
No assignee Edit question
Solved by:
Khalid AlAjaji
Solved:
Last query:
Last reply:
Revision history for this message
Best Khalid AlAjaji (kajaji) said :
#1

Stellarium scripts do not write to output files nor they can be connected to mySQL db.

But there is a workaround using the script console, with the following conditions:

Use Stellarium 0.1.1.3

Use the function core.getObjectPosition("Moon") in place of core.getObjectInfo("Moon") which is not supported by 0.11.3

The core.getObjectPosition("Moon") is limited with the following parameters:

altitude : apparent altitude angle in decimal degrees
azimuth : apparent azimuth angle in decimal degrees
altitude-geometric : geometric altitude angle in decimal degrees
azimuth-geometric : geometric azimuth angle in decimal degrees
ra : right ascension angle (current date frame) in decimal degrees
dec : declenation angle in (current date frame) decimal degrees
raJ2000 : right ascension angle (J2000 frame) in decimal degrees
decJ2000 : declenation angle in (J2000 frame) decimal degrees

Script console can invoked by [F12] key

Use core.debug function to output your results, and they will be written to the script console output area.

copy and paste to a txt file.

The reason you cannot do this in 0.11.4 or the latest test release is this bug: https://bugs.launchpad.net/stellarium/+bug/1075328

Revision history for this message
Adam Tartanto (adam-p-taranto) said :
#2

Thanks Khalid AlAjaji, that solved my question.