Pipeline

class discO.Pipeline(sampler: PotentialSampler, measurer: MeasurementErrorSampler | None = None, fitter: PotentialFitter | None = None, residualer: ResidualMethod | None = None, statistic: Callable | None = None)[source]

Bases: object

Analysis Pipeline.

Parameters:
samplerPotentialSampler

The object for sampling the potential. Can have a frame and representation type.

measurerMeasurementErrorSampler or None (optional)

The object for re-sampling, given observational errors.

fitterPotentialFitter or None (optional)
residualerNone (optional)
statisticNone (optional)
Raises:
ValueError

If can’t set residualer without fitter. If can’t set statistic without residualer.

Attributes Summary

fitter

The fitter.

measurer

The measurer.

observer_frame

Observer frame.

observer_representation_type

Observer representation type.

potential

The potential from which we sample.

potential_frame

The frame in which the potential is sampled and fit.

potential_representation_type

Representation type of potential.

residualer

The residual function.

sampler

The sampler.

statisticer

The statistic function.

Methods Summary

__call__(n_or_sample, *[, total_mass, ...])

Run the pipeline for 1 iteration.

run(n_or_sample[, iterations, random, ...])

Call.

Attributes Documentation

fitter

The fitter.

measurer

The measurer.

observer_frame

Observer frame.

observer_representation_type

Observer representation type.

potential

The potential from which we sample.

potential_frame

The frame in which the potential is sampled and fit.

potential_representation_type

Representation type of potential.

residualer

The residual function.

sampler

The sampler.

statisticer

The statistic function.

Methods Documentation

__call__(n_or_sample: int | SkyCoord, *, total_mass: Quantity = None, c_err: Callable | CoordinateFrame | SkyCoord | BaseRepresentation | float | ndarray | Mapping | Quantity | None = None, observable: str | None = None, random: int | RandomState | None = None, **kwargs) object[source]

Run the pipeline for 1 iteration.

Parameters:
n_or_sampleint or (N,) SkyCoord (optional)

number of sample points

observablestr or None (optional, keyword-only)
**kwargs

Passed to run.

Returns:
(1,) PipelineResult

Notes

This actually calls the more general function run, with niter pinned to 1.

run(n_or_sample: int | Sequence[int], iterations: int = 1, *, random: int | RandomState | None = None, total_mass: Quantity = None, c_err: Callable | CoordinateFrame | SkyCoord | BaseRepresentation | float | ndarray | Mapping | Quantity | None | Literal[False] = None, observable: str | None = None, batch: bool = False, progress: bool = True, **kwargs) object[source]

Call.

Parameters:
nint (optional)

number of sample points

iterationsint (optional)

Number of iterations. Must be > 0.

randomint or RandomState or None (optional, keyword-only)

Random state or seed. In order that a sequence of samples is different in each element we here resolve random seeds into a RandomState.

original_potobject or None (optional, keyword-only)
observablestr or None (optional, keyword-only)
Returns:
PipelineResult