Skip to content

Read, write and trace through shared netCDF field maps of imposed E and B - #41

Merged
max-models merged 1 commit into
develfrom
field-maps
Nov 6, 2026
Merged

max-models merged 1 commit into
develfrom
field-maps

Conversation

@max-models

@max-models max-models commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
  • beamtracer.field_map: the max-models field-map format (max-models-field-map-1.0, shared with picnic, whose picnic.input_output.output_format holds the spec and reference validator): FieldMap read/write/from arrays or a function, multilinear interpolation, clip/zero/error outside; validate_field_map, parse_frame_axes; adapters for FieldRegion (3D) and the 2D tracer; a method card for the interpolation (second order in the node spacing).
  • BeamTracer takes imposed_electric, a magnetic field in planar geometry, and an azimuthal B in cylindrical geometry.
  • FieldMapParams(file, outside) as BeamOpticsConfig.field_map (config round trip); BeamOptics checks the map's frame and dims and adds its E to the solved field and its B to the solenoids or axial field. FieldRegion takes a FieldMap as electric or magnetic.
  • In the cylindrical frame the components are axial, radial, azimuthal, as picnic's spec now states.
  • Tests: round trip; a map written the way picnic writes one is read correctly and beamtracer writes the same attributes, units and dims; validation; outside handling and maps with fewer dims; a trace through a Gaussian B_z(x) map matches the analytic field; BeamOptics reproduces the Larmor circle and the parabola from uniform maps (rel 1e-5); a cylindrical B map equals an AxialField (1e-9); config round trip.

@max-models
max-models merged commit 66ae961 into devel Nov 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants