TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/skyrobot804/node_v1/llms.txt
Use this file to discover all available pages before exploring further.
fits_export module provides export_enhanced_fits(), which copies a source FITS file into a structured, dated output directory and enriches the copy’s primary HDU header with observatory, detector, and processing metadata drawn from the configuration and the photometry result dict. Original Seestar header keywords are never overwritten — new keywords are added only when absent from the source file, preserving the camera-reported values for downstream archival pipelines. HISTORY lines are always appended unconditionally.
export_enhanced_fits()
source_fits into the export directory tree and enriches the copy’s FITS headers with observatory, detector, and photometry metadata.
Absolute or relative path to the original FITS file produced by the Seestar. The file is copied with
shutil.copy2 (preserving filesystem timestamps) before any header modifications are made, so the source file is never altered.Photometry result dict from
photometry.run_pipeline(). Used to populate the AIRMASS, BJD-OBS, BARY-SYS, and HISTORY keywords, and to determine the output date subdirectory from result["bjd"].Loaded configuration dict. Observatory metadata is read from
config["observatory"], detector parameters from config["photometry"], and observer identity from config["aavso"]. See Config Keys for full details.Base directory for the export tree. When
None, the value of config["photometry"]["fits_export"]["export_dir"] is used, falling back to "fits_export" if that key is also absent. The directory is created automatically if it does not exist.None if either the file copy or the header update fails.
Output Path
Exported files are stored under:- Result BJD —
result["bjd"]is converted from TCB Julian Date to UTC calendar date viaastropy.time.Time. - FITS DATE-OBS header — the first 10 characters of the
DATE-OBSkeyword in the source file are used as the date string. - Today’s UTC date —
datetime.now(timezone.utc).strftime("%Y-%m-%d")is used as a last resort.
os.makedirs(..., exist_ok=True) so concurrent exports to the same date directory are safe.
Headers Written
The following FITS keywords are written to the copy’s primary HDU. All keywords are set using_set_if_absent(), meaning they are only written when the keyword does not already exist in the source header — preserving camera-reported values. HISTORY lines are the exception: they are always appended, never overwrite.
| Keyword | Source | Notes |
|---|---|---|
TELESCOP | observatory.telescope | Default: "ZWO Seestar S50" |
INSTRUME | observatory.instrument | Default: "ZWO Seestar S50 IMX462" |
OBSERVER | observatory.observer → aavso.observer_code | Set only if non-empty |
SITENAME | observatory.name | Set only if non-empty |
SITELAT | observatory.latitude → safety.observer.latitude | Decimal degrees |
OBSLAT | Same as SITELAT | Alias for compatibility |
SITELONG | observatory.longitude → safety.observer.longitude | Decimal degrees |
OBSLONG | Same as SITELONG | Alias for compatibility |
SITEELEV | observatory.elevation | Metres above sea level; default 0.0 |
GAIN | photometry.gain | e⁻/ADU; default 1.0 |
RDNOISE | photometry.read_noise | Electrons; default 5.0 |
IMAGETYP | Hardcoded | "LIGHT" |
RADESYS | Hardcoded | "ICRS" |
EQUINOX | Hardcoded | 2000.0 |
AIRMASS | result["airmass"] | Written only when result["airmass"] is not None |
BJD-OBS | result["bjd"] | Barycentric Julian Date (TCB); written only when present |
BARY-SYS | Hardcoded "TCB" | Written alongside BJD-OBS |
SWCREATE | photometry.node_id | Value: "Boundless Skies Node <node_id>" |
DATE-BLD | datetime.now(UTC) | ISO 8601 UTC timestamp of header enrichment |
HISTORY | Multiple appends | Always added; see below |
HISTORY Lines
Up to six HISTORY lines are conditionally appended (never overwrite existing history):"Processed by Boundless Skies Node v1 (<node_id>)"— always appended."Differential photometry: mag=<mag>+/-<err> snr=<snr> quality=<flag>"— whenresult["magnitude"]is present."BJD-OBS computed via astropy barycentric correction (TCB)"— whenresult["bjd"]is present."Comparison stars used: <N>"— whenresult["comparison_stars"]is present."Zero point: <zp>+/-<zp_scatter> mag"— whenresult["zero_point"]is present."Astrometric solution: WCS present (Seestar or ASTAP)"— whenCD1_1orCDELT1is found in the (post-copy) header.
Config Keys
Written to
TELESCOP. Should match the IAU-registered telescope name if submitting to archives.Written to
INSTRUME.Written to
OBSERVER. Falls back to aavso.observer_code if absent.Written to
SITENAME when non-empty.Observer latitude in decimal degrees. Falls back to
safety.observer.latitude if absent.Observer longitude in decimal degrees. Falls back to
safety.observer.longitude if absent.Observatory elevation in metres above sea level, written to
SITEELEV.CCD gain in e⁻/ADU, written to
GAIN.Read noise in electrons, written to
RDNOISE.Node identifier written into
SWCREATE and the first HISTORY line.Default base export directory, used when
export_dir is not passed as an argument.AAVSO observer code. Used as the fallback value for
OBSERVER when observatory.observer is not set.