spectre.Visualization.InterpolateToMesh

Functions

forward_kwargs(kwargs)

interpolate_to_mesh(source_file_path, ...[, ...])

Interpolates an h5 file to a desired grid

spectre.Visualization.InterpolateToMesh.forward_kwargs(kwargs)
spectre.Visualization.InterpolateToMesh.interpolate_to_mesh(source_file_path, target_mesh, target_file_path, source_volume_data, target_volume_data, components_to_interpolate=None, obs_start=-np.inf, obs_end=np.inf, obs_stride=1)

Interpolates an h5 file to a desired grid

The function reads data from source_volume_data inside source_file_path, interpolates all components specified by components_to_interpolate to the grid specified by target_mesh and writes the results into target_volume_data inside target_file_path. The target_file_path can be the same as the source_file_path if the volume subfile paths are different.

Parameters:
  • source_file_path (str) – the path to the source file where the source_volume_data is

  • target_mesh (spectre.Spectral.Mesh) – the mesh to which the data is interpolated

  • components_to_interpolate (list of str, optional) – a list of all components that are to be interpolated. accepts regular expressions. By default ALL tensor components are interpolated.

  • target_file_path (str, optional) – the path to where the interpolated data is written. By default this is set to source_file_path so the interpolated data is written to the same file, but in a different subfile specified by target_volume_data.

  • source_volume_data (str, optional) – the name of the .vol file inside the source file where the source data can be found.

  • target_volume_data (str, optional) – the name of the .vol file inside the target file where the target data is written.

  • obs_start (float, optional) – disregards all observations with observation value strictly before obs_start

  • obs_end (float, optional) – disregards all observations with observation value strictly after obs_end

  • obs_stride (float, optional) – will only take every obs_stride observation