RVS_Continuous

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

Bases: MeasurementErrorSampler

Draw a realization given a scipy.stats.rv_continuous.

Parameters:
rvsrv_continuous subclass (keyword-only)

In the call method this is used to generate points by calling .rvs() with:

  • params set by kwarg

  • loc from the samples

  • scale from c_err

  • size as the samples’ shape

  • random_state from the NumPy random generator.

c_errfloat or None (optional, keyword-only)

The absolute error.

**kwargs

Stored as params.

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.

Attributes Summary

rvs

The random-variate sampler (rvs).

Methods Summary

__call__(c[, c_err, random])

Draw a realization given the errors.

Attributes Documentation

rvs

The random-variate sampler (rvs).

Methods Documentation

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

Draw a realization given the errors.

Steps:

  1. transforms c to frame and representation type.

  2. constructs RVS parameters, in particular scale.

  3. (re)samples, on the representation array.

  4. reverse constructs the new c in the original frame and representation type.

Parameters:
cSkyCoord instance

The coordinates at which to resample.

c_errSkyCoord or None (optional)

The scale of the errors. Must be in the correct frame and representation type.

d_pos is created from c_err. It sets scale.

**params

Parameters into the RVS. Scipy normally does these as arguments, but it also works as kwargs.

Returns:
new_cSkyCoord

The resampled points. Has the same frame, representation_type, and shape and framas c.

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

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