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:
- sampler
PotentialSampler
The object for sampling the potential. Can have a frame and representation type.
- measurer
MeasurementErrorSampler
orNone
(optional) The object for re-sampling, given observational errors.
- fitter
PotentialFitter
orNone
(optional) - residualer
None
(optional) - statistic
None
(optional)
- sampler
- Raises:
ValueError
If can’t set
residualer
withoutfitter
. If can’t setstatistic
withoutresidualer
.
Attributes Summary
The fitter.
The measurer.
Observer frame.
Observer representation type.
The potential from which we sample.
The frame in which the potential is sampled and fit.
Representation type of potential.
The residual function.
The sampler.
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:
- Returns:
- (1,)
PipelineResult
- (1,)
Notes
This actually calls the more general function
run
, withniter
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:
- n
int
(optional) number of sample points
- iterations
int
(optional) Number of iterations. Must be > 0.
- random
int
orRandomState
orNone
(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) - observable
str
orNone
(optional, keyword-only)
- n
- Returns: