Stellarium 0.13.3
List of all members | Public Slots | Signals | Public Member Functions | Properties
StelMainScriptAPI Class Reference

Provide script API for Stellarium global functions. More...

#include <StelMainScriptAPI.hpp>

Public Slots

void setJDay (double JD)
 Set the current date in Julian Day. More...
 
double getJDay () const
 Get the current date in Julian Day. More...
 
void setMJDay (double MJD)
 Set the current date in Modified Julian Day. More...
 
double getMJDay () const
 Get the current date in Modified Julian Day. More...
 
void setDate (const QString &dt, const QString &spec="utc", const bool &enableDeltaT=true)
 set the date in ISO format, e.g. More...
 
QString getDate (const QString &spec="utc")
 get the simulation date and time as a string in ISO format, e.g. More...
 
QString getDeltaT () const
 get the DeltaT for the simulation date and time as a string in HMS format, e.g. More...
 
QString getDeltaTAlgorithm () const
 get the DeltaT equation name for the simulation date and time as a string More...
 
void setDeltaTAlgorithm (QString algorithmName)
 set equation of the DeltaT for the simulation date and time More...
 
void setTimeRate (double ts)
 Set time speed in JDay/sec. More...
 
double getTimeRate () const
 Get simulation time rate. More...
 
bool isRealTime ()
 Get the simulation time and rate state - is it "real time". More...
 
void setRealTime ()
 Set the simulation time to the current system time, and the time rate to 1. More...
 
void selectObjectByName (const QString &name, bool pointer=false)
 Select an object by name. More...
 
QVariantMap getObjectPosition (const QString &name)
 Fetch a map with data about an object's position, magnitude and so on. More...
 
QVariantMap getObjectInfo (const QString &name)
 Fetch a map with data about an object's position, magnitude and so on. More...
 
QVariantMap getSelectedObjectInfo ()
 Fetch a map with data about an latest selected object's position, magnitude and so on. More...
 
void clear (const QString &state="natural")
 Clear the display options, setting a "standard" view. More...
 
double getViewAltitudeAngle ()
 Get the current viewing direction altitude angle at center of view. More...
 
double getViewAzimuthAngle ()
 Get the current viewing direction azimuth angle at center of view. More...
 
double getViewRaAngle ()
 Get the current viewing direction Right Ascension at center of view. More...
 
double getViewDecAngle ()
 Get the current viewing direction Declination angle at center of view. More...
 
double getViewRaJ2000Angle ()
 Get the current viewing direction Right Ascension in J2000 frame at center of view. More...
 
double getViewDecJ2000Angle ()
 Get the current viewing direction Declination angle in J2000 frame at center of view. More...
 
void moveToAltAzi (const QString &alt, const QString &azi, float duration=1.)
 move the current viewing direction to some specified altitude and azimuth angles may be specified in a format recognised by StelUtils::getDecAngle() More...
 
void moveToRaDec (const QString &ra, const QString &dec, float duration=1.)
 move the current viewing direction to some specified right ascension and declination angles may be specified in a format recognised by StelUtils::getDecAngle() More...
 
void moveToRaDecJ2000 (const QString &ra, const QString &dec, float duration=1.)
 move the current viewing direction to some specified right ascension and declination in the J2000 frame angles may be specified in a format recognised by StelUtils::getDecAngle() More...
 
void setObserverLocation (double longitude, double latitude, double altitude, double duration=1., const QString &name="", const QString &planet="")
 Set the observer location. More...
 
void setObserverLocation (const QString id, float duration=1.)
 Set the location by the name of the location. More...
 
QString getObserverLocation ()
 Get the ID of the current observer location. More...
 
QVariantMap getObserverLocationInfo ()
 Get the info of the current observer location. More...
 
void screenshot (const QString &prefix, bool invert=false, const QString &dir="")
 Save a screenshot. More...
 
void setGuiVisible (bool b)
 Show or hide the GUI (toolbars). More...
 
void setMinFps (float m)
 Set the minimum frames per second. More...
 
float getMinFps ()
 Get the current minimum frames per second. More...
 
void setMaxFps (float m)
 Set the maximum frames per second. More...
 
float getMaxFps ()
 Get the current maximum frames per second. More...
 
QString getMountMode ()
 Get the mount mode as a string. More...
 
void setMountMode (const QString &mode)
 Set the mount mode. More...
 
bool getNightMode ()
 Get the current status of Night Mode. More...
 
void setNightMode (bool b)
 Set the status of Night Mode. More...
 
QString getProjectionMode ()
 Get the current projection mode ID string. More...
 
void setProjectionMode (const QString &id)
 Set the current projection mode. More...
 
bool getDiskViewport ()
 Get the status of the disk viewport. More...
 
void setDiskViewport (bool b)
 Set the disk viewport. More...
 
void setSphericMirror (bool b)
 Set the viewport distortion effect. More...
 
QStringList getAllSkyCultureIDs ()
 Get a list of Sky Culture IDs. More...
 
QString getSkyCulture ()
 Find out the current sky culture. More...
 
void setSkyCulture (const QString &id)
 Set the current sky culture. More...
 
QString getSkyCultureName ()
 Find out the current sky culture and get it English name. More...
 
QString getSkyCultureNameI18n ()
 Find out the current sky culture and get it localized name. More...
 
bool getFlagGravityLabels ()
 Get the current status of the gravity labels option. More...
 
void setFlagGravityLabels (bool b)
 Turn on/off gravity labels. More...
 
void loadSkyImage (const QString &id, const QString &filename, double ra0, double dec0, double ra1, double dec1, double ra2, double dec2, double ra3, double dec3, double minRes=2.5, double maxBright=14, bool visible=true)
 Load an image which will have sky coordinates. More...
 
void loadSkyImage (const QString &id, const QString &filename, const QString &ra0, const QString &dec0, const QString &ra1, const QString &dec1, const QString &ra2, const QString &dec2, const QString &ra3, const QString &dec3, double minRes=2.5, double maxBright=14, bool visible=true)
 Convenience function which allows the user to provide RA and DEC angles as strings (e.g. More...
 
void loadSkyImage (const QString &id, const QString &filename, double ra, double dec, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true)
 Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More...
 
void loadSkyImage (const QString &id, const QString &filename, const QString &ra, const QString &dec, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true)
 Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More...
 
void loadSkyImageAltAz (const QString &id, const QString &filename, double alt0, double azi0, double alt1, double azi1, double alt2, double azi2, double alt3, double azi3, double minRes=2.5, double maxBright=14, bool visible=true)
 Load an image which will have sky coordinates. More...
 
void loadSkyImageAltAz (const QString &id, const QString &filename, double alt, double azi, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true)
 Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More...
 
void removeSkyImage (const QString &id)
 Remove a SkyImage. More...
 
void loadSound (const QString &filename, const QString &id)
 Load a sound from a file. More...
 
void playSound (const QString &id)
 Play a sound which has previously been loaded with loadSound. More...
 
void pauseSound (const QString &id)
 Pause a sound which is playing. More...
 
void stopSound (const QString &id)
 Stop a sound from playing. More...
 
void dropSound (const QString &id)
 Drop a sound from memory. More...
 
void loadVideo (const QString &filename, const QString &id, float x, float y, bool show, float alpha)
 Load a video from a file. More...
 
void playVideo (const QString &id)
 Play a video which has previously been loaded with loadVideo. More...
 
void pauseVideo (const QString &id)
 Pause a video which is playing. More...
 
void stopVideo (const QString &id)
 Stop a video from playing. More...
 
void dropVideo (const QString &id)
 Drop a video from memory. More...
 
void seekVideo (const QString &id, qint64 ms)
 Seeks a video to the requested time. More...
 
void setVideoXY (const QString &id, float x, float y)
 Sets the position of the video widget. More...
 
void setVideoAlpha (const QString &id, float alpha)
 Set the alpha value of a video when visible. More...
 
void resizeVideo (const QString &id, float w, float h)
 Resize the video widget to the specified width, height. More...
 
void showVideo (const QString &id, bool show)
 Set the visibility state of a video. More...
 
int getScreenWidth ()
 Get the screen width in pixels. More...
 
int getScreenHeight ()
 Get the screen height in pixels. More...
 
double getScriptRate ()
 Get the script execution rate as a multiple of normal execution speed. More...
 
void setScriptRate (double r)
 Set the script execution rate as a multiple of normal execution speed. More...
 
void pauseScript ()
 Pause the currently running script. More...
 
void setSelectedObjectInfo (const QString &level)
 Set the amount of selected object information to display. More...
 
void exit ()
 Stop the script. More...
 
void quitStellarium ()
 Close Stellarium. More...
 
void debug (const QString &s)
 print a debugging message to the console More...
 
void output (const QString &s)
 print an output message from script More...
 
QString getAppLanguage ()
 Get the current application language. More...
 
void setAppLanguage (QString langCode)
 Set the current application language. More...
 
QString getSkyLanguage ()
 Get the current sky language. More...
 
void setSkyLanguage (QString langCode)
 Set the current sky language. More...
 
void goHome ()
 Go to defaults position and direction of view. More...
 
void setMilkyWayVisible (bool b)
 Show or hide the Milky Way. More...
 
void setMilkyWayIntensity (double i)
 Set Milky Way intensity. More...
 
double getMilkyWayIntensity ()
 Get Milky Way intensity. More...
 
void setZodiacalLightVisible (bool b)
 Show or hide the Zodiacal Light. More...
 
void setZodiacalLightIntensity (double i)
 Set Zodiacal Light intensity. More...
 
double getZodiacalLightIntensity ()
 Get Zodiacal Light intensity. More...
 
double jdFromDateString (const QString &dt, const QString &spec)
 For use in setDate and waitFor For parameter descriptions see setDate(). More...
 
void wait (double t)
 Pauses the script for t milliseconds. More...
 
void waitFor (const QString &dt, const QString &spec="utc")
 Waits until a specified simulation date/time. More...
 

Signals

void requestLoadSkyImage (const QString &id, const QString &filename, double c1, double c2, double c3, double c4, double c5, double c6, double c7, double c8, double minRes, double maxBright, bool visible)
 
void requestLoadSkyImageAltAz (const QString &id, const QString &filename, double c1, double c2, double c3, double c4, double c5, double c6, double c7, double c8, double minRes, double maxBright, bool visible)
 
void requestRemoveSkyImage (const QString &id)
 
void requestLoadSound (const QString &filename, const QString &id)
 
void requestPlaySound (const QString &id)
 
void requestPauseSound (const QString &id)
 
void requestStopSound (const QString &id)
 
void requestDropSound (const QString &id)
 
void requestLoadVideo (const QString &filename, const QString &id, float x, float y, bool show, float alpha)
 
void requestPlayVideo (const QString &id)
 
void requestPauseVideo (const QString &id)
 
void requestStopVideo (const QString &id)
 
void requestDropVideo (const QString &id)
 
void requestSeekVideo (const QString &id, qint64 ms)
 
void requestSetVideoXY (const QString &id, float x, float y)
 
void requestSetVideoAlpha (const QString &id, float alpha)
 
void requestResizeVideo (const QString &id, float w, float h)
 
void requestShowVideo (const QString &id, bool show)
 
void requestSetNightMode (bool b)
 
void requestSetProjectionMode (QString id)
 
void requestSetSkyCulture (QString id)
 
void requestSetDiskViewport (bool b)
 
void requestExit ()
 
void requestSetHomePosition ()
 

Public Member Functions

 StelMainScriptAPI (QObject *parent=0)
 

Properties

double JDay
 
double timeSpeed
 

Detailed Description

Provide script API for Stellarium global functions.

Public slots in this class may be used in Stellarium scripts, and are accessed as member function to the "core" scripting object. Module-specific functions, such as setting and clearing of display flags (e.g. LandscapeMgr::setFlagAtmosphere) can be accessed directly via the scripting object with the class name, e.g. by using the scripting command: LandscapeMgr.setFlagAtmosphere(true);

Definition at line 35 of file StelMainScriptAPI.hpp.

Member Function Documentation

void StelMainScriptAPI::clear ( const QString &  state = "natural")
slot

Clear the display options, setting a "standard" view.

Preset states:

  • natural : azimuthal mount, atmosphere, landscape, no lines, labels or markers
  • starchart : equatorial mount, constellation lines, no landscape, atmosphere etc. labels & markers on.
  • deepspace : like starchart, but no planets, no eq.grid, no markers, no lines.
    Parameters
    statethe name of a preset state.
void StelMainScriptAPI::debug ( const QString &  s)
slot

print a debugging message to the console

Parameters
sthe message to be displayed on the console.
void StelMainScriptAPI::dropSound ( const QString &  id)
slot

Drop a sound from memory.

You should do this before the end of your script.

Parameters
idthe identifier used when loadSound was called
void StelMainScriptAPI::dropVideo ( const QString &  id)
slot

Drop a video from memory.

You should do this before the end of your script.

Parameters
idthe identifier used when loadVideo was called
void StelMainScriptAPI::exit ( )
slot

Stop the script.

QStringList StelMainScriptAPI::getAllSkyCultureIDs ( )
slot

Get a list of Sky Culture IDs.

Returns
a list of valid sky culture IDs
QString StelMainScriptAPI::getAppLanguage ( )
slot

Get the current application language.

Returns
two letter language code, e.g. "en", or "de" and so on.
QString StelMainScriptAPI::getDate ( const QString &  spec = "utc")
slot

get the simulation date and time as a string in ISO format, e.g.

"2008-03-24T13:21:01"

Parameters
specif "utc", the returned string's timezone is UTC, else it is local time.
Returns
the current simulation time.
QString StelMainScriptAPI::getDeltaT ( ) const
slot

get the DeltaT for the simulation date and time as a string in HMS format, e.g.

"0h1m68.2s"

Returns
the DeltaT for current simulation time.
QString StelMainScriptAPI::getDeltaTAlgorithm ( ) const
slot

get the DeltaT equation name for the simulation date and time as a string

Returns
name of the DeltaT equation
bool StelMainScriptAPI::getDiskViewport ( )
slot

Get the status of the disk viewport.

Returns
true if the disk view port is currently enabled
bool StelMainScriptAPI::getFlagGravityLabels ( )
slot

Get the current status of the gravity labels option.

Returns
true if gravity labels are enabled, else false
double StelMainScriptAPI::getJDay ( ) const
slot

Get the current date in Julian Day.

Returns
the Julian Date
float StelMainScriptAPI::getMaxFps ( )
slot

Get the current maximum frames per second.

Returns
The current maximum frames per secon setting.
double StelMainScriptAPI::getMilkyWayIntensity ( )
slot

Get Milky Way intensity.

Returns
value of Milky Way intensity, e.g. "1.2"
float StelMainScriptAPI::getMinFps ( )
slot

Get the current minimum frames per second.

Returns
The current minimum frames per secon setting.
double StelMainScriptAPI::getMJDay ( ) const
slot

Get the current date in Modified Julian Day.

Returns
the Modified Julian Date
QString StelMainScriptAPI::getMountMode ( )
slot

Get the mount mode as a string.

Returns
"equatorial" or "azimuthal"
bool StelMainScriptAPI::getNightMode ( )
slot

Get the current status of Night Mode.

Returns
true if night mode is currently set
QVariantMap StelMainScriptAPI::getObjectInfo ( const QString &  name)
slot

Fetch a map with data about an object's position, magnitude and so on.

Parameters
nameis the English name of the object for which data will be returned.
Returns
a map of object data. Keys:
  • 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 : declination angle in (current date frame) decimal degrees
  • raJ2000 : right ascension angle (J2000 frame) in decimal degrees
  • decJ2000 : declination angle in (J2000 frame) decimal degrees
  • glongJ2000 : galactic longitude (J2000 frame) in decimal degrees
  • glatJ2000 : galactic latitude in (J2000 frame) decimal degrees
  • vmag : visual magnitude
  • vmage : visual magnitude (extincted)
  • size: angular size in radians
  • size-dd : angular size in decimal degrees
  • size-deg : angular size in decimal degrees (formatted string)
  • size-dms : angular size in DMS format
  • localized-name : localized name
  • distance : distance to object in AU (for Solar system objects only!)
  • phase : phase of object (for Solar system objects only!)
  • illumination : phase of object in percentages (for Solar system objects only!)
  • phase-angle : phase angle of object in radians (for Solar system objects only!)
  • phase-angle-dms : phase angle of object in DMS (for Solar system objects only!)
  • phase-angle-deg : phase angle of object in decimal degrees (for Solar system objects only!)
  • elongation : elongation of object in radians (for Solar system objects only!)
  • elongation-dms : elongation of object in DMS (for Solar system objects only!)
  • elongation-deg : elongation of object in decimal degrees (for Solar system objects only!)
QVariantMap StelMainScriptAPI::getObjectPosition ( const QString &  name)
slot

Fetch a map with data about an object's position, magnitude and so on.

Parameters
nameis the English name of the object for which data will be returned.
Returns
a map of object data. Keys:
  • 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 : declination angle in (current date frame) decimal degrees
  • raJ2000 : right ascension angle (J2000 frame) in decimal degrees
  • decJ2000 : declination angle in (J2000 frame) decimal degrees
Deprecated:
Use getObjectInfo()
QString StelMainScriptAPI::getObserverLocation ( )
slot

Get the ID of the current observer location.

QVariantMap StelMainScriptAPI::getObserverLocationInfo ( )
slot

Get the info of the current observer location.

Returns
a map of object data. Keys:
  • altitude : altitude in meters
  • longitude : longitude in decimal degrees
  • latitude : latitude in decimal degrees
  • planet : name of planet
  • location : city and country
  • sidereal-year : duration of the sidereal year on the planet in Earth's days (since 0.12.0)
  • sidereal-day : duration of the sidereal day on the planet in Earth's hours (since 0.12.0)
  • solar-day : duration of the mean solar day on the planet in Earth's hours (since 0.12.0)
  • local-sidereal-time : local sidereal time on the planet in hours (since 0.13.3)
  • local-sidereal-time-hms : local sidereal time on the planet in hours in HMS format (since 0.13.3)
QString StelMainScriptAPI::getProjectionMode ( )
slot

Get the current projection mode ID string.

Returns
the string which identifies the current projection mode. For a list of possibl results, see setProjectionMode();
int StelMainScriptAPI::getScreenHeight ( )
slot

Get the screen height in pixels.

Returns
The screen height in pixels
int StelMainScriptAPI::getScreenWidth ( )
slot

Get the screen width in pixels.

Returns
The screen width in pixels
double StelMainScriptAPI::getScriptRate ( )
slot

Get the script execution rate as a multiple of normal execution speed.

Returns
the current script execution rate.
QVariantMap StelMainScriptAPI::getSelectedObjectInfo ( )
slot

Fetch a map with data about an latest selected object's position, magnitude and so on.

Returns
a map of object data. Keys:
  • 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 : declination angle in (current date frame) decimal degrees
  • raJ2000 : right ascension angle (J2000 frame) in decimal degrees
  • decJ2000 : declination angle in (J2000 frame) decimal degrees
  • glongJ2000 : galactic longitude (J2000 frame) in decimal degrees
  • glatJ2000 : galactic latitude in (J2000 frame) decimal degrees
  • vmag : visual magnitude
  • vmage : visual magnitude (extincted)
  • size: angular size in radians
  • size-dd : angular size in decimal degrees
  • size-deg : angular size in decimal degrees (formatted string)
  • size-dms : angular size in DMS format
  • name : english name
  • localized-name : localized name
  • distance : distance to object in AU (for Solar system objects only!)
  • phase : phase of object (for Solar system objects only!)
  • illumination : phase of object in percentages (for Solar system objects only!)
  • phase-angle : phase angle of object in radians (for Solar system objects only!)
  • phase-angle-dms : phase angle of object in DMS (for Solar system objects only!)
  • phase-angle-deg : phase angle of object in decimal degrees (for Solar system objects only!)
  • elongation : elongation of object in radians (for Solar system objects only!)
  • elongation-dms : elongation of object in DMS (for Solar system objects only!)
  • elongation-deg : elongation of object in decimal degrees (for Solar system objects only!)
QString StelMainScriptAPI::getSkyCulture ( )
slot

Find out the current sky culture.

Returns
the ID of the current sky culture (i.e. the name of the directory in which the curret sky cultures files are found, e.g. "western")
QString StelMainScriptAPI::getSkyCultureName ( )
slot

Find out the current sky culture and get it English name.

Returns
the English name of the current sky culture
QString StelMainScriptAPI::getSkyCultureNameI18n ( )
slot

Find out the current sky culture and get it localized name.

Returns
the translated name of the current sky culture
QString StelMainScriptAPI::getSkyLanguage ( )
slot

Get the current sky language.

Returns
two letter language code, e.g. "en", or "de" and so on.
double StelMainScriptAPI::getTimeRate ( ) const
slot

Get simulation time rate.

Returns
time speed as a multiple of real time.
double StelMainScriptAPI::getViewAltitudeAngle ( )
slot

Get the current viewing direction altitude angle at center of view.

Returns
the altitude angle in decimal degrees. 0 is horizon, zenith is 180, nadir = -180.
double StelMainScriptAPI::getViewAzimuthAngle ( )
slot

Get the current viewing direction azimuth angle at center of view.

Returns
the azimuth angle in decimal degrees as a compass bearing i.e. 0 is North, 90 is East, 180 is South, 270 is West.
double StelMainScriptAPI::getViewDecAngle ( )
slot

Get the current viewing direction Declination angle at center of view.

Returns
the Declination angle in decimal degrees. The value returned falls in the range -180 .. 180
double StelMainScriptAPI::getViewDecJ2000Angle ( )
slot

Get the current viewing direction Declination angle in J2000 frame at center of view.

Returns
the Declination angle in J2000 frame in decimal degrees.
double StelMainScriptAPI::getViewRaAngle ( )
slot

Get the current viewing direction Right Ascension at center of view.

Returns
the Right Ascension angle in decimal degrees. The value returned falls in the range 0 .. 360
double StelMainScriptAPI::getViewRaJ2000Angle ( )
slot

Get the current viewing direction Right Ascension in J2000 frame at center of view.

Returns
the Right Ascension angle in J2000 frame in decimal degrees.
double StelMainScriptAPI::getZodiacalLightIntensity ( )
slot

Get Zodiacal Light intensity.

Returns
value of Zodiacal Light intensity, e.g. "1.2"
void StelMainScriptAPI::goHome ( )
slot

Go to defaults position and direction of view.

bool StelMainScriptAPI::isRealTime ( )
slot

Get the simulation time and rate state - is it "real time".

Returns
true if the time rate is normal, and the simulation time is real time, else return false
double StelMainScriptAPI::jdFromDateString ( const QString &  dt,
const QString &  spec 
)
slot

For use in setDate and waitFor For parameter descriptions see setDate().

Returns
Julian day.
void StelMainScriptAPI::loadSkyImage ( const QString &  id,
const QString &  filename,
double  ra0,
double  dec0,
double  ra1,
double  dec1,
double  ra2,
double  dec2,
double  ra3,
double  dec3,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Load an image which will have sky coordinates.

Parameters
ida string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it.
filenamethe file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr.
ra0The right ascension of the first corner of the image in degrees
dec0The declination of the first corner of the image in degrees
ra1The right ascension of the second corner of the image in degrees
dec1The declination of the second corner of the image in degrees
ra2The right ascension of the third corner of the image in degrees
dec2The declination of the third corner of the image in degrees
ra3The right ascension of the fourth corner of the image in degrees
dec3The declination of the fourth corner of the image in degrees
minResThe minimum resolution setting for the image
maxBrightThe maximum brightness setting for the image
visibleThe initial visibility of the image
void StelMainScriptAPI::loadSkyImage ( const QString &  id,
const QString &  filename,
const QString &  ra0,
const QString &  dec0,
const QString &  ra1,
const QString &  dec1,
const QString &  ra2,
const QString &  dec2,
const QString &  ra3,
const QString &  dec3,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Convenience function which allows the user to provide RA and DEC angles as strings (e.g.

"12d 14m 8s" or "5h 26m 8s" - formats accepted by StelUtils::getDecAngle()).

void StelMainScriptAPI::loadSkyImage ( const QString &  id,
const QString &  filename,
double  ra,
double  dec,
double  angSize,
double  rotation,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.

Parameters
ida string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it.
filenamethe file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr.
raThe right ascension of the center of the image in J2000 frame degrees
decThe declination of the center of the image in J2000 frame degrees
angSizeThe angular size of the image in arc minutes
rotationThe clockwise rotation angle of the image in degrees
minResThe minimum resolution setting for the image
maxBrightThe maximum brightness setting for the image
visibleThe initial visibility of the image
void StelMainScriptAPI::loadSkyImage ( const QString &  id,
const QString &  filename,
const QString &  ra,
const QString &  dec,
double  angSize,
double  rotation,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.

Parameters are the same as the version of this function which takes double values for the ra and dec, except here text expressions of angles may be used.

void StelMainScriptAPI::loadSkyImageAltAz ( const QString &  id,
const QString &  filename,
double  alt0,
double  azi0,
double  alt1,
double  azi1,
double  alt2,
double  azi2,
double  alt3,
double  azi3,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Load an image which will have sky coordinates.

Parameters
ida string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it.
filenamethe file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr.
alt0The altitude angle of the first corner of the image in degrees
azi0The azimuth angle of the first corner of the image in degrees
alt1The altitude angle of the second corner of the image in degrees
azi1The azimuth angle of the second corner of the image in degrees
alt2The altitude angle of the third corner of the image in degrees
azi2The azimuth angle of the third corner of the image in degrees
alt3The altitude angle of the fourth corner of the image in degrees
azi3The azimuth angle of the fourth corner of the image in degrees
minResThe minimum resolution setting for the image
maxBrightThe maximum brightness setting for the image
visibleThe initial visibility of the image
void StelMainScriptAPI::loadSkyImageAltAz ( const QString &  id,
const QString &  filename,
double  alt,
double  azi,
double  angSize,
double  rotation,
double  minRes = 2.5,
double  maxBright = 14,
bool  visible = true 
)
slot

Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.

Parameters
ida string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it.
filenamethe file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr.
altThe altitude angle of the center of the image in degrees
aziThe azimuth angle of the center of the image in degrees
angSizeThe angular size of the image in arc minutes
rotationThe clockwise rotation angle of the image in degrees
minResThe minimum resolution setting for the image
maxBrightThe maximum brightness setting for the image
visibleThe initial visibility of the image
void StelMainScriptAPI::loadSound ( const QString &  filename,
const QString &  id 
)
slot

Load a sound from a file.

Parameters
filenamethe name of the file to load.
idthe identifier which will be used to refer to the sound when calling playSound, pauseSound, stopSound and dropSound.
void StelMainScriptAPI::loadVideo ( const QString &  filename,
const QString &  id,
float  x,
float  y,
bool  show,
float  alpha 
)
slot

Load a video from a file.

Parameters
filenamethe name of the file to load.
idthe identifier which will be used to refer to the video when calling playVideo, pauseVideo, stopVideo and dropVideo.
xthe x-coordinate for the video widget.
ythe y-coordinate for the video widget.
showthe visibility state for the video.
alphathe initial alpha value of the video.
void StelMainScriptAPI::moveToAltAzi ( const QString &  alt,
const QString &  azi,
float  duration = 1. 
)
slot

move the current viewing direction to some specified altitude and azimuth angles may be specified in a format recognised by StelUtils::getDecAngle()

Parameters
altthe altitude angle
azithe azimuth angle
durationthe duration of the movement in seconds
void StelMainScriptAPI::moveToRaDec ( const QString &  ra,
const QString &  dec,
float  duration = 1. 
)
slot

move the current viewing direction to some specified right ascension and declination angles may be specified in a format recognised by StelUtils::getDecAngle()

Parameters
rathe right ascension angle
decthe declination angle
durationthe duration of the movement in seconds
void StelMainScriptAPI::moveToRaDecJ2000 ( const QString &  ra,
const QString &  dec,
float  duration = 1. 
)
slot

move the current viewing direction to some specified right ascension and declination in the J2000 frame angles may be specified in a format recognised by StelUtils::getDecAngle()

Parameters
rathe right ascension angle
decthe declination angle
durationthe duration of the movement in seconds
void StelMainScriptAPI::output ( const QString &  s)
slot

print an output message from script

Parameters
sthe message to be displayed on the output file.
void StelMainScriptAPI::pauseScript ( )
slot

Pause the currently running script.

Note that you may need to use the key '6' or the GUI to resume script execution.

void StelMainScriptAPI::pauseSound ( const QString &  id)
slot

Pause a sound which is playing.

Subsequent playSound calls will resume playing from the position in the file when it was paused.

Parameters
idthe identifier used when loadSound was called
void StelMainScriptAPI::pauseVideo ( const QString &  id)
slot

Pause a video which is playing.

Subsequent playVideo calls will resume playing from the position in the file when it was paused.

Parameters
idthe identifier used when loadVideo was called
void StelMainScriptAPI::playSound ( const QString &  id)
slot

Play a sound which has previously been loaded with loadSound.

Parameters
idthe identifier used when loadSound was called
void StelMainScriptAPI::playVideo ( const QString &  id)
slot

Play a video which has previously been loaded with loadVideo.

Parameters
idthe identifier used when loadVideo was called
void StelMainScriptAPI::quitStellarium ( )
slot

Close Stellarium.

void StelMainScriptAPI::removeSkyImage ( const QString &  id)
slot

Remove a SkyImage.

Parameters
idthe ID of the image to remove.
void StelMainScriptAPI::resizeVideo ( const QString &  id,
float  w,
float  h 
)
slot

Resize the video widget to the specified width, height.

Parameters
idthe identifier used when loadVideo was called
wthe new width for the widget.
hthe new height for the widget.
void StelMainScriptAPI::screenshot ( const QString &  prefix,
bool  invert = false,
const QString &  dir = "" 
)
slot

Save a screenshot.

Parameters
prefixthe prefix for the file name to use
dirthe path of the directory to save the screenshot in. If none is specified, the default screenshot directory will be used.
invertwhether colors have to be inverted in the output image
void StelMainScriptAPI::seekVideo ( const QString &  id,
qint64  ms 
)
slot

Seeks a video to the requested time.

Parameters
idthe identifier used when loadVideo was called
msthe time in milliseconds from the start of the media.
void StelMainScriptAPI::selectObjectByName ( const QString &  name,
bool  pointer = false 
)
slot

Select an object by name.

Parameters
namethe name of the object to select (english) If the name is "", any currently selected objects will be de-selected.
pointerwhether or not to have the selection pointer enabled
void StelMainScriptAPI::setAppLanguage ( QString  langCode)
slot

Set the current application language.

Parameters
langCodetwo letter language code, e.g. "en", or "de".
void StelMainScriptAPI::setDate ( const QString &  dt,
const QString &  spec = "utc",
const bool &  enableDeltaT = true 
)
slot

set the date in ISO format, e.g.

"2008-03-24T13:21:01"

Parameters
dtthe date string to use. Formats:
  • ISO, e.g. "2008-03-24T13:21:01"
  • "now" (set sim time to real time)
  • relative, e.g. "+ 4 days", "-2 weeks". can use these units: seconds, minutes, hours, days, weeks, months, years. You may also append " sidereal" to use sidereal days and so on. You can also use "now" at the start. For example: "now + 3 hours sidereal"
Note
you must use the plural all the time, even when the number of the unit is 1. i.e. use "+ 1 days" not "+1 day".
when sidereal time is used, the length of time for each unit is dependent on the current planet. By contrast when sidereal timeis not specified (i.e. solar time is used) the value is conventional - i.e. 1 day means 1 Earth Solar day.
Parameters
spec"local" or "utc" - only has an effect when the ISO date type is used. Defaults to "utc".
enableDeltaTis true or false - enable Delta-T correction or not. Defaults to "true".
Note
for fully compatibles behavior of this function with the version 0.11.4 or earlier, you should call core.setDeltaTAlgorithm("WithoutCorrection"); before running core.setDate(); for disabling DeltaT correction.
starting with version 0.13.2 all relative dates are set without DeltaT correction.
void StelMainScriptAPI::setDeltaTAlgorithm ( QString  algorithmName)
slot

set equation of the DeltaT for the simulation date and time

Parameters
algorithmNameis name of equation, e.g. "WithoutCorrection" or "EspenakMeeus"
Note
list of possible names of equation for DeltaT: WithoutCorrection, Schoch, Clemence, IAU, AstronomicalEphemeris, TuckermanGoldstine, MullerStephenson, Stephenson1978, SchmadelZech1979, MorrisonStephenson1982, StephensonMorrison1984, StephensonHoulden, Espenak, Borkowski, SchmadelZech1988, ChaprontTouze, StephensonMorrison1995, Stephenson1997, ChaprontMeeus, JPLHorizons, MeeusSimons, MontenbruckPfleger, ReingoldDershowitz, MorrisonStephenson2004, EspenakMeeus, Reijs, Banjevic, IslamSadiqQureshi, Custom.
void StelMainScriptAPI::setDiskViewport ( bool  b)
slot

Set the disk viewport.

Parameters
bif true, sets the disk viewport on, else sets it off
void StelMainScriptAPI::setFlagGravityLabels ( bool  b)
slot

Turn on/off gravity labels.

Parameters
bif true, turn on gravity labels, else turn them off
void StelMainScriptAPI::setGuiVisible ( bool  b)
slot

Show or hide the GUI (toolbars).

Note this only applies to GUI plugins which provide the public slot "setGuiVisible(bool)".

Parameters
bif true, show the GUI, if false, hide the GUI.
void StelMainScriptAPI::setJDay ( double  JD)
slot

Set the current date in Julian Day.

Parameters
JDthe Julian Date
void StelMainScriptAPI::setMaxFps ( float  m)
slot

Set the maximum frames per second.

Parameters
mthe new maximum fps setting.
void StelMainScriptAPI::setMilkyWayIntensity ( double  i)
slot

Set Milky Way intensity.

Parameters
ivalue of intensity for the Milky Way
void StelMainScriptAPI::setMilkyWayVisible ( bool  b)
slot

Show or hide the Milky Way.

Parameters
bif true, show the Milky Way, if false, hide the Milky Way.
void StelMainScriptAPI::setMinFps ( float  m)
slot

Set the minimum frames per second.

Usually this minimum will be switched to after there are no user events for some seconds to save power. However, if can be useful to set this to a high value to improve playing smoothness in scripts.

Parameters
mthe new minimum fps setting.
void StelMainScriptAPI::setMJDay ( double  MJD)
slot

Set the current date in Modified Julian Day.

Parameters
MJDthe Modified Julian Date
void StelMainScriptAPI::setMountMode ( const QString &  mode)
slot

Set the mount mode.

Parameters
modeshould be "equatorial" or "azimuthal"
void StelMainScriptAPI::setNightMode ( bool  b)
slot

Set the status of Night Mode.

Parameters
bif true, set Night Mode, else set Normal Mode
void StelMainScriptAPI::setObserverLocation ( double  longitude,
double  latitude,
double  altitude,
double  duration = 1.,
const QString &  name = "",
const QString &  planet = "" 
)
slot

Set the observer location.

Parameters
longitudethe longitude in degrees. E is +ve. values out of the range -180 .. 180 mean that the longitude will not be set
latitudethe longitude in degrees. N is +ve. values out of the range -180 .. 180 mean that the latitude will not be set
altitudethe new altitude in meters. values less than -1000 mean the altitude will not be set.
durationthe time for the transition from the old to the new location.
nameA name for the location (which will appear in the status bar.
planetthe English name of the new planet. If the planet name is not known (e.g. ""), the planet will not be set.
void StelMainScriptAPI::setObserverLocation ( const QString  id,
float  duration = 1. 
)
slot

Set the location by the name of the location.

Parameters
idthe location ID as it would be found in the database of locations - do a search in the Location window to see what where is. e.g. "York, UnitedKingdom".
durationthe number of seconds to take to move location.
void StelMainScriptAPI::setProjectionMode ( const QString &  id)
slot

Set the current projection mode.

Parameters
idthe name of the projection mode to use, e.g. "Perspective" and so on. valid values of id are:
  • ProjectionPerspective
  • ProjectionEqualArea
  • ProjectionStereographic
  • ProjectionFisheye
  • ProjectionHammer
  • ProjectionCylinder
  • ProjectionMercator
  • ProjectionOrthographic
void StelMainScriptAPI::setRealTime ( )
slot

Set the simulation time to the current system time, and the time rate to 1.

void StelMainScriptAPI::setScriptRate ( double  r)
slot

Set the script execution rate as a multiple of normal execution speed.

Parameters
rthe multiple of the normal script execution speed, i.e. if 5 is passed the script will execute 5 times faster than it would if the script rate was 1.
void StelMainScriptAPI::setSelectedObjectInfo ( const QString &  level)
slot

Set the amount of selected object information to display.

Parameters
levelcan be "AllInfo", "ShortInfo", "None"
void StelMainScriptAPI::setSkyCulture ( const QString &  id)
slot

Set the current sky culture.

Parameters
idthe ID of the sky culture to set, e.g. western or inuit etc.
void StelMainScriptAPI::setSkyLanguage ( QString  langCode)
slot

Set the current sky language.

Parameters
langCodetwo letter language code, e.g. "en", or "de".
void StelMainScriptAPI::setSphericMirror ( bool  b)
slot

Set the viewport distortion effect.

Parameters
bif true, sets the spherical mirror distortion effect for viewport on, else sets it off
void StelMainScriptAPI::setTimeRate ( double  ts)
slot

Set time speed in JDay/sec.

Parameters
tsthe new rate of passage of time as a multiple of real time. For example if ts is 1, time will pass at the normal rate. If ts == 10 then simulation time will pass at 10 times the normal rate. If ts is negative, simulation time will go backwards.
void StelMainScriptAPI::setVideoAlpha ( const QString &  id,
float  alpha 
)
slot

Set the alpha value of a video when visible.

Parameters
idthe identifier used when loadVideo was called
alphathe new alpha value to set.
void StelMainScriptAPI::setVideoXY ( const QString &  id,
float  x,
float  y 
)
slot

Sets the position of the video widget.

Parameters
idthe identifier used when loadVideo was called
xthe new x-coordinate for the video.
ythe new y-coordinate for the video.
void StelMainScriptAPI::setZodiacalLightIntensity ( double  i)
slot

Set Zodiacal Light intensity.

Parameters
ivalue of intensity for the Zodiacal Light
void StelMainScriptAPI::setZodiacalLightVisible ( bool  b)
slot

Show or hide the Zodiacal Light.

Parameters
bif true, show the Zodiacal Light, if false, hide the Zodiacal Light.
void StelMainScriptAPI::showVideo ( const QString &  id,
bool  show 
)
slot

Set the visibility state of a video.

Parameters
idthe identifier used when loadVideo was called
showthe new visible state of the video.
void StelMainScriptAPI::stopSound ( const QString &  id)
slot

Stop a sound from playing.

This resets the position in the sound to the start so that subsequent playSound calls will start from the beginning.

Parameters
idthe identifier used when loadSound was called
void StelMainScriptAPI::stopVideo ( const QString &  id)
slot

Stop a video from playing.

This resets the position in the video to the start so that subsequent playVideo calls will start from the beginning.

Parameters
idthe identifier used when loadVideo was called
void StelMainScriptAPI::wait ( double  t)
inlineslot

Pauses the script for t milliseconds.

Parameters
tthe number of milliseconds to wait
Note
This method is pure JavaScript implementation.

Definition at line 707 of file StelMainScriptAPI.hpp.

void StelMainScriptAPI::waitFor ( const QString &  dt,
const QString &  spec = "utc" 
)
inlineslot

Waits until a specified simulation date/time.

This function will take into account the rate (and direction) in which simulation time is passing. e.g. if a future date is specified and the time is moving backwards, the function will return immediately. If the time rate is 0, the function will not wait. This is to prevent infinite wait time.

Parameters
dtthe date string to use
spec"local" or "utc"
Note
This method is pure JavaScript implementation.

Definition at line 718 of file StelMainScriptAPI.hpp.


The documentation for this class was generated from the following file: