BoundingBox¶
- class kszx.BoundingBox(points, pixsize, rpad)¶
Subclass of Box whose size/position are chosen to match a galaxy survey.
Constructor args:
- points (numpy array with shape (ngal,3)):
Contains galaxy locations, in coordinate system with observer at origin. Usually obtained by calling Catalog.get_xyz(cosmo) – see example below.
- pixsize (float):
Pixel side length (caller-specified units, usually Mpc).
- rpad (float):
Box padding in same units as ‘points’ (e.g. rpad=200 for 200 Mpc).
The BoundingBoxconstructor will automatically choose the number of pixels (npix) and box position (cpos), so that the box contains the galaxy survey with the specified padding (rpad).
For more info on Boxes, see the
Boxbase class docstring.Inherits the following members from
Box:ndim (integer): Number of dimensions (usually 3).
pixsize (float): Pixel side length in user-defined coordinates.
boxsize (length-ndim array): Box side lengths in user-defined coordinates (equal to npix * pixsize).
npix (length-ndim array): Real-space map shape, represented as numpy array.
real_space_shape (tuple): same as ‘npix’, but represented as tuple instead of 1-d array
nk (length-ndim array): Fourier-space map shape, represented as numpy array.
fourier_space_shape (tuple) same as ‘nk’, but represented as tuple instead of 1-d array
cpos (length-ndim array): location of box center, in observer coordinates
lpos (length-ndim array): location of lower left box corner, in observer coordinates
rpos (length-ndim array): location of upper right box corner, in observer coordinates
kfund (length-ndim array): Lowest frequency on each axis (equal to 2pi/boxsize)
knyq (float): Nyquist frequency (equal to pi/pixsize)
box_volume (float): Box volume (equal to prod(boxsize))
pixel_volume (float): Pixel volume (equal to pixsize^N)
The BoundingBox subclass also contains the following members:
rpad (float): padding that was specified in BoundingBox constructor
rmin (float): min distance between observer and galaxies (specified in constructor)
rmax (float): max distance between observer and galaxies (specified in constructor)
Example:
# Make bounding box which contains galaxies + randoms. # Setup: 'gcat' and 'rcat' are objects of type Catalog. # 'cosmo' is an object of type Cosmology. gcat_xyz = gcat.get_xyz(cosmo) # shape (ngal,3) rcat_xyz = rcat.get_xyz(cosmo) # shape (rand,3) all xyz = np.concatenate((gcat_xyz,rcat_xyz)) bbox = kszx.BoundingBox(all_xyz, pixsize=10, rpad=200)