MeasurementErrorSampler

class discO.MeasurementErrorSampler(*, c_err: Callable | CoordinateFrame | SkyCoord | BaseRepresentation | float | ndarray | Mapping | Quantity | None = None, method: str | None = None, **kwargs)[source]

Bases: CommonBase

Draw a realization given measurement errors.

Parameters:
c_errcallable() or None (optional)

Callable with single mandatory positional argument – coordinates (“c”) – that returns the absolute error.

frame: frame-like or None (optional, keyword-only)
The frame of the observational errors, ie the frame in which

the error function should be applied along each dimension.

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

The coordinate representation in which to resample along each dimension.

Returns:
PotentialSampler or subclass

If return_specific_class is True, returns subclass.

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

The method to use for resampling given measurement error. Only used if directly instantiating a MeasurementErrorSampler, not a subclass.

Raises:
KeyError

On class declaration if class registry information already exists, eg. if registering two classes with the same name.s

ValueError
  • If directly instantiating a MeasurementErrorSampler (not a subclass) and method is not in the registry

  • If instantiating a MeasurementErrorSampler subclass and method is not None.

Attributes Summary

frame

The frame.

representation_type

The representation type.

Methods Summary

__call__(c[, c_err, random])

Draw a realization given Measurement error.

run(c[, c_err, random, batch, progress])

Draw a realization given measurement error.

Attributes Documentation

frame

The frame.

representation_type

The representation type.

Methods Documentation

abstract __call__(c: CoordinateFrame | SkyCoord, c_err: Callable | CoordinateFrame | SkyCoord | BaseRepresentation | float | ndarray | Mapping | Quantity | None = None, *, random: int | RandomState | None = None, **kwargs) SkyCoord[source]

Draw a realization given Measurement error.

Parameters:
cSkyCoord instance
c_errcoord-like or callable() or Quantity or None (optional)
representation_type: |Representation| or None (optional, keyword-only)

The coordinate representation in which to resample along each dimension.

randomRandomState or int (optional, keyword-only)

The random number generator or generator seed. Unfortunately, scipy does not yet support Generator

**kwargs

passed to underlying instance

Returns:
SkyCoord

Notes

If this is MeasurementErrorSampler then arguments are passed to the wrapped instance (see ‘method’ argument on initialization).

run(c: SkyCoord, c_err: CoordinateFrame | SkyCoord = None, *, random: int | RandomState | None = None, batch: bool = False, progress: bool = True, **kwargs) SkyCoord[source]

Draw a realization given measurement error.

Parameters:
cSkyCoord instance
c_errSkyCoord instance
**kwargs

passed to __call__

Returns:
SkyCoord
Other Parameters:
randomRandomState or int (optional, keyword-only)

The random number generator or generator seed. Unfortunately, scipy does not yet support Generator

Notes

If this is MeasurementErrorSampler then arguments are passed to the wrapped instance (see ‘method’ argument on initialization).