DynamicFieldModelLoader¶
- class disco.DynamicFieldModelLoader(dataset, config, mass, charge, window_size=2, verbose=1)[source]¶
Bases:
FieldModelLoaderWraps a FieldModelDataset to provide delayed loading of field models.
Tis class pauses particles if the required time slice of field data is not loaded. This is useful for large datasets where not all time slices are available at once, such as in the case of simulations.
Get an instance that is dimensionalized and stored on the GPU.
- Parameters:
- dataset
disco.readers.FieldModelDataset Dataset that reads field models from disk on demand
- config
disco.TraceConfig Configuration for the trace
- massscalar with units
Mass of the particles
- chargescalar with units
Charge of the particles
- window_sizeint
Number of time slices to load at once
- verbose: int
Verbosity level for logging. Set to 0 to supress output.
- dataset
Methods Summary
multi_interp(t, y, stopped_cutoff)Interpolate field values at given positions.
Methods Documentation
- multi_interp(t, y, stopped_cutoff)[source]¶
Interpolate field values at given positions.
- Parameters:
- t: cupy array.
Vector of dimensionalized particle times.
- y: cupy array
Vector of shape (npart, nstate) of ongoing particle states.
- stopped_cutoff: int
Cutoff index for particles that no longer require processing.
- Returns:
- intep_result:
_MultiInterpResult Contains interpolated field values for each particle at the given times.
- paused: cupy array of booleans
Indicates whether each particle is paused (True) or not (False). Particles are paused if their time is outside the range of loaded field models.
- intep_result:
Notes
The CuPy arrays in the output arrays are atttached to this instance. Subsequent calls will overwrite them. If you want to avoid this, call .copy() on each array.