hpmcm.footprint module

class hpmcm.footprint.Footprint(image, slices)[source]

Bases: object

Wraps the slices returns by ndimage.find_objects

Parameters:
  • image (np.ndarray)

  • slices (tuple[slice, slice])

image

Original image

Type:

np.ndaray

slice_x

Slice of footprint in X

Type:

slice

slice_y

Slice of footprint in Y

Type:

slice

cutout

Image cutout

Type:

np.ndaray

extent()[source]

Return the extent of the Footprint, for use by matplotlib

Return type:

tuple[int, int, int, int]

class hpmcm.footprint.FootprintSet(image, fp_key, footprints)[source]

Bases: object

Wraps Footprints detected by photutils.segmentation.detect_sources

Parameters:
  • image (np.ndarray)

  • fp_key (np.ndarray)

  • footprints (list[Footprint])

image

Original image

Type:

np.ndarray

footprints

Footprints found in the image

Type:

list[Footprint]

fp_key

Map of footprint associations: -1 -> no association

Type:

np.ndarray

classmethod detect(image)[source]

Create a FootprintSet from a countsMap

Return type:

FootprintSet

Parameters:

image (ndarray) – Original image (counts map of source positions)

Return type:

Newly created FootprintSet

filter(buf, pixel_match_scale=1)[source]

Remove footprints outside the central region of cell

Return type:

FootprintSet

Parameters:
  • buf (int)

  • pixel_match_scale (int)