pogona.SensorEmpirical

class pogona.SensorEmpirical[source]

Bases: Sensor

Sensor based on empirical measurements of susceptibility variations within a susceptometer.

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

DEFAULT_FCT_PARAMS

Default distribution parameters for known sensors.

component_name

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

distribution_params

Distribution parameters obtained from curve fitting, for now applied to a logistic function by default.

log_folder

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

rotation

scale

shape

Shape of this sensor.

transformation

translation

use_known_sensor

Use distribution parameters obtained for known sensors in previous experiments.

__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)

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, ...)

set_arguments(**kwargs)

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

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

Use InitStages to initialize this Component instance.

is_inside_sensor_zone(position_global: ndarray)
process_molecule_moving_after(simulation_kernel: SimulationKernel, molecule: Molecule)[source]

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: SimulationKernel, 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: SimulationKernel, notification_stage: 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().

DEFAULT_FCT_PARAMS = {<KnownSensors.MS2G_BARTINGTON: 2>: [1.1710899115768234, 0.012806480117364473, 0.0017908368596852163], <KnownSensors.ERLANGEN_20200310: 3>: [1.1521874852663174, 0.017531424609419782, 0.003804701283874202]}

Default distribution parameters for known sensors. Values determined using curve fitting for the logistic function.

component_name = 'Generic component'

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

distribution_params = []

Distribution parameters obtained from curve fitting, for now applied to a logistic function by default. Alternatively, use use_known_sensor.

id

Unique integer component ID

log_folder = 'sensor_data'

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: Transformation
translation = [0, 0, 0]
use_known_sensor = 'MS2G_BARTINGTON'

Use distribution parameters obtained for known sensors in previous experiments.

Default: MS2G_BARTINGTON