Manage Rejects and Sync Databases

These optional tools move rejected files out of a stacking tree and copy grades, plans, and captures between two database files.

Two DBs
Use sync only when the telescope and grading machine have separate copies

A direct desktop connection does not require database sync.

Sync commands ↓

Manage rejected files

CLI
You can archive files after grading.

Preview changes with the --dry-run flag, then restore files from the recorded paths if needed.

CLI reference →

Stacking tools such as PixInsight load all files under your lights directory, including rejected frames. The move-rejects command moves rejected frames and their sidecars (such as .xisf, .json, and .txt files) into a REJECT/ subdirectory. This removes them from the processing path. The tool records the original paths so you can restore the files later:

# Move rejects to <image_dir>/<Project>/REJECT/... with their sidecars.
# Idempotent; every move is recorded for restore.
psf-guard move-rejects --db my-db [--dry-run]

# If you want to undo a rejection, un-reject the frames in the UI and run the following command:
psf-guard restore-rejects --db my-db          # restores only un-rejected files
psf-guard restore-rejects --db my-db --all    # restores everything
This feature requires the Target Scheduler plugin schema version 22 or later to support stable image GUIDs. Older databases are not compatible, but you can use the legacy filter-rejected command, which does not move files out of the directory tree.

Sync databases between machines

You can grade images on one machine while a telescope captures images on another. The sync command transfers state between two scheduler databases, using registry slugs or .sqlite file paths, and matches images by their stable GUID:

Data Transfer workspace with merge, planning, and reviewed-grade actions
The Settings workspace names both catalogs and requires a server-owned preview before any merge or push.

Review staged previews

The Settings → Sync → Staged previews section lists all transfers waiting on the server, including background transfers created by the N.I.N.A. plugin. Each entry shows the destination catalog, operation type, source database, insertion and update counts, grade counts, and expiration time.

You can expand the What would change section to view individual field changes. This list shows grade transitions, reasons for changes, and any projects, targets, plans, or images that will be inserted or updated, up to a limit of 400 lines.

The system does not modify the destination database until you click Apply. For large data transfers, the server generates the preview in the background. The client polls the server for progress updates while the server loads and compares the data, which prevents HTTP timeouts through reverse proxies.

# Mirror projects, targets and captured images FROM the telescope INTO your DB.
# Your local grading is preserved; new images arrive with the telescope's grade.
psf-guard sync pull --from telescope.sqlite --to my-db --dry-run

# Push edited projects, targets, templates, plans, and rule weights.
# Telescope captures, counts, images, and grades stay unchanged.
psf-guard sync planning --from my-db --to telescope.sqlite --dry-run

# Push your grading decisions back TO the telescope (one-way, source wins).
psf-guard sync grades --from my-db --to telescope.sqlite --dry-run

You can run these commands in a loop: use pull to refresh the local database, plan and grade locally, and then push the planning and grades updates back to the telescope:

You should use the designated sync directions to protect your data. A pull operation protects local reviewed grades, a planning push does not overwrite telescope capture history, and a grades push only modifies grading states. The Settings panel provides a preview of all three operations before they are applied.
Instead of manually syncing SQLite databases, you can use the PSF Guard Sync plugin for N.I.N.A. to push captures in real time and pull plans and grades directly within N.I.N.A.

Execute the end-to-end workflow

# 1. Bring the night's captures over from the telescope
psf-guard sync pull --from telescope.sqlite --to my-db

# 2. Screen the night automatically, write rejections
psf-guard screen-fits /images/2026-06-30/LIGHT --regrade-db my-db

# 3. Review borderline frames in the grader UI
psf-guard server

# 4. Archive rejects out of the stacking tree
psf-guard move-rejects --db my-db

# 5. Push final grades back so the scheduler re-captures
psf-guard sync planning --from my-db --to telescope.sqlite
psf-guard sync grades --from my-db --to telescope.sqlite

More projects from theatr.us