group_by_basis

psfsubtraction.fitpsf.group_by_basis(self)[source] [edit on github]

Group pixels with the same valid bases into one region.

For each valid pixel in the image, this function checks which bases are valid at that pixel. It then groups pixels with the same valid bases into one region.

If self.min_number_of_bases is set to an integer, only regions with at least that many valid bases are returned (default is 1).

Theoretically, there could be 2^60 combinations of bases for 60 bases, but in practice the valid pixels in the bases are not randomly distributed, so that typically a much smaller number of regions is generated.

Returns:
regions : list of index arrays