Transducers
- class stride.problem.transducers.Transducers(name='transducers', problem=None, **kwargs)[source]
Bases:
ProblemBase
The Transducers stores a reference to all the transducer devices that are used in a problem.
Transducers are identified through a numerical ID, which is >= 0.
A transducer can be added through
Transducers.add
and accessed throughTransducers.get
.- Parameters:
- add(item)[source]
Add a new transducer to the Transducers.
- Parameters:
item (Transducer) – Transducer to be added to the Transducers.
- default()[source]
Fill the container with the default configuration.
In this case, a single PointTransducer will be generated.
- get(id)[source]
Get a transducer from the Transducers with a known id.
- Parameters:
id (int) – Identifier of the transducer.
- Returns:
Found Transducer.
- Return type:
- get_slice(start=None, end=None, step=None)[source]
Get a slice of the indices of the transducer using
slice(start, stop, step)
.- Parameters:
start (int, optional) – Start of the slice, defaults to the first id.
end (int, optional) – End of the slice, defaults to the last id.
step (int, optional) – Steps in between transducers, defaults to 1.
- Returns:
Found transducers in the slice.
- Return type:
list
- property num_transducers
Get number of transducers in the Transducers.
- sub_problem(shot, sub_problem)[source]
Create a subset object for a certain shot.
A SubProblem contains everything that is needed to fully determine how to run a particular shot. This method takes care of selecting the portions of the Transducers that are needed for a given shot.
- Parameters:
shot (Shot) – Shot for which the SubProblem is being generated.
sub_problem (SubProblem) – Container for the sub-problem being generated.
- Returns:
Newly created Transducers instance.
- Return type:
- property transducer_ids
Get all transducer IDs in the Transducers.
- Returns:
IDs of the transducers.
- Return type:
list
- property transducers
Get all transducers as a list.
Transducer types
- class stride.problem.transducer_types.transducer.Transducer(id, name=None, *args, **kwargs)[source]
Bases:
ABC
,GriddedSaved
The transducer holds information about its location in space, its type, as well as other things such as IRs.
- Parameters:
- property coordinates
Coordinates of points in the transducer, relative to its centre.
- Returns:
Coordinate array.
- Return type:
ndarray
- sub_problem(shot, sub_problem)[source]
Create a subset object for a certain shot.
A SubProblem contains everything that is needed to fully determine how to run a particular shot. This method has no effect for this particular case.
- Parameters:
shot (Shot) – Shot for which the SubProblem is being generated.
sub_problem (SubProblem) – Container for the sub-problem being generated.
- Returns:
Transducer instance.
- Return type:
- type = ''
Type of transducer, e.g. point_transducer
- class stride.problem.transducer_types.point_transducer.PointTransducer(*args, **kwargs)[source]
Bases:
Transducer
This class describes a point transducers, in which a single point represents the effect of the device.
- property coordinates
Coordinates of points in the transducer, relative to its centre.
- Returns:
Coordinate array.
- Return type:
ndarray
- type = 'point_transducer'
Type of transducer, e.g. point_transducer