fieldinterppoints.py¶
- class FieldInterpPoints(sim_data, comp_keys, spatial_dims)[source]¶
Bases:
IFieldInterpClass for interpolating mesh-free simulation fields to the virtual sensor locations and sample times.
Implements the IFieldInterp interface.
- __init__(sim_data, comp_keys, spatial_dims)[source]¶
- Parameters:
sim_data (
mh.SimData) – Simulation data object containing the physical field(s) that the virtual sensors will sample.comp_keys (
tuple[str,...]) – Tuple of string keys for the components of the field(s) to be interpolated.spatial_dims (
EDim) – Enumeration used to determine the number of spatial dimensions of the simulation to determine the underlying element types in the mesh.
- interp_field(points, sample_times=None)[source]¶
Invokes the field interpolation algorithm at the given points and sample times. Spatial interpolation is performed first at existing data time steps. If the sample times are the same as the underlying data no temporal interpolation is performed otherwise linear interpolation is performed between time steps for each point in space.
- Parameters:
points (
np.ndarray) – Array of points to spatially interpolate the physical field to.sample_times (
np.ndarray | None, optional) – Vector of times at which to sample the underlying physical field, by default None. If this is None then no temporal interpolation is performed and the points returned correspond to the input simulation time steps.
- Returns:
np.ndarray– Simulated measurement array intepolated from the simulation data to the desired sensor locations and sample times with shape=( num_sensors,num_field_components,num_sample_times).