In a non-transitory computer-readable storage medium that stores instructions executable by a programmable evaluation unit to ascertain a magnetic field of at least one magnetic coil unit of a magnetic resonance apparatus, the instructions comprising:
- generating the magnetic field by the at least one magnetic coil unit comprising a main magnet for generating a main magnetic field, a gradient coil unit for generating a gradient magnetic field, or the main magnet and the gradient coil unit;
- detecting a plurality of magnetic field vectors at different positions of the magnetic field by a magnetic field sensor unit comprising at least one magnetic field sensor, wherein each magnetic field vector of the plurality of magnetic field vectors describes a strength and a direction of the magnetic field at the respective position;
- ascertaining the magnetic field based on the plurality of magnetic field vectors, the ascertaining of the magnetic field comprising ascertaining a model of a vector field;
- and
- adjusting the generating of the magnetic field based on the ascertained magnetic field, reconstructing magnetic resonance signals taking the ascertained magnetic field into account, or the adjusting and the reconstructing,
- wherein ascertaining the magnetic field comprises decomposing the model of the vector field into separate submodels.