Why did last night go wrong? NINA and PHD2 night analysis

A free, read-only companion for an observatory that already works. It reads NINA's and PHD2's logs and the frames the night saved, and says where the time went.

In the 0.4.1 release; tried offline on other observatories' logs, not yet live beside one · updated 20 November 2026

Most people imaging deep sky already have something that runs the night: NINA, SGP, APT, SharpCap or Ekos taking the frames, and PHD2 guiding. The companion is for them. It’s part of telescopeyoke, but it doesn’t drive anything. It reads what the night left behind and answers the questions you’d ask the next morning:

What it does

companion.py reads the frames your capture program saved, PHD2’s guide log (or PHD2 live, through its server) and, if you give it, NINA’s own log. Every light frame it can read is measured: FITS, or XISF uncompressed or zlib-compressed. Anything it can’t read or leaves out (calibration frames, stacks, colour pictures, other compression) is listed, never dropped quietly.

For each frame it measures the stars, their sharpness (FWHM), their roundness, the sky’s brightness, the sensor’s temperature against its target, and the guiding during the exposure. Each is judged against the best frames of the same target and filter that night, so no figure from somebody else’s telescope is assumed. Frames are then called dimmed, bright sky, soft, trailed, off cooling target or guide star lost, and stretches with no frames are explained from PHD2 and NINA where they can be. What it measured is always kept apart from what it only infers.

It never touches the observatory. It has no command that can move a mount, take a frame, turn a focuser or a wheel, or change a setting.

No frames to hand? The logs are enough to start

NINA’s and PHD2’s logs alone give a first look, a few megabytes instead of a night’s frames:

python companion.py report --nina-log "...\NINA\Logs\DATE.log" --phd2-log "...\PHD2_GuideLog_DATE.txt" --night 2026-09-13

This is what it said, in full, about a night another observatory published: NINA 3.2 running a sequence on M27 with PHD2 guiding and a dome, 13 to 14 September 2026 (their logs), read offline:

lights: M 27 no filter, 600 s: 27 exposures, 270 min of exposure, 21:09-02:24
lights: M 27 L-Pro, 6 s: 2 exposures, 0 min of exposure, 21:50-21:53
autofocus: L-Pro, 6 s: 42 exposures, 4 min of exposure, 20:56-01:50
plate solving: L-Pro, 15 s: 7 exposures, 2 min of exposure, 20:59-21:55
focusing: L-Pro, 6 s: 13 exposures, 1 min of exposure, 21:50-21:53
Science lights: 27 saved of 29 exposures, 270 min saved; 62 more exposures for calibration, snapshots, autofocus, plate solving or focusing, not counted as science
M 27 no filter, 600 s: 23 of 27 frames acceptable by NINA's own star detection (best HFR 2.65 px, 635 stars); 3 with fewer stars (likely cloud or haze), 1 soft
Time in the sequencer's steps: waiting 139 min, dithering 16 min, autofocus 12 min, camera warming 7 min, camera cooling 5 min, starting guiding 3 min, centring (plate solving) 3 min, dome 2 min, slewing 1 min, finding home 1 min, ...
Events: the dome shutter closed (3), the dome shutter opened (3), the safety monitor said safe (1), the safety monitor said unsafe (1)
Errors: 37, the first 21:04: PHD2Guider.cs: PHD2 error:Guiding stopped
Guiding (PHD2's log): 27 of 91 exposures taken while PHD2 was guiding; 20 of those guided all through, 7 with gaps in the guide steps; the star lost 326 time(s) during them
Guide error during exposures: median RMS 1.42 arcsec, worst 4.39
From the logs alone: no frame was measured here; any judgement of the frames is NINA's own star detection, where its log has it.

From the logs alone it told the 27 ten-minute lights apart from 62 autofocus, plate-solving and focusing exposures, found that 7 of the 27 had gaps in their guiding, and put more than two hours down to the sequence waiting. What it couldn’t say without the frames is how sharp each light really was. For that it used NINA’s own star counts, and said so. The same observatory’s November night, and other people’s NINA and PHD2 logs, are in the repository’s What has been tried.

With the frames: my own night

Given the frames as well, it measures each one itself. This is my night of 4 to 5 November 2026, the cooled mono camera’s first, with no guiding then, trimmed:

706 files: 693 light frames measured; 13 left out, no single-plane image (a stack or a colour picture).
M33 L (183m, gain 1500, 16 s) 00:23-01:41: 57 min measured; 37 min acceptable by its own best frames (139 of 213 frames)
    15 min (56 frames) dimmed: likely cloud or haze
    5 min (18 frames) trailed: likely the mount's tracking or the wind (no guiding to compare)
No frames 01:15-01:33 (18 min beyond the usual gap): not known: nothing it reads says
Where the time went: no frames (explained) 44 min, dimmed 38 min, no frames (unexplained) 36 min, trailed 11 min, soft 6 min

Of 57 minutes on M33, 37 were good enough by that night’s own best frames. The 18-minute gap it couldn’t explain, it says it couldn’t.

Running it

On Windows, with Python 3.11 or newer: download the 0.4.1 release, unpack it and run install.ps1. It needs no config.toml.

python companion.py check "C:\path\to\tonights\frames"
python companion.py report "C:\path\to\tonights\frames" --phd2-log "...\PHD2_GuideLog_DATE.txt" --nina-log "...\NINA\Logs\DATE.log"

watch instead of report follows a night as it happens. Every option, and how to read a report, is in the companion’s guide. If you try it on your own night, I’d like to see what it said: post it here.

How far it’s proven

I wrote it on 19 November 2026 and it went into the 0.4.1 release the next morning. It has been tried on my own frames, on made-up nights with known faults, and offline on NINA and PHD2 logs other observatories have published. It hasn’t yet read another observatory’s night with the frames, logs and guiding all together, and it hasn’t run live beside anyone else’s observatory. NINA, PHD2 and the rest have nothing to do with it and don’t endorse it.

Sources