Menu: File - setiastro/setiastrosuitepro GitHub Wiki

File Menu

Overview

The File menu handles opening/saving single images and managing whole-workspace projects. You can also double-click the MDI desktop or drag & drop files/folders onto the canvas to open them.


Commands

Open…

  • Menu: File → Open…

  • Shortcut: standard Ctrl/Cmd + O

  • What it does: Opens one or more images as new documents (each spawns its own MDI subwindow).

  • Also works via:

    • Double-clicking empty MDI background
    • Drag-and-dropping files or folders (folders are scanned recursively for supported types)

Supported formats & behavior

  • FITS/MEF (.fits, .fit, .fits.gz, .fit.gz, .fz/Rice):

    • Reads the correct HDU, normalizes endianness, converts to float32.
    • Detects bit-depth and mono/RGB layout; rescales >1.0 floats to [0..1].
    • Auto-opens known rejection layers (REJ_LOW, REJ_HIGH, REJ_COMB) as sibling, read-only docs with friendly names.
  • TIFF (.tif/.tiff): 8/16/32-u/32-f supported, normalized to [0..1].

  • XISF (.xisf): Loads image + metadata; synthesizes a FITS-like header (injects WCS/SIP if present).

  • RAW (.cr2, .cr3, .nef, .arw, .dng, .orf, .rw2, .pef): Reads Bayer data, subtracts black level, normalizes by white level; treated as mono unless 3-channel.

  • PNG/JPG: Converted to RGB/mono float32 in [0..1].

Robustness

  • On the “buffer is too small for requested array” error, the loader retries (up to 3× with short waits).

Save As…

  • Menu: File → Save As…

  • Shortcut: standard Ctrl/Cmd + Shift + S

  • What it does: Saves the active document to the chosen path/format. Bit-depth is validated per format.

  • Per-format details:

    • PNG/JPG: always saved as 8-bit preview (clipped to [0..1]).
    • TIFF: honors chosen bit-depth (8/16/32-u/32-f).
    • FITS: always written as float32; header is sanitized/synthesized (ensures valid WCS keywords & NAXIS).
    • XISF: respects requested bit-depth; writes image/file metadata (with color/geometry hints).
    • RAW: not writable → automatically saved as FITS float32.
  • After save: document metadata (file_path, bit_depth, original_format) is updated.


Clear All Views

  • Menu: File → Clear All Views
  • What it does: Closes all open documents/subwindows but keeps your desktop shortcuts intact.
  • Use when: You want a clean workspace without losing your custom shortcut layout.

New Project

  • Menu: File → New Project
  • What it does: Starts fresh — closes all views and clears desktop shortcuts.

Save Project…

  • Menu: File → Save Project…

  • What it does: Saves a .sas project (zip-based) containing:

    • Every open document’s current image (float32), undo/redo stacks, and metadata
    • A JSON-safe snapshot of the original header (if available)
    • A copy of the source file per view (if available) for portability
    • The full MDI layout (positions/sizes/minimized/maximized, active view)
    • All desktop shortcuts (positions, labels, per-shortcut presets)

Notes

  • Optional compression (fast vs. compact) is handled internally.

Load Project…

  • Menu: File → Load Project…

  • What it does: Opens a .sas project and restores:

    • Documents, images, undo/redo history, and metadata
    • Embedded source files to a local cache, updating each doc’s file_path
    • MDI window geometry and active view
    • Desktop shortcuts (including labels and presets)

Legacy support

  • Can also load older SASv2 pickle projects: converts slots → documents, restores histories, and opens views (shortcuts weren’t part of legacy; they remain empty).

Tips

  • Use Save As (FITS) if you want a faithful, 32-bit float working file with preserved/synthesized WCS.
  • Use Projects for full-session snapshots (images + history + layout + shortcuts) when switching tasks or sharing setups.
  • Clear All Views vs New Project: the former keeps shortcuts; the latter resets everything.