Generating Synthetic Observations¶
hsobs-generate coordinates a YAML-configured set of observations.
The starting example is configs/example_generate.yaml.
The field reference and
error reference
describe model choices.
The data structure can be found in data products.
- Configuration and sampling grids. Load and validate the YAML, construct
native time grids for density
n, velocityv, and magnetic fieldB, and load spacecraft trajectories. - Field model. Construct a underlying field model following the prescribed field configuration. Models that require nominal formation context, e.g. the intermittent p-model, receive it once before truth or Monte Carlo evaluation.
- Measure true value. Evaluate the field on nominal spacecraft coordinates.
- Coordinate sampling and position perturbations Draw clock and position offsets per spacecraft and Monte Carlo realization. Evaluate trajectories at shifted times, add position offsets, sampling the field at those coordinates.
- Measurement frame and errors. Convert from plasma frame to configured measurement frame. Applies measurement errors to the sampled ensemble.
- Output. Write an HDF5 observation product, including nominal coordinates, true values, observations, configuration metadata, and configured error products. Optional visualization settings produce time-series and geometry figures.
Overview of Synthetic Data Creation¶
hsobs-generate loads a spacecraft formation,
evaluates a plasma field along every trajectory at each instrument's native cadence,
creates a Monte Carlo ensemble using variable-specific error models, and writes true and observed values to and HDF5 output.
This output will be passed to hobs-analyze, a separate, registry-selected step.
The built-in diagnostics method reports observed and residual statistics and formation-separation summaries.
spacecraft:
source: cdf
cdf_directory: ../HelioSwarm/HS-RT/PhB_SRD8_0x78f/
configuration_time: "2030-06-01T00:00:00"
fallback_synthetic: false
# Common translation of Observatory
velocity_km_s: [400.0, 10.0, 0.25]
The CDF input adapter accepts one .cdf file or a directory of files for the spacecraft positions, which can be found here.
It follows the conventions of the cdf variables,
which include Epoch, Position, and Spacecraft_Label.
The CDF records, which are currently on an hourly cadence,
are concatenated, sorted, filtered for fill values.
The interaval closest to the input configuration_time is selected.
The selected record is treated as a snapshot,
and advects all spacecrat in the observatory at a common velocity_km_s.
Full ephemeris interpolation is left to future extensions.
Choose a physical model before interpreting generated curves. Set the formation,
interval, native cadences, velocity measurement frame, seed and MC count. A fixed
seed does not fix external file contents or a CDF-versus-fallback choice. Record
metadata.spacecraft_source and the embedded YAML alongside results.
Time grids and frames¶
We can configure the native instrument cadences independently:
time:
t_start_s: 0.0
t_stop_s: 300.0
cadence_s:
n: 0.125
v: 0.125
B: 0.03125
n and v cadences independently, both will be measured at the same cadence by the Faraday cups.
ESA measurements from the Hub will be added in later revisions.
A single, scalar cadence_s applies the same cadence to all quantities.
The data reference defines plasma and spacecraft frames. Coordinate errors move the sampling point along the trajectory at shifted time before adding the position offset; stored coordinates remain nominal.
Choose a field¶
A field to be measured is defined with
field:
model: model-name
- Sine-sum: introductory analytic inputs.
- P-Model: static periodic with tunable levels of intermittency.
- Simulation sampling: external snapshot from a Gkeyll simulation.
- Linear Eigenmode: external selected eigenmode, fixed geometry.
- Planar shock: jump solution and smooth synthetic transition.
Define errors¶
See the error reference for details. Use Gaussian/OU errors for configurable noise studies, or the observatory requirement model for the current best model for the observatory performance.
To model relative MAG-to-FC reconstruction uncertainty, explicitly select
errors.alignment.model: relative_constant_rotation_B_to_V. It uses the nominal
FC Cartesian frame, rotates B after magnetic DC/AC errors, and adds no velocity
alignment rotation. A 3° per-axis requirement at sigma_level: 3 gives 1° sigma
per rotation-vector component. See
relative FC–MAG alignment
for the YAML override, saved datasets and statistical validation. Independent
B/V rotations remain the default; existing production recipes are unchanged.
Truth-only generation¶
Set errors.n_mc: 0 to generate nominal sampled truth without a Monte Carlo
ensemble:
errors:
n_mc: 0
Other error settings may remain in the configuration; they are inactive for this
run. No error RNG, error models, coordinate-offset draws, perturbed field samples
or measurement-error realizations are created. Truth, nominal trajectories and
velocity-frame conventions are unchanged. Omitting n_mc still defaults to one;
negative counts are rejected.
The existing HDF5 schema is retained: /observed/n, /observed/v and
/observed/B have a zero-length leading MC dimension, with their usual native
cadence trailing dimensions. /errors is empty when output.write_errors: true
and absent when false. Metadata records n_mc: 0, mc_generation_enabled: false
and error models as not generated; the full input YAML remains embedded.
Truth, geometry and truth Alfvén visualizations follow their normal switches. Observed-member visualizations are automatically disabled, and their metadata paths are null. Analyses that require an observed realization cannot use this file; select truth explicitly in truth-capable analysis workflows.
Inspect the run¶
Run hsobs-generate CONFIG, then check the printed output path, geometry-source
metadata, array shapes and figures.
Observed arrays retain a leading MC dimension even for one member.
After confirming the success of a generated run, continue with analysis.