imas_paraview.convert.Converter¶
-
class imas_paraview.convert.Converter(ids, dbentry=
None)¶ Bases:
object-
__init__(ids, dbentry=
None)¶
Methods
__init__(ids[, dbentry])get_grids(grid_id, plane_config)Fetches the unstructured grids at a certain time index.
ggd_to_vtk([time, time_idx, scalar_paths, ...])Converts the GGD of an IDS to VTK format.
write_to_xml(output_path[, index_list])Convert an IDS to VTK format and write it to disk using the XML output writer.
- get_grids(grid_id, plane_config)¶
Fetches the unstructured grids at a certain time index. Note that this function is cached using lru_cache based on time_idx.
- Parameters:
- grid_id¶
ID of the GGD grid corresponding to a certain time index. This is used for creation of the hash of the cache entry.
- plane_config¶
plane_config used to generate the grid. These should be all zero for a regular GGD. However, for a JOREK GGD, these can be changed, and changing them should trigger the grid to be reloaded.
- Returns:
Dictionary containing the ugrid of each subset, with the subset index as keys.
-
ggd_to_vtk(time=
None, time_idx=None, scalar_paths=None, vector_paths=None, plane_config: InterpSettings | None =None, outInfo=None, progress=None, parent_idx=0)¶ Converts the GGD of an IDS to VTK format.
- Parameters:
- time=
None¶ Time step to convert. Defaults to converting the first time step.
- time_idx=
None¶ Time index to convert. Defaults to converting the first time step.
- scalar_paths=
None¶ A list of IDSPaths of GGD scalar arrays to convert. Defaults to None, in which case all scalar arrays are converted.
- vector_paths=
None¶ A list of IDSPaths of GGD vector arrays to convert. Defaults to None, in which case all vectors arrays are converted.
- plane_config: InterpSettings | None =
None¶ Data class containing the interpolation settings.
- outInfo=
None¶ Paraview's Source outInfo information object.
- progress=
None¶ Progress indicator for Paraview.
- time=
- Returns:
vtkPartitionedDataSetCollection containing the converted GGD data.
-
write_to_xml(output_path: Path, index_list=
None)¶ Convert an IDS to VTK format and write it to disk using the XML output writer.
-
__init__(ids, dbentry=