PotentialFitter

class discO.PotentialFitter(potential_cls: Any, *, key: module | str | None = None, **kwargs)[source]

Bases: CommonBase

Fit a Potential.

Parameters:
potential_cls

The type of potential with which to fit the data.

frame: frame-like or None (optional, keyword-only)

The frame of the fit potential.

Warning

Care should be taken that this matches the frame of the sampling potential.

representation_type: |Representation| or None (optional, keyword-only)

The coordinate representation.

Other Parameters:
keyModuleType or str or None (optional, keyword-only)

The key to which the potential belongs. If not provided (None, default) tries to infer from potential.

Attributes Summary

frame

The frame of the potential

potential_cls

The potential used for fitting.

potential_kwargs

representation_type

The representation type of the potential.

Methods Summary

__call__(sample[, mass])

Fit a potential given the data.

run(sample[, mass, batch, progress])

Fit.

Attributes Documentation

frame

The frame of the potential

potential_cls

The potential used for fitting.

potential_kwargs
representation_type

The representation type of the potential.

Methods Documentation

abstract __call__(sample: CoordinateFrame | SkyCoord, mass: Quantity | None = None, **kwargs) object[source]

Fit a potential given the data.

Parameters:
cSkyCoord instance
**kwargs

passed to fitting potential.

Returns:
Potentialobject
run(sample: CoordinateFrame | SkyCoord, mass: Quantity | None = None, *, batch: bool = False, progress: bool = True, **kwargs) object[source]

Fit.

Parameters:
sampleSkyCoord instance

can have shape (nsamp, ) or (nsamp, niter)

**kwargs

passed to fitting potential.

Returns:
Potentialobject