Export for Stacking
Turn reviewed lights into a clean stacking input without moving or changing the source files. Export one project or target from Overview, download a ZIP in a browser, or use the CLI for repeatable batch exports.
Every mode uses the same selection and WBPP-style folder layout.
Choose an export mode
| Where | Result | Best for |
|---|---|---|
| Desktop app | Local folder, hardlinked when possible | Fast export on the grading machine with little extra disk use |
| Browser | Streaming ZIP download | Remote servers and NAS installs |
| CLI | Local folder, copy or hardlink | Automation, filters, dry runs, and repeat exports |
| HTTP API | Streaming ZIP or server-local folder | Custom tools and scheduled jobs |
What PSF Guard exports
| Grade | Default | Optional |
|---|---|---|
| Accepted | Exported | Can be scoped by project, target, or filter |
| Pending | Skipped | Add with --include-pending or the API option |
| Rejected | Never exported | Cannot be enabled |
Export reads the grade and FITS basename from the active catalog, then resolves the file through that catalog's configured image folders. It does not change grades, edit FITS files, or move anything out of the source library.
Output layout
Desktop, browser, CLI, and API exports all use the same tree:
destination/
├── California Nebula/
│ └── LIGHT/
│ ├── HA/
│ │ ├── frame-001.fits
│ │ └── frame-002.fits
│ └── OIII/
│ └── frame-003.fits
└── Flaming Star/
└── LIGHT/
└── SII/
└── frame-004.fits
PixInsight WBPP and Siril can group this
<target>/LIGHT/<filter>/ layout directly. PSF Guard
keeps each source basename. If two selected files would land at the same
path, later names gain a numeric suffix instead of overwriting the first.
Export from Overview
- Finish grading the frames you want to stack.
- Return to Overview and expand the project.
- Choose ⬇ Export on the project to export all its accepted targets, or on one target to narrow the result.
- In the desktop app, choose a destination folder. In a browser, save the ZIP download.
The action appears only when that project or target has at least one accepted frame and PSF Guard has found its image files. If it is missing, check the accepted count and refresh file discovery in Settings.
Desktop app
The desktop app places files straight into the chosen folder. It tries a hardlink first, which is instant and uses no extra data blocks when source and destination share a filesystem. If the link cannot be made, PSF Guard copies the file. A summary reports linked, copied, already present, missing, and failed files.
Browser or remote server
The browser action streams an uncompressed ZIP without staging a second copy on the server. FITS data is already hard to compress, so store mode avoids wasted CPU and starts the download at once. The ZIP endpoint reads files only; it cannot write to an arbitrary path on the server.
Export from the CLI
# Preview the plan, then copy accepted lights
psf-guard export my-db --dest ./stacking --dry-run
psf-guard export my-db --dest ./stacking
# One target and filter; hardlink when possible
psf-guard export my-db --dest ./stacking \
--target "California Nebula" --filter HA --link
# Include ungraded frames as well as Accepted
psf-guard export my-db --dest ./stacking --include-pending
# A raw SQLite path needs its image search roots
psf-guard export schedulerdb.sqlite --dest ./stacking \
--image-dirs /data/lights,/archive/lights
| Option | Effect |
|---|---|
--project NAME | Project-name substring match |
--target NAME | Target-name substring match |
--filter NAME | Exact filter match, ignoring case |
--include-pending | Add Pending frames; Rejected still stay out |
--link | Try hardlinks, then fall back to copying |
--dry-run | Print the plan without writing files |
--image-dirs DIRS | Comma-separated search roots for a raw database path |
Repeat exports safely
Export is designed to top up a stacking folder after each session.
- A destination file with the expected size is counted as already present and skipped.
- Newly accepted frames are added on the next run.
- Source files and database grades are never changed.
- Files that cannot be found are reported and do not stop other local files from exporting.
Automate with the HTTP API
# Stream Accepted lights for one target as a ZIP
curl "http://localhost:3000/api/db/my-db/export?target_id=42" \
--output psf-guard-export.zip
# Preview a folder export on the server's own filesystem
curl -X POST "http://localhost:3000/api/db/my-db/export/local" \
-H "Content-Type: application/json" \
-d '{"dest":"/data/stacking","project_id":7,"dry_run":true}'
The ZIP route is read-only. The server-local route can write arbitrary
paths and therefore requires --allow-database-management.
Query/body options are project_id, target_id,
include_pending, and filter_name; the local route
also accepts link and dry_run.
Troubleshooting
| Symptom | Check |
|---|---|
| No Export action | The scope needs an Accepted frame and a FITS file found under the configured image folders. |
nothing to export | Check the project/target/filter scope, grades, image directories, and filename metadata. Add Pending only when intended. |
| Hardlinks became copies | Hardlinks require source and destination on the same filesystem and a filesystem that supports links. |
| ZIP stops or will not open | A source became unreadable during streaming. Check file access, then download again. |
| Expected calibration frames are absent | Export currently selects lights only; add calibration data in the stacking tool. |