Comet Analyzer
The current Comet Analyzer is one workspace for one or multiple comets. It is implemented by WLightCurves and uses one analytical policy, one typed dataset model and one set of channel, fitting, formula and scenario controls.
R179 formula transaction contract: manual Regular/Additional editing changes draft text only. Refresh validates and atomically commits both documents; Save persists a valid draft without applying it to the graph; Analyse commits its typed result immediately and performs one implicit Refresh/render. Status: RC / PASS_HEADLESS; the real PyQt5 gate remains pending.
R154 control-state contract: the Comet Analyzer derives all primary controls from the current EMPTY, SINGLE_TARGET, MULTI_TARGET or BUSY state. Qualification: PASS_HEADLESS; full release readiness remains pending the strict real-PyQt5 gate and native visual smoke.
R161 display-style contract: choose Comet colour / channel marker or Channel colour / comet marker. Pre-perihelion points remain hollow, post-perihelion points filled, confirmed overrides persist atomically, and reverse mode falls back deterministically when 16 targets exceed the 15-marker capacity. Status: PASS_HEADLESS / RC; real PyQt5 offscreen and native visual gates remain pending.
R163 range contract: a manual USER range survives only while the complete rendered-data identity remains unchanged; style, legend, FitGroup and Editing-target changes preserve it. AUTO limits are resolved centrally from the current visible observations and model series.
R164 artist-invariance contract: changing Point style preserves the same observation rows and X/Y coordinates. Observations render above formula artists, and single-target reverse mode suppresses formula markers that could resemble data points.
R169 point-size contract: the compact Point size spin box changes only pre/post-perihelion observation marker size, persists with display styles and preserves the current range, zoom and prepared scientific results.
R149 document foundation: one selected comet keeps the simple historical formula editor; multiple selected comets use one complete target-aware document in each editor. R179 now owns draft application semantics, while R149 remains the exact-designation atomic MagParams.dat persistence foundation.
Unified 1..N workflow
- Select one or more comets.
- Load the typed observation datasets once.
- Use target-scoped returns and formulas with global channel visibility and Fit Groups.
- Choose Independent fit for any number of targets, or Shared
nwhen at least two compatible targets are selected. - Render, filter, fit, calculate Multi-colour indices or save a portable Light Curve Scenario in the same workspace.
There is no production Comparison tab or second analytical runtime.
Control availability by application state
| State | What is available |
|---|---|
| EMPTY | Only Select comets. Data, fit, Multi-colour, range and plot-toolbar actions remain unavailable. |
| SINGLE_TARGET | Dataset/source/settings/formula actions are available. Editing target is hidden and Shared n is unavailable. |
| MULTI_TARGET | Editing target is visible for navigation. Shared n appears only when the selected fit groups are compatible. |
| BUSY | State-changing controls, Analyse and Refresh are blocked. When a graph has already been committed, its axis/magnitude controls and toolbar remain usable. |
Adaptive Analyse remains unavailable until every selected target has a valid Break window. Adaptive mode disables Shared n, Fixed slope and fixed n.
BUSY state and the committed graph
A running worker does not make the previous valid graph unusable. You can inspect the committed graph through live view controls, but cannot change the dataset, target topology, formulas or fit operation until the worker finishes or is cancelled.
After success, error or cancellation, controls are recalculated from the current dataset and selected targets. KOPR does not replay obsolete enabled/visible states saved when the worker started.
- Changing Editing target only navigates the formula document; it does not reload observations or request geometry.
- Axis and magnitude changes render committed arrays without starting a compute worker.
- An invalid Refresh, incomplete result, worker failure or cancellation preserves the previous graph.
Automatic, manual and cached ranges
Automatic X is defined only by the visible observations. Model curves, formula curves and the Bortle reference cannot extend automatic X. They may contribute to automatic Y only inside the observation-defined X interval.
A deliberately edited and refreshed range becomes a USER range under the R163 identity contract. Changes that alter visible rows or coordinates invalidate it; style-only changes preserve it.
Auto range restores the cached automatic view. It is a view command, not an observation reload, fit, formula or geometry operation.
Observation data
The unified workflow retains the established local observation loading and supported import paths. Observation records are loaded into one typed dataset and are then selected or masked for the current target, apparition, observation channel, observer and display state.
The R144 cutover is architectural: it does not alter observation selection rules, the scientific meaning of channels or the established photometric equations.
Targets, channels and state ownership
- selected targets, returns and formula documents are target-scoped;
- channel visibility and Fit Groups are global to the workspace;
- the Editing target control navigates target-specific editors without creating a second plot state;
- target order is typed and stable; historical
type_codesand active script state are not part of the production route.
Display encoding modes
| Mode | Colour | Marker | Formula curves |
|---|---|---|---|
| Comet colour / channel marker | Comet target | Observation channel | Target-aware formula presentation |
| Channel colour / comet marker | Observation channel | Comet target | Neutral curves with sparse comet markers |
In both modes, pre-perihelion observations are hollow and post-perihelion observations are filled. Reordering targets or channels preserves their established identity.
R164 invariance: switching between these modes does not change the observation mask, rows, X coordinates or magnitudes. Formula artists use lower z-order than observations. For one selected comet, reverse-mode formula markers are disabled and formula legend entries are line-only; sparse target markers remain only for multiple comets, where they still disambiguate neutral model curves.
Observation point size
A compact row directly below Point style contains a QDoubleSpinBox labelled Point size.
| Property | Contract |
|---|---|
| Range | 1.0 to 12.0 Matplotlib points |
| Step | 0.5 |
| Default | 3.0, visually compatible with R168 |
| Affected artists | Pre- and post-perihelion observation points |
| Unaffected artists | Formula-line markers and legend keys |
Changing the value persists the display preference, advances only the view revision and redraws the prepared plot. It performs no observation reload, geometry or ephemeris work, fitting, formula recomputation or range invalidation. The current AUTO/USER range and Matplotlib zoom remain in place.
Reset all display defaults returns Point size to 3.0.
Legend blocks
The plot may contain four separate semantic legend blocks: Comets, Data channels, Perihelion side and Formulae. Each block is derived from artists actually present in the plot. A channel or target hidden by filtering must not remain in the legend.
In reverse mode, neutral formula curves use sparse comet markers only when multiple comets are selected. A single comet uses line-only formula curves because a target marker adds no identity information and could resemble an observation.
Editing target and channel styles
Use the compact target-style controls to override a comet display style and the dynamic channel Marker/Colour controls to override an observation-channel style. Style changes affect only display artists and legends; they do not reload observations, recalculate geometry, refit formulas or invoke an ephemeris.
Only a confirmed style transaction becomes the committed state. Cancelling or rejecting an edit preserves the previous plot style.
Style persistence
Confirmed style overrides and Point size are stored atomically in config-files/light_curve_display_styles.json and restored in a fresh Comet Analyzer instance. The optional field is:
"point_size": 6.5Legacy R160–R168 files without this field load with the default 3.0. Invalid, non-finite or out-of-range Point size values are ignored independently, so valid comet and channel overrides remain available. The persistence operation must not leave a partially written state.
Marker capacity
The reverse Channel colour / comet marker mode provides unique comet markers through 15 targets. Selecting 16 targets triggers an automatic deterministic fallback to Comet colour / channel marker. This prevents ambiguous marker reuse.
Fit Groups and channel assignments
Fit Groups organize observation channels for fitting while preserving a stable internal group_id. Ordinary clicks in the registry do not edit names. Double-click a cell in the Fit group column to edit that label inline.
- The name cannot be empty.
- Names must be unique without regard to letter case.
- Renaming does not change the group identity or detach assigned channels.
- Channel assignment comboboxes update to the new label.
- An invalid edit is rejected and the last valid name is restored.
The Add group…, Rename group… and Remove group buttons remain available. Channel assignment itself is still performed through the dropdowns, not by editing the assignment text directly.
Brightness formulas
The standard relation remains:
m = H0 + 5 log10(Δ) + 2.5 n log10(r)The editors are labelled Regular formulas and Additional formulas. Formula text entered by hand is a draft: typing does not change the active formula, formula revision or graph.
H0/n, the geocentric-distance term and dust phase correction remain a local formula layer above retained physical geometry. A valid Refresh inside prepared coverage therefore requires no analytical worker.
Active-target editors and all-target validation
The editors display the active target. For multiple selected comets, the underlying Regular and Additional documents still cover the complete selected target set. Refresh validates and commits the complete set atomically; navigation to another active target does not create a partial target-local formula transaction.
The R179 draft/Refresh/Save/Analyse behavior remains unchanged.
Applying manual formula drafts with Refresh
- Edit either formula document freely. Incomplete intermediate text is allowed while typing.
- Choose Refresh to validate the complete Regular and Additional documents.
- If both are valid, KOPR commits them together, advances the formula revision once and redraws once.
- If validation fails, the last committed formulas and graph remain unchanged and a formula-specific error is shown.
Refresh is the only manual-editor action that applies draft text to the current graph.
Save and persistence
Save uses the R149 exact-designation, same-directory temporary-file, flush, fsync and single os.replace() transaction for config-files/MagParams.dat.
- Invalid Save leaves the file byte-identical.
- Valid Save persists the draft atomically.
- Save does not apply the draft to the current graph, advance the formula revision or trigger a render.
- Use Refresh separately when the draft should become the active runtime formula.
Unselected records and malformed/comment records are preserved verbatim, and exact canonical designation matching prevents collisions such as 4P versus 14P.
Analyse result transaction
Analyse follows a separate path from manual editing. Its typed fit result is committed immediately and starts one plot update as an implicit Refresh/render. It does not require the user to press Refresh and does not implicitly save MagParams.dat.
Fitting modes
- Independent fit: available for one or more selected targets.
- Shared n: available only for two or more targets with a compatible preflight group.
- Adaptive break: remains target-aware and requires complete valid break windows.
- Legacy pooled fit: remains a deferred audit item and is not an R187 feature.
Multi-colour indices and CSV export
Multi-colour indices use observations grouped into the selected UTC bin width. For each operand, KOPR calculates the arithmetic mean of the original magnitudes and forms mean(A) - mean(B). The result retains Date, Delta T, r and log10(r) projections together with counts, scatter and uncertainty.
Calculate and export lifecycle
Export CSV… remains disabled until Calculate succeeds. It exports the currently calculated immutable result; it does not reload observations, repeat UTC binning or call the ephemeris.
- Changing the target, operand A/B, UTC bin width or visible-range filter invalidates the old result and disables export.
- Changing only the X axis is render-only. Export remains available and rows follow the newly selected Date, Delta T, r or log10(r) ordering.
- All scientific fields are exported regardless of the displayed axis.
CSV conventions
The file is standard comma-separated CSV encoded as UTF-8 with BOM. Decimal values use a point and UTC timestamps use ISO 8601 with Z. A typical filename is multicolour_C_2023_R1_CCD_V_minus_CCD_R_1d.csv.
Light Curve Scenarios
The current workspace can be represented by one portable .kopr-lc.json Light Curve Scenario for one or multiple selected comets. Scenario restoration is transactional: validation completes before the restored workspace replaces the committed state.
Compute once, render many
The unified implementation retains the R131–R133 physical rows:
Date; days from perihelion T; r; log(r); delta; raw phase anglePhysical geometry is computed or loaded once for the required target/apparition coverage. Formula transformations are applied locally, and ordinary view changes render the current state from stored arrays. Background ephemeris work is required only for genuinely new data, uncovered physical intervals or material sampling refinement.
Cancel, worker failure, incomplete results and stale data/element work preserve the previous valid graph. A successful physical result is committed transactionally and rendered with the current formula and current view.
Ephemeris and cache identity
The canonical analytical client is EphemerisClient.WLIGHTCURVES with WLIGHTCURVES_POLICY. Historical WANALYZER_POLICY and WCOMPARISON_POLICY names resolve to the same immutable policy object.
The analytical profile remains two-body photometric geometry and is deliberately not an RA/Dec astrometric output. Legacy client names are normalized and cannot create a second execution identity, physical cache or scientific behaviour.
Compatibility and migration
wanalyzer.py and wcomparison.py are deprecated aliases to the canonical Comet Analyzer implementation. They are not independent tabs, workers or caches.
legacy_comparison_import.py is a one-way migration-only parser for historical Comparison material. It does not define current target state, scenarios or runtime mode.
Current qualification
The R187 current Analyzer suite reports 384 passed, 3 skipped and 0 failed, with all headless release gates R150–R187 passing. The three skips are the real PyQt5 modules R154, R161 and R179.
Interpretation and open audit items
R187 changes architecture and qualification, not scientific equations or observation values.
- The Marcus
d_90parameter is dimensionless; removal of the incorrect GUIdegsuffix remains deferred. - An explicit Legacy pooled-fit preset remains deferred.
- The final policy for generic/clear/unfiltered CCD data remains deferred.
Related chapters
Observation Planner · Data formats · Performance · Troubleshooting · Developer architecture · Formula document & atomic Save · Display encoding & styles