Gaia Sky offers the possibility to run
Python scripts in the same
JVM using Jython.
You can find some example scripts in the scripts folder of the project.
Add your own scripts to the folder
$HOME/.gaiasky/scripts so that Gaia Sky can run them.
An interface is provided in order to encapsulate some complex-behaviour functions and to make scripting easier. This scripting interface is described in the following section.
The scripting API¶
The scripting API is a set of methods which can be called to interact with Gaia Sky. The available methods differ depending on the version of Gaia Sky.
The only up-to-date API documentation for each version is in the interface header files themselves. Below is a list of links to the different APIs.
Using the scripting API¶
In order to import the scripting interface package in your script, you
just need to import the default implementation
EventScriptingInterface from the package
# Import scripting interface from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
Then, we need to get the scripting interface instance before start using it.
gs = EventScriptingInterface.instance()
Now, we can start executing functions.
# Disable input gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() # Welcome gs.setHeadlineMessage("Welcome to the Gaia Sky") gs.setSubheadMessage("Explore Gaia, the Solar System and the whole Galaxy!") [...]