imaginglss.model.brick module

The base Python object corresponding to an imaging brick. This object contains only the meta-data, and it calls imagerepo to handle looking up the pixel-level information.

class imaginglss.model.brick.Brick(index, id, name, ra, dec, ra1, ra2, dec1, dec2)[source]

Bases: object

The base (immutable) object corresponding to an imaging brick. This object contains only the meta-data, and is immutable.

It uses ImageRepo to handle looking up the pixel-level information.

Attributes

index ( integer) Internal index used by BrickIndex
id ( integer) ID of the brick as in the Tractor catalogue (unique). Note that we do not use it in indexing.
name (string_like) name of the brick as in the Tractor catalogue (unique)
ra (float) center coordinate ra
dec (float) center coordinate dec
ra1 (float) min coordinate ra
dec1 (float) min coordinate dec
ra2 (float) max coordinate ra
dec2: float max coordinate dec
query(repo, coord)[source]

Query the pixel coordinate in ‘xy’ system from RA/DEC system.

Note that the returned array is in a x-first-varying order. To index the ndarray image, use [y, x].

Parameters:

repo : ImageRepo

image repository that contains the necessary transformation for this brick

coord : array_like

coord = (RA, DEC) tuple of arrays

Returns:

xy : array_like

a (2xN) array, xy=(x, y).

readout(coord, repo, default=nan)[source]

Return image values from an image repository.

Parameters:

coord : array_like

Coordinate of the pixels, coord=(RA, DEC)

repo : ImageRepo

Image repository to read from. Refer to DataRelease.images.

default : float

Default value to return if the pixel is outside of the brick.

Returns:

values : array_like

values read out from repo.

revert(repo, xy)[source]

Look up RA/DEC coord from pixels coordinate in ‘xy’ system.

Parameters:

repo : ImageRepo

image repository that contains the necessary transformation for this brick

xy : array_like

Returns:

coord : array_like

coord=(RA, DEC) for each given position.