Magnet

class zgoubidoo.commands.magnetique.Magnet(label1: str = '', label2: str = '', *params, **kwargs)[source]

Bases: zgoubidoo.commands.commands.Command, zgoubidoo.commands.patchable.Patchable, zgoubidoo.commands.plotable.Plotable

Base class for all magnetic elements.

TODO

Command attributes

LABEL1=''

Primary label for the Zgoubi command (default: auto-generated hash).

Type

str

LABEL2=''

Secondary label for the Zgoubi command.

Type

str

HEIGHT='20 centimeter'

Height of the magnet (distance between poles), used by plotting functions.

Type

Quantity

POLE_WIDTH='30 centimeter'

Pole width (used for plotting only).

Type

Quantity

PIPE_THICKNESS='2 centimeter'

Thickness of the pipe, used by plotting functions.

Type

Quantity

PIPE_COLOR='grey'

Color of the pipe, used by plotting functions.

Type

str

REFERENCE_FIELD_COMPONENT='BZ'

Orientation of the reference field (used by field maps)

Type

str

KINEMATICS='None'

A kinematics object.

Type

NoneType

Default initializer for all Commands.

Attributes Summary

PARAMETERS

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g.

field_map

Attach a field map to the element.

field_profile_model

A model for the field profile.

Methods Summary

post_init([field_map])

param field_map

process_fit_field_profile(fit)

param fit

Attributes Documentation

PARAMETERS: dict = {'HEIGHT': (<Quantity(20, 'centimeter')>, 'Height of the magnet (distance between poles), used by plotting functions.'), 'KINEMATICS': (None, 'A kinematics object.'), 'LABEL1': ('', 'Primary label for the Zgoubi command (default: auto-generated hash).'), 'LABEL2': ('', 'Secondary label for the Zgoubi command.'), 'PIPE_COLOR': ('grey', 'Color of the pipe, used by plotting functions.'), 'PIPE_THICKNESS': (<Quantity(2, 'centimeter')>, 'Thickness of the pipe, used by plotting functions.'), 'POLE_WIDTH': (<Quantity(30, 'centimeter')>, 'Pole width (used for plotting only).'), 'REFERENCE_FIELD_COMPONENT': ('BZ', 'Orientation of the reference field (used by field maps)')}

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g. fit).

field_map

Attach a field map to the element.

field_profile_model

A model for the field profile.

Methods Documentation

post_init(field_map: Optional[zgoubidoo.fieldmaps.fieldmap.FieldMap] = None, **kwargs)[source]
Parameters
  • field_map

  • **kwargs

Returns:

process_fit_field_profile(fit: lmfit.model.ModelResult)[source]
Parameters

fit

Returns: