stellariumSky()
Scientific results for this function.
Diffuse V-band brightness was compared with six fields outside the Carina calibration aperture. V04 validation study.
Enable Remote Control under Configuration > Plugins in Stellarium Desktop, select Load at startup and restart if needed. Enable the server in the plugin settings. Use the local server without a password and install the R packages httr2 and png. Close dialogs and use a normal rectangular viewport. Point screenshot.dir at the directory configured in Stellarium.
The script freezes time and takes one full-sphere Cylinder Fill screenshot. The centre is south, the seam is north, and the horizon is halfway up. Choose width for more pixels per degree. R keeps the native pixels for each plotted sector. For a 30-degree sector a width of 8192 supplies about 683 source pixels. The physical plot size and graphics device determine the displayed resolution. If the script times out, check the screenshot path and that your Stellarium version offers Cylinder Fill.
Implementation arguments, return value and documented modes
| Argument | Formal default | Behaviour in this interface |
|---|---|---|
hor |
— | Site horizon with latitude, longitude and elevation in metres. |
jd |
NULL |
Numeric UT Julian day. Supply either jd or time. |
screenshot.dir |
getOption("skyscapeR.screenshot.dir", "~/Pictures/Stellarium") |
Existing local directory where Stellarium writes screenshots. |
port |
8090L |
Local Remote Control server port. |
timeout |
60 |
Maximum wait for the capture in seconds. |
time |
NULL |
A date and clock time such as "2026/12/21 16:00", or a POSIXct or POSIXlt instant. |
timezone |
— | For character time, a zone name or fixed UTC offset as in time2jd(). Defaults to the package setting. |
calendar |
— | For character time, the Gregorian or Julian calendar as in time2jd(). Defaults to the package setting. |
display |
c(landscape = FALSE, fog = FALSE) |
Named logical switches: atmosphere, landscape, fog, cardinals, compass.marks (numbered horizon bearings), azimuthal.grid, equatorial.grid, constellation.lines, constellation.labels (names) and constellation.art. Use galactic.equator to toggle the Galactic equator independently of the equatorial grid. Use ecliptic and equator for the lines of date, poles for the celestial poles and zenith for the Stellarium zenith/nadir markers. Older Stellarium versions may require the Compass Marks plugin to be loaded to show the bearings. Landscape and fog default to FALSE so the site horizon supplies the foreground. Other omitted switches use the current Stellarium setting. |
width |
NULL |
Even screenshot width in pixels, up to 8192. The default |
Return value
stellariumSky() returns a skyscapeR.sky object with the native raster, PNG path, Julian day, observer location and capture settings. skyStep() invisibly returns the updated sky of the same kind.
Reproducibility and stepping
A Stellarium capture reflects the installed Stellarium version, its catalogues,
selected sky culture and current settings for switches not explicitly supplied.
It is an external rendered image, not the package's twilight or extinction
model. Record those settings when comparing it with sketchSky.
The external application and a working local Remote Control connection are
required for every new capture, but not for replotting a saved raster.
Atmospheric settings when using skyStep
For a sketch, skyStep retains calendar, max.mag, k, style
and display selections. Refraction, pressure and temperature are read again
from skyscapeR.vars; the previous object's atmosphere is not
restored automatically. Changing these session settings between the original
sketch and a step changes the atmosphere as well as the time. Keep them fixed
for a time-only comparison, including when resuming a saved sketch in another
R session. This behaviour is intentional. Stellarium captures instead use
the external application's atmospheric settings.
Each call draws immediately and returns the new object invisibly. Save it with
sky <- skyStep(hor, sky, minutes = 10) before taking the next step.
Implementation. R/skybox.R. Full function help · Sky reconstruction · Sky brightness and visualisation outline · Display styles, capture and stepping time · Capture a sky from Stellarium