pogona.SensorEmpiricalRadialTest

class pogona.SensorEmpiricalRadialTest[source]

Bases: pogona.sensor.Sensor

Sensor based on empirical measurements in a magnetic field simulation. The model used in this class doesn’t actually fit the data all that well. This class should only be used for testing how much of a difference such a model will make if it also considers susceptibility differences in the radial direction.

For this, we shall assume that molecules pass through the sensor in positive (object-local!) z direction and that the sensor (i.e., the boundary) is 25 mm long! So remember to rotate this sensor via the transformation accordingly if your particles aren’t moving from -z to +z.

Attributes

POPT

Parameters for model_flux determined by curve fitting.

component_name

Unique name of this component, unless it is "Generic component".

log_folder

The file sensor[<component name>].csv will be created in here.

rotation

scale

shape

Shape of this sensor.

transformation

translation

__init__()[source]

Methods

__init__()

finalize(simulation_kernel)

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

is_inside_sensor_zone(position_global)

model_flux(ax_rad, a1, a2, a3, a4, a5, b1, ...)

Polynomial of degree 4 (in radial direction) where every relevant parameter is logistically distributed (in axial direction)…

process_molecule_moving(simulation_kernel, ...)

process_molecule_moving_after(...)

Override this method for your sensing algorithm.

process_molecule_moving_before(...)

Called before updating the position of a particle within a time step.

process_new_time_step(simulation_kernel, ...)

process_new_time_step_after(...)

set_arguments(**kwargs)

Read arguments as key value pairs and set this component's member variables accordingly.

__init__()[source]
finalize(simulation_kernel: pogona.simulation_kernel.SimulationKernel)[source]
initialize(simulation_kernel: pogona.simulation_kernel.SimulationKernel, init_stage: pogona.component.InitStages)[source]

Use InitStages to initialize this Component instance.

is_inside_sensor_zone(position_global: numpy.ndarray)
static model_flux(ax_rad: Tuple[numpy.ndarray, numpy.ndarray], a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, b6, c1, c2)[source]

Polynomial of degree 4 (in radial direction) where every relevant parameter is logistically distributed (in axial direction)…

The idea is that in a*x^4, a should be able to change from positive to negative and back to positive with changing axial positions.

process_molecule_moving(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.molecule.Molecule)[source]
process_molecule_moving_after(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.molecule.Molecule)

Override this method for your sensing algorithm. The sensor manager will use this method to notify you of all molecule movement inside of the sensor zone. However, it may also notify you of molecule movement outside of your sensor zone! So make sure you additionally check the molecule position yourself. See SensorCounting for a simple reference implementation.

Parameters
  • simulation_kernel – The single simulation kernel

  • molecule – Which molecule has moved, with the new position

process_molecule_moving_before(simulation_kernel: pogona.simulation_kernel.SimulationKernel, molecule: pogona.molecule.Molecule)

Called before updating the position of a particle within a time step. Useful for SensorTeleporting, for example, which should consider the position of particles right after they have been spawned.

Parameters
  • simulation_kernel

  • molecule

Returns

process_new_time_step(simulation_kernel: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)
process_new_time_step_after(simulation_kernel: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)[source]
set_arguments(**kwargs)

Read arguments as key value pairs and set this component’s member variables accordingly. Validity of the argument values will be checked in initialize().

POPT = [0.587697665, 1.53675354, -0.659646889, 0.0089131107, 16.3605094, 0.00135037185, 7.07910938, 38.7609999, 0.327091249, 2.63243226, 2.18561674, 0.00243038985, 0.00623107849]

Parameters for model_flux determined by curve fitting.

component_name = 'Generic component'

Unique name of this component, unless it is “Generic component”.

id

Unique integer component ID

log_folder = ''

The file sensor[<component name>].csv will be created in here.

rotation = [0, 0, 0]
scale = [1, 1, 1]
sensor_id: int

Unique integer sensor ID. Set by the sensor manager.

shape = 'NONE'

Shape of this sensor. Valid shapes are defined in the pogona.Shapes enum.

property transformation: pogona.transformation.Transformation
translation = [0, 0, 0]