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.

Range handling: 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.

Point-style invariance: 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.

Point size: 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.

Formula documents: one selected comet keeps the simple historical formula editor; multiple selected comets use one complete target-aware document in each editor. the current formula workflow now owns draft application semantics, while the persistence layer remains the exact-designation atomic MagParams.dat persistence foundation.

Unified 1..N workflow

  1. Select one or more comets.
  2. Load the typed observation datasets once.
  3. Use target-scoped returns and formulas with global channel visibility and Fit Groups.
  4. Choose Independent fit for any number of targets, or Shared n when at least two compatible targets are selected.
  5. Render, filter, fit, calculate Multi-colour indices or save a portable Light Curve Scenario in the same workspace.

For a fresh multi-target selection, KOPR stages the default projection as Log(r) and distance-corrected magnitude mag − 5·log10(Δ). Those defaults are committed only after the new observation dataset loads successfully. A failed/cancelled load leaves the previous projection unchanged; a fresh single-target selection preserves the current projection, and scenario restore remains authoritative.

There is no production Comparison tab or second analytical runtime.

Control availability by application state

StateWhat is available
EMPTYOnly Select comets. Data, fit, Multi-colour, range and plot-toolbar actions remain unavailable.
SINGLE_TARGETDataset/source/settings/formula actions are available. Editing target is hidden and Shared n is unavailable.
MULTI_TARGETEditing target is visible for navigation. Shared n appears only when the selected fit groups are compatible.
BUSYState-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.

Current sidebar and Settings layout

The current Analyzer sidebar uses two unnamed visual frames, without section titles:

  1. Select comets…, Save/Load scenario and Export diagnostics.
  2. Editing target with its selector and Style…, Load COBS, Load MPC and Open local data.

Settings and selections remains outside those frames. The current Settings contain Exclude uncertain observations, Exclude negative observations, Bortle survival curve, Point style and Point size. The two Exclude controls are part of Settings; no additional named groupboxes are used for these controls.

Changing Point style rebuilds the Data channels and fit-group editor from the current draft state while preserving draft visibility, fit groups, colours and markers; cancelling the style dialog commits nothing. Bortle remains a model/reference-curve setting, while Point style and Point size are display-only.

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 and manual plot ranges

AUTO X remains observation-owned: visible observations define the automatic horizontal interval. Model curves, formula curves and the Bortle reference do not extend automatic X.

An explicitly edited USER/manual X range is different. It authorizes the selected fitted model to be evaluated through the requested displayed interval, bounded by the physical half-width of the selected apparition so that a periodic-comet model cannot cross into an adjacent return. A single-law model can extend both outer ends; pre/post-perihelion and adaptive segmented models preserve all internal breakpoints and change only their outer begin/end.

X and Y edit intent are tracked independently. If you edit X while leaving Y untouched, KOPR derives Y from the visible observations plus prepared model points inside the requested X interval, so the newly exposed model-only region can expand the vertical view. If you explicitly edit Y, that manual Y remains authoritative.

Auto range restores the cached observation-owned 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 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_codes and active script state are not part of the production route.

Display encoding modes

ModeColourMarkerFormula curves
Comet colour / channel markerComet targetObservation channelTarget-aware formula presentation
Channel colour / comet markerObservation channelComet targetNeutral 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.

Display 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.

PropertyContract
Range1.0 to 12.0 Matplotlib points
Step0.5
Default3.0 Matplotlib points
Affected artistsPre- and post-perihelion observation points
Unaffected artistsFormula-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.

Plot key and rendered identity

The current plot uses a figure-level Plot key to the right of the axes. It contains Data channels, Perihelion side and Formulae.

Perihelion identity is shown directly at visible reference lines. Labels are directed inward and clipped to remain inside the axes. If a rendered target has no Formulae entry, it is identified in a conditional Targets without formulae block rather than restoring the old Comets legend.

The Plot key width is responsive to figure size, DPI and text length; long Formulae labels can wrap. In Formulae, parameter rows such as H0 and n start at the same horizontal level as the comet/formula identity. Parameter rows do not receive their own marker or line sample.

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.5

Older style 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 and Marcus phase parameter

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.

Marcus d_90: d_90 is a dimensionless dust-to-gas light ratio normalized at a 90° phase angle. The “90” is the reference angle used in the definition; d_90 itself is not measured in degrees.

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 current formula workflow draft/Refresh/Save/Analyse behavior remains unchanged.

Applying manual formula drafts with Refresh

  1. Edit either formula document freely. Incomplete intermediate text is allowed while typing.
  2. Choose Refresh to validate the complete Regular and Additional documents.
  3. If both are valid, KOPR commits them together, advances the formula revision once and redraws once.
  4. 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 persistence layer 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.

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.

Complete column reference

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.

Open the Light Curve Scenario guide

Compute once, render many

The unified implementation retains the prepared physical rows:

Date; days from perihelion T; r; log(r); delta; raw phase angle

Physical 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.

Custom elements and active typed targets

The target selector provides the shared explicit custom-elements action. the current reconciles new designations/apparitions, exact updates, rename and deletion against one stable repository snapshot.

If a mutation affects an active target—including the old or new identity of a rename—the typed target/dataset is fully reloaded. This remains required even when the outer selector is cancelled after a successful nested-editor Save.

Related chapters

Observation Planner · Data formats · Performance · Troubleshooting

report · report