Files
sfhorizont/docs/FORMATS.md
T

80 lines
4.2 KiB
Markdown
Raw Normal View History

2026-10-24 13:20:55 +02:00
# Output formats
Azimuth everywhere in the app: degrees, 0 = true north, 90 = east, clockwise. Altitude: degrees above the mathematical horizon.
## NINA custom horizon (`.hrz`)
Source: N.I.N.A. docs, Options › General, "Custom Horizon" (https://nighttime-imaging.eu/docs/master/site/tabs/options/general/), plus community guides.
- Plain text. One `azimuth altitude` pair per line, separated by a space.
- Optional comment header line, as in the official example: `# Az Alt`.
- At least 2 pairs. Gaps between azimuths are interpolated by NINA.
- Azimuths ascending, unique, starting at 0. For a vertical edge use two consecutive azimuths (e.g. `45 47` then `46 33`).
- Loaded in NINA under Options › General › Astrometry Settings › Custom Horizon. It affects altitude charts (Sky Atlas, Framing) and the advanced sequencer's horizon conditions.
Export rules for this app:
- 1° steps from 0 to 360 inclusive (`360` repeats the `0` value, closing the loop; harmless and avoids relying on wrap-around interpolation).
- Altitude = detected edge + safety margin, one decimal, **`.` decimal separator** (invariant culture), clamped to [0, 90].
- `\n` line endings are fine; `\r\n` is acceptable too.
- Example: `examples/nina/backyard-pier.hrz`.
- Not verified: whether NINA accepts more comment lines than the header, or comma decimals on non-English Windows locales. Test once in NINA before release.
## Stellarium landscapes
Verified against `src/core/modules/Landscape.cpp` (Stellarium master, GitHub) and the `LandscapeSpherical` class docs (https://stellarium.org/doc/head/classLandscapeSpherical.html).
A landscape is a folder (installed from a .zip via Sky and viewing options › Landscape › Add/remove landscapes) containing `landscape.ini` plus its files.
### Spherical (photo panorama), the main Stellarium output
```ini
[landscape]
name = Backyard pier
author = ...
description = ...
type = spherical
maptex = panorama.png
maptex_top = 42 ; altitude (deg) of the image's top row, default 90
maptex_bottom = -22 ; altitude (deg) of the image's bottom row, default -90
angle_rotatez = 0 ; deg; keep 0 and bake north into the image instead (see below)
bottom_cap_color = .05,.05,.05 ; fills below maptex_bottom; without it that area is not drawn
polygonal_horizon_list = horizon.txt ; optional but recommended (exact horizon for Stellarium's logic)
polygonal_angle_rotatez = 0
[location]
planet = Earth
latitude = +47d29'52"
longitude = +19d2'25"
altitude = 112
```
Texture mapping, derived from the spherical fragment shader:
- Horizontal: `s = atan2(x, y) / 2π` in Stellarium's alt-az frame. **Left edge (s = 0) = azimuth 90° (East)**; azimuth increases to the right: South at 25 %, West at 50 %, North at 75 % of the width.
- Vertical: top row = `maptex_top`, bottom row = `maptex_bottom`, linear in altitude, so a cropped band is fine and the sky above it does not need to be photographed.
- Pixels outside [bottom, top] are discarded. Transparent pixels (alpha = 0) show the sky.
- Texture sizes should be powers of two; stretching is allowed because the top and bottom keys define the geometry. Use **8192 × 2048 RGBA PNG**.
- Bake the north offset into the image by shifting columns (offset × 8192/360 px) instead of using `angle_rotatez`. That avoids sign-convention ambiguity. If `angle_rotatez` is used later, verify its sign empirically.
### Polygonal (outline only)
```ini
[landscape]
name = Backyard pier (outline)
type = polygonal
polygonal_horizon_list = horizon.txt
polygonal_horizon_list_mode = azDeg_altDeg ; default
polygonal_angle_rotatez = 0
ground_color = .12,.12,.14
```
`horizon.txt`:
- One `azimuth altitude` pair per line, whitespace-separated. Lines starting with `#` are comments; empty lines are ignored.
- In `azDeg_altDeg` mode the azimuth is **compass azimuth** (N = 0, E = 90). Stellarium converts it internally (`180 − rotate − az`).
- Write the plain detected edge here (no NINA safety margin).
Other modes exist (`azDeg_zdDeg`, `azRad_altRad`, `azRad_zdRad`, `azGrad_zdGrad`) but are not needed.
### Location section
Optional. `latitude` and `longitude` accept Stellarium's DMS strings (`+47d29'52"`) or decimal degrees. `altitude` is in metres. If present, Stellarium can switch the observer location when the landscape is selected.