plummer_xy¶
- artpop.space.plummer_xy(num_stars, distance, xy_dim, pixel_scale, scale_radius=<Quantity 10. pc>, dx=0, dy=0, drop_outside=False, random_state=None)[source]¶
Sample xy positions from a two-dimensional Plummer distributions using inverse transform sampling.
- Parameters
- num_starsint
Number of stars (i.e., positions) to sample.
- distancefloat or
Quantity
Distance to source. If float is given, the units are assumed to be
Mpc
.- xy_dimint or list-like
Dimensions of the mock image in xy coordinates. If int is given, will make the x and y dimensions the same.
- pixel_scalefloat or
Quantity
The pixel scale of the mock image. If a float is given, the units will be assumed to be
arcsec
perpixels
.- scale_radiusfloat or
Quantity
, optional Scale radius of the source. If a float is given, the units are assumed to be
kpc
. Must be greater than zero.- dxfloat, optional
Shift from center of image in pixels in the x direction.
- dyfloat, optional
Shift from center of image in pixels in the y direction.
- drop_outsidebool, optional
If True, drop all stars that fall outside of the image. In this case, the returned
ndarray
will not be masked.- random_state
None
, int, list of ints, orRandomState
If
None
, return theRandomState
singleton used bynumpy.random
. Ifint
, return a newRandomState
instance seeded with theint
. IfRandomState
, return it. Otherwise raiseValueError
.
- Returns
- xy
MaskedArray
orndarray
Masked numpy array of xy positions. Positions that fall outside the mock image are masked. If
drop_outside == True
, then the stars that fall outside of the image will be dropped and the returned array will not be masked.
- xy