DynamicFieldModelLoader

class disco.DynamicFieldModelLoader(dataset, config, mass, charge, window_size=2, verbose=1)[source]

Bases: FieldModelLoader

Wraps 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:
datasetdisco.readers.FieldModelDataset

Dataset that reads field models from disk on demand

configdisco.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.

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.

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.