Data formats and FITS metadata

Reference for image inputs, calibration products, solved frames, matched WStack FITS files, observation outputs and persistent KOPR data.

Source-verified File extensions, metadata aliases, generated keywords, FITS extensions, naming rules and save behaviour were checked against the current implementation.

Supported image inputs

FamilyAccepted extensionsHow KOPR reads it
FITS.fits, .fit, .fts, .fz, plus .fits.gz/.fit.gz/.fts.gz and .fits.fz/.fit.fz/.fts.fzThe first two-dimensional image is used. In MEF files the primary header is merged with the header of that image HDU.
DSLR/mirrorless RAW source.cr2, .cr3, .nef, .arw, .dngUsed only as the source for automatic TG FITS materialization when the representation is missing or stale. Physical RAW paths are not working-pipeline inputs.

WStack calculations use a two-dimensional floating-point representation. New products can be written as Scientific float32 or safely scaled Compact int16; see the next section.

Raw camera timestamps must be verified. KOPR can transfer a camera timestamp from LibRaw/EXIF, but the header comment explicitly warns that its time basis must be checked.

DSLR RAW materialization contract

R74 automatically materializes each pending or stale DSLR source into a linear TG FITS beside the RAW file. The pixel model remains the existing TG2X2 extraction: the two green photosites in each native Bayer 2×2 cell are combined after per-channel black subtraction, without demosaicing, white balance, gamma or highlight recovery.

LayerContract
DiscoveryReads names and provenance inventory only; it does not open RAW image data.
TriggerPending or stale representations start automatic materialization before the current session is committed; there is no approval/bypass dialog.
Final productA verified FITS, conventionally named with _TG.fits, stored beside the source RAW.
Working indexContains FITS paths only. Physical RAW never enters preview, calibration, astrometry or stacking.
ReplacementA stale TG FITS is replaced only after a temporary product is written and reverified; unrelated/conflicting FITS is preserved.
CancellationNo incomplete final FITS is committed. Completed verified products remain usable.

After the batch, discovery runs again. KOPR selects the first created/refreshed TG FITS, or the first verified green representation when all products were already current. Missing rawpy/LibRaw produces a critical extraction-unavailable message; existing FITS may still open, but physical RAW is never used as a fallback.

R81 direct/derived provenance: a direct TG FITS created from one physical RAW carries RAWREP=T. Calibrated and astrometric descendants carry RAWREP=F. Final stacks remove RAWREP, RAWFILE, RAWEXT, RAWMODE, RAWVERS, RAWSIZE and RAWMTIME, because these cards identify one direct materialized source rather than a multi-frame result. Stack ancestry remains in HISTORY, REFIMAGE, NCOMBINE and PROVENANCE.

Discovery remains backward compatible: legacy valid _TG.fits without RAWREP is accepted, while cards such as CALSTAT, ASTROMET, STACKTYP, STACKMTH, NCOMBINE, PROVEXT, TRACKEXT or REFIMAGE identify derived products whose historical RAWFILE/RAWEXT claims must not create a direct-representation conflict.

After materialization, pipeline_state.json migrates a historical physical RAW path to the verified TG FITS path. When both representations have separate records, the historical RAW record is authoritative for stage ON/OFF switches and their downstream disable cascade.

Timestamp caution: camera timestamps transferred from LibRaw/EXIF still require observer verification of their time basis.

Scientific and Compact primary science storage

ModeCore keywordsRepresentation
ScientificBITPIX=-32, KOPRMODE=SCIENTIFIC, STORFMT=FLOAT32, QSTEP=0Unquantized physical float32; invalid pixels are NaN.
CompactBITPIX=16, KOPRMODE=COMPACT, STORFMT=INT16, BSCALE, BZERO, BLANK=-32768, QSTEP=BSCALELinearly scaled signed int16; finite codes are -3276732767.

Compact uses physical_value = stored_integer × BSCALE + BZERO and, for a non-constant image, QSTEP = (DATAMAX - DATAMIN) / 65534.

A noise-relative policy accepts Compact only when QSTEP ≤ 0.25 × sigma_local. Policy keywords include REQMODE, QPOLICY=NOISESIG, QMETHOD=DIFFMAD, QFRAC, QNOISE, QMAX, QNSAMP, QSAFE and QFALLBK. If unsafe, the individual product is stored as Scientific without clipping.

The setting applies to created/imported masters, calibrated LIGHT frames and final star/comet stacks. Auxiliary extensions remain lossless and unchanged. Full details: Scientific and Compact FITS output.

Input metadata contract

KOPR accepts several common aliases. The first usable value is normalized internally. Missing metadata are not silently treated as confirmed compatibility: processing may warn, request a manual value or reject an ambiguous group.

MeaningRecognized FITS keywordsUse
ExposureEXPTIME, EXPOSURE, XPOSURE, TEL_EXPO, ELAPSED, DURATIONCalibration grouping, total exposure and output naming.
Detector temperatureCCD-TEMP, CCD_TEMP, SET-TEMP, SETTEMP, CCD-COOL, SENSOR_TEMP, CCD-TEM, DET-TEMPDark/master compatibility.
FilterFILTER, FILTNM, FILTNAM, FILTNAME, OFILTER, FILTFlat grouping, stack pairing and WCCD filter selection.
ObjectOBJECT, OBJNAME, OBJCTNAM, TARGNAME, TARGET, COMET, COMETNAMComet designation, grouping and matched-pair validation.
InstrumentINSTRUME, CAMERA, DETECTOR, CCDNAME, SENSORCamera/master compatibility.
GainGAIN, EGAIN, CCD-GAIN, CCDGAIN, ISO, ISOSPEEDCompatibility and photometric noise metadata.
Offset/black levelOFFSET, CCD-OFFS, CCDOFFST, BLACKLEV, BLACKLVLCalibration compatibility.
Read modeREADMODE, READOUTM, READOUT, AMP-MODE, AMPMODECalibration compatibility.
BinningXBINNING/YBINNING, common BINX/BINY variants, or CCDSUMMaster matching, image scale and camera validation.
Source geometrySRCNAX1/SRCNAX2, with image dimensions as the supported fallbackReconstruct native detector geometry together with binning before deciding whether the camera-selection dialog is required.
Saturation/linearity limitSATURATE, SATLEVEL, MAXADU, ADC-MAXAuthoritative detector/linearity metadata for frame QC and source-frame saturation provenance. DATAMAX and the observed image maximum are deliberately not used as detector limits.
Detector bit depthADCBITS, ADC-BITS, BITDEPTH, BITDEP, NBITSFallback detector ceiling 2**bits - 1 when no explicit saturation/linearity limit is available.

Frame type is normally read from IMAGETYP or equivalent descriptive metadata on the FITS representation. Physical RAW files are not selected directly by master, calibration, astrometry or stacking actions.

R76 camera identity and authoritative binning

Camera identity and native geometry are stored separately from observation binning. The image/workflow binning is validated for the loaded observation and combines with native pixel pitch and focal length only when the shared physical-scale resolver reaches the active-optics fallback.

Time and exposure semantics

Stack metadata are computed from the frames actually accepted into the stack. Old inherited time/exposure cards from the reference FITS are removed before the result contract is written.

KeywordMeaning
TIMESYSUTC.
DATE-BEGStart of the first accepted exposure.
DATE-OBS, DATE-MID, DATE-AVGExposure-weighted measurement midpoint: sum(EXPTIME_i × midpoint_i) / sum(EXPTIME_i).
MJD-OBS, MJD-AVGThe same effective midpoint in MJD UTC.
DATE-ENDEnd of the last accepted exposure.
TELAPSEElapsed wall-clock interval from DATE-BEG to DATE-END, including gaps.
TIMEALGOEXP-WMID.
TIMECOMPCOMPLETE when every accepted frame supplied start, midpoint and end; otherwise PARTIAL.
NCOMBINENumber of actually combined frames.
EXP_NRBackward-compatible alias of NCOMBINE.
TOTEXP, XPOSURESum of accepted input exposure times.
MethodEXPTIMETOTEXP / XPOSURE
MEANone input exposuresum of accepted exposures
sigma-clipped meanone input exposuresum of accepted exposures
SUMsum of accepted exposuressum of accepted exposures

MEAN and sigma-clipped mean require equal positive input exposure times. SUM can combine different positive input exposures.

Photometry scale: WCCD uses the stack's numerical EXPTIME in m_inst = 40 - 2.5 log10(net_flux / EXPTIME). For a matched Comet/Stars observation the two represented exposures are validated within 0.001 s and frozen at preflight. TOTEXP/XPOSURE remain total-integration metadata only.

Comet ephemeris timing: when the DE440s path is available, the internal comet position uses down-leg light-time rather than treating the observation timestamp as the uncorrected target epoch. External Guide/Tycho/Horizons residuals are recorded diagnostically for the tested object and epoch; no universal arcsecond acceptance threshold is defined.

WCS and astrometric metadata

A photometric image needs a valid celestial WCS: axis types, reference coordinates and pixels, and a valid linear transformation using CD, PC/CDELT or an equivalent standard representation. SIP distortion cards may be present when the CTYPE values consistently declare SIP.

After a local Astrometry.net solution, KOPR writes:

KeywordMeaning
ASTROMETAstrometric solution is present.
ASTRSOLVSolver name, currently solve-field.
ASTRSEEDPosition-seed source, when used.
ASTRSCSEPixel-scale seed source, when used.
ASTRRA, ASTRDECSolved field centre in degrees.
ASTRSCLSolved pixel scale in arcseconds per pixel.
ASTRSEPAngular separation from the requested seed, when a seed was supplied.

The solved file is written as <source stem>_WCS.fits; the calibrated input is retained. The primary WCS is replaced cleanly rather than mixed with an older solution.

Astrometric _WCS.fits output preserves the source science-pixel representation. WCS/SIP/QC metadata are updated without decoding and requantizing Compact pixels, and all other extensions are copied.

Shared physical-scale priority: solved WCS or trusted online calibration; explicit manual override; credible FITS scale metadata; active camera/telescope geometry with validated observation binning.

Calibration products

Master dark, dark-flat and bias

Names are deterministic and encode calibration type, exposure, temperature, dimensions, binning, instrument, gain, offset, read mode, number of used frames and combination method. Prefixes are DA, DF and BI.

Keyword/reportMeaning
MDARK, CALTYPE, IMAGETYPIdentifies a master dark-like frame and whether it is DARK, DARKFLAT or BIAS.
NCOMBINE/NFRAMESNumber of accepted source frames.
COMBMETH/METHCombination method.
DARKBAD/DARKBFRCount/fraction of invalid master pixels repaired by local median.
DATE-BLDUTC master build time.
masterdark_QC_report.csvPer-frame measured QC values and rejection reasons.
masterdark_group_report.csvPer-compatible-group status and output path.

Master flat

Keyword/reportMeaning
MFLAT, IMAGETYPIdentifies a normalized master flat.
NORMIND, NORMMEDPer-source normalization was used and the final median before normalization to one.
FLATBAD/FLATBFRInvalid/non-positive master-flat pixels.
FSATMSK/FSATFRClipped source samples masked before combination.
FLATCOR, CORRFILEOffset correction type and the selected correction master, when applicable.
masterflat_QC_report.csvPer-flat QC measurements and rejection reasons.
masterflat_group_report.csvGroup status, correction source and master path.

Every accepted input filename is also recorded in FITS HISTORY.

All calibration calculations remain floating point. The selected Scientific/Compact mode is applied only when each final master is written, and an unsafe Compact request can fall back independently for that file.

Calibrated and solved LIGHT frames

A calibrated output is named from the source stem with a calibration suffix such as _CA_DA_FL.fits. The source image is not overwritten.

KeywordMeaning
CALSTATApplied operations, for example DARK+FLAT.
CALFILEOriginal LIGHT filename.
CALDARK/CALFLATWhether each correction was applied.
MDARKFN/MFLATFNMaster filenames used.
DARKBAD/DARKBFRRepaired invalid dark pixels.
FLATBAD/FLATBFRPixels masked because the master flat was invalid or non-positive.
DATE-CALUTC calibration time.

The calibration directory also receives processing_manifest.json, linking raw, calibrated and solved paths, selected masters, QC inclusion, enabled state and quality information. The observation-session root stores pipeline_state.json, which is the current per-directory workflow state used by the GUI.

Calibrated LIGHT files may be Scientific or Compact. A later astrometry pass preserves that storage mode instead of rewriting the science array.

WStack output names and primary header

Science stack names follow:

ST_<object>_<filter>_<effective exposure>s_N<frames>.fits
CO_<object>_<filter>_<effective exposure>s_N<frames>.fits

ST is aligned on stars; CO is aligned on the comet. For SUM, the filename exposure is the total; for mean methods it represents one input exposure. Unsafe filename characters are normalized and decimal points in tokens become p.

KeywordMeaning
OBJECT, FILTERExplicit comet designation and normalized filter identity.
STACKMTHSUM, MEAN or SIGCLIP.
STACKTYPAlignment target.
NCOMBINEFrames actually combined after WCS preflight.
NREQUESTFrames requested before relative-WCS QC.
WCSREJFrames excluded by relative-WCS QC.
EXP_NRBackward-compatible copy of the combined-frame count.
SRCNAX1/SRCNAX2Source detector dimensions before any crop.
RESAMPLE, FLUXSCALSingle-pass WCS bilinear resampling and pixel-area flux scaling.
REFIMAGEReference-WCS input.
CROPMODE, FULLCOVOutput geometry and count of pixels covered by all inputs.
PHOTNORM, PHOTWGHTBoth are NONE: no per-frame normalization or quality weighting.
COVMODENCONTRIB describes pre-clipping geometric coverage.

Sigma-clipped products additionally carry SIGCLIP, SIGMA, SIGITER, SIGMINN, SIGMAXR, CLIPREJ, CLIPPIX, CLIPEXCS and CLIPFRAC.

Primary headers also record the actual storage through KOPRMODE, STORFMT, BITPIX and QSTEP. When Compact was requested, the Q* policy cards record acceptance or Scientific fallback.

Stack FITS extensions

A WStack science product is a multi-extension FITS file. Do not discard the non-primary HDUs before WCCD photometry.

ExtensionDataSemantic
Primary HDUfloat32 science imagePixels without complete required coverage are NaN.
NVALIDInteger count imageSamples accepted after optional sigma clipping.
NCONTRIBInteger count imageGeometrically contributing samples before clipping.
NSATCONInteger count image, when availableSource-frame saturated contributions before clipping.
NSATVALInteger count image, when availableSaturated source-frame contributions retained after combination. With SATCOMP=COMPLETE and matching geometry, any positive value is authoritative for automatic WCCD saturation rejection.
PROVENANCEUTF-8 JSON stored in an image HDUInput list, reference frame, method, pair ID, rejected WCS frames and related processing metadata.
COMETTRKPer-exposure track table, when a comet track was usedEpochs and shifts used for comet alignment.

The primary header points to these extensions using VALEXT, COVEXT, PROVEXT, optional SATCEXT/SATEXT and optional TRACKEXT. SATCOMP=COMPLETE means saturation provenance is reliable for every combined source exposure. In automatic WCCD policy, this complete map replaces the invalid comparison of an aggregate MEAN/SUM stack value with a per-source-frame ADC limit. SATCOMP=NONE remains diagnostic but is not by itself a measurement failure: the shared scalar resolver can still produce an effective image-domain limit. An explicit per-image manual base is GUI/observation state and intentionally bypasses the map for that role.

Matched star/comet pairs

Products created in one paired run contain reciprocal metadata:

KeywordRequirement
PAIRFILEName of the matching product with the other alignment target.
PAIRIDShared deterministic identifier.
PAIRVERMatched-pair/provenance schema version.
PAIRROLESTARS or COMET.

WStack/WCCD also checks object, filter, method, frame count, total exposure, timing/provenance and the COMETTRK row count. Renaming a product without updating PAIRFILE can break strict pair validation.

External FITS inspection and use

Storage format and file origin are separate properties. An external BITPIX=16 file is an external FITS with integer, Compact-compatible storage; it is not a third KOPR mode.

The shared inspector can identify the science HDU and dimensions, BITPIX/BSCALE/BZERO/BLANK/QSTEP, object, filter, method, time/exposure data, NCOMBINE, WCS, pair metadata and the availability of coverage, clipping, saturation, provenance and COMETTRK information without unnecessarily loading all science pixels.

No speculative total exposure: if an external stack lacks TOTEXP, KOPR does not infer it as EXPTIME × NCOMBINE, because the external stacker's method and the meaning of EXPTIME may be unknown.

Ordinary external FITS can be used in manual WCCD when their image and basic metadata are usable. Current automatic hand-off still requires the complete native WStack pair plus QC/provenance contract. The inspector can diagnose missing object, filter, effective time, exposure, total exposure, count, method, WCS and Comet/Stars role for a future import workflow, but does not bypass that safety rule.

ICQ, CometObs and Afρ outputs

ICQ record

Visual and CCD result dialogs generate the fixed-width ICQ observation line plus a human-readable CometObs representation. The ICQ record contains designation, fractional UTC date, method and flags, magnitude and source, optical/aperture data, coma/tail information, observer code and—where applicable—CCD camera/chip/scale metadata.

Append ICQ code appends only the ICQ record to <observer code>.txt in KOPR's current working directory. Closing the dialog without appending does not save the observation. The button is disabled after one append to prevent a duplicate from the same dialog.

CometObs and CARA Afρ

The CometObs representation is displayed for review/copying. CCD results can additionally display CARA-style Afρ rows with object, Julian date, heliocentric/geocentric distance, phase angle, band, aperture radius, Afρ and error. These text blocks are not appended by the ICQ button.

Save figure opens a file chooser and writes a PNG of the result plot to the selected path.

COBS magnitude-source identifiers are case-sensitive. R47 writes direct APASS Sloan g′/r′/i′ as AG/AR/AI; calculated APASS R/I share AR/AI with their direct Sloan-r/i counterparts, and Gaia codes retain their defined mixed case.

R58 removes automatically generated saturation wording from Results, ICQ and COBS comments. The comment contains the requested observation metadata and any user-entered text, but no automatic Saturation: sentence. Role-specific saturation policy, threshold source, provenance status and WStack map use remain available to internal validation and diagnostics. For floating FITS without explicit detector metadata, the automatic threshold is 1.0 only for normalized 0–1 data; otherwise the field receives an editable, non-authoritative 65535 fallback.

R78 uses the one canonical reference-star solution for Process obs. and Af-rho. The ICQ comment does not receive the internal pairwise audit trail or a second post-success scatter decision.

ACF measurement provenance

PA-adaptive comet measurements create a detailed kopr-acf-provenance-v1 diagnostic record. It identifies pa-adaptive-upper-v1, ACF start/step/ignore/upper-sigma values, the fixed 40° PA window, centroid limits and achieved shift, Review Apply state, normalized float32 context and source/context/run/observation identifiers.

Each ring can retain lower/core/effective sigma, radial slope, positive-clipped sample count and raw/filtered/used flux.

Compatible output headers and logs contain a shortened HISTORY line such as:

KACF pa-adaptive-upper-v1 s=3 d=2 i=7 u=3 w=40 m=7 l=6 a=1.2 r=0

The ICQ free-text comment format is unchanged. Detailed ACF evidence belongs in diagnostics rather than being expanded into the observation comment.

A Review Apply commits to the Comet slot and appends the concise KACF line to the Comet FITS HISTORY where the current file/format supports that update. Slice and unconfirmed helper candidates do not alter FITS science data or photometric output.

Working and configuration files

PathPurposePortable?
config-files/settings.datObserver, CCD defaults and currently active location/telescope/eyepiece/camera rows. R56 restores these active rows at startup and writes the file by flushed atomic replacement.Back up with the rest of config-files/.
config-files/location.dat, telescope.dat, eyepiece.dat, camera.datSaved hardware/site lists, comma-separated per line.Yes, when paths and device meanings remain valid.
config-files/Elements.txtMain comet orbital-element database.Replace/update as a database, not as user preferences.
config-files/CustomElements.datUser-added orbital elements.Yes; important user data.
config-files/CometData.datComet names/basic data downloaded by KOPR.Regenerable, but keeping it supports offline use.
config-files/MagParams.datAdopted H0/n model intervals saved by Analyzer.Yes; important scientific user data.
config-files/Excluded.dat, Personal-coef.txtObserver exclusions and personal coefficients.Yes.
config-files/envdir.datLast image directory used by WCCD.Machine-specific path; safe to regenerate.
comet-data/<designation>.datPer-comet observation cache/list used by analysis tools; slash and spaces are removed from the filename.Regenerable when network sources remain available; local edits should be backed up.
obs-data/Auxiliary analysis/difference data, including generated per-comet and comparison files.Back up when it contains locally derived data.
pipeline_state.jsonPer-session mapping and enabled state across Raw-stage FITS, calibrated and astrometric stages. Historical DSLR RAW paths are migrated to verified TG FITS paths during R69 session reconciliation.Contains absolute paths; primarily useful on the same directory layout.
Qt QSettings namespaces wstack/comet and wstack/starsValidated WStack method/sigma preferences; the Comet namespace also stores the comet output mode. Values are saved only after successful dialog validation.Machine/user-profile state; normally regenerated rather than copied with an observation.
processing_manifest.jsonCalibration provenance and raw/calibrated/solved path mapping.Contains absolute paths; keep beside the related images.
stats/qc_results.jsonCached image-quality results for the working directory.Regenerable.

Download the compact data/FITS reference.

Minimal header examples

Useful LIGHT input

IMAGETYP= 'LIGHT'
OBJECT  = 'C/2023 R1'
DATE-OBS= '2026-07-23T00:15:00'
EXPTIME = 60.0
FILTER  = 'R'
XBINNING= 2
YBINNING= 2
INSTRUME= 'QHY G1600'
SATURATE= 60000

A valid celestial WCS must be present before stacking or WCCD measurement. The exact linear-WCS card set can be CD-matrix or standards-compliant PC/CDELT form.

Ambiguous input

DATE-OBS= '2026-07-23T00:15:00'
EXPTIME = 60.0

This image may load, but missing frame type, object, filter, binning, instrument and saturation information prevent several compatibility and provenance checks. Add genuine metadata at acquisition/processing time rather than inventing values after the observation.

Backup and portability

  • Back up the entire config-files/ directory before replacing or migrating KOPR.
  • Keep ST/CO FITS pairs and every extension intact; simple image-only export loses validity, saturation and provenance data.
  • Keep processing_manifest.json, pipeline_state.json and QC reports with the associated observation when reproducibility matters.
  • Absolute paths in JSON state/manifest files may need regeneration after moving a session to another computer.
  • Do not manually change scientific header values solely to bypass a compatibility check. Correct the acquisition metadata or document a deliberate override.

Related chapters

Calibration and stacking workflow · CCD photometry and observation output · Visual ICQ output · Local observations and MagParams.dat · Troubleshooting · Algorithm reference · Scientific / Compact output