padre_meddea.util.pixels#

Provides tools to deal with pixels

Functions

parse_pixelids(ids)

Given pixel id infomration, return the asic numbers and channel numbers

get_pixelid(asic_num, pixel_num)

Given an asic number and a pixel number return the pixelid

get_pixel_str(asic_num, pixel_num)

pixelid_to_str(ids)

Given unparsed pixel ids, return strings for each

pixel_to_str(pixel_num)

Given a pixel number, return a standardized string.

Classes

PixelList(*args, **kwargs)

A list of pixels

class padre_meddea.util.pixels.PixelList(*args, **kwargs)[source]#

A list of pixels

Parameters:
  • asics (list) – The asic numbers

  • pixels (list) – The pixel numbers

  • pixel_ids (list) – The pixel ids

Raises:

ValueError

Examples

>>> from padre_meddea.util import PixelList
>>> px_list = PixelList(asics=[0, 0], pixels=[0, 1])  # two pixels both from asic 0
>>> px_list = PixelList(asics=[0, 1], pixels=[8, 9])  # two small pixels, one from asic 0 and another from asic 1
>>> px_list = PixelList(pixelids=[51738, 51720])  # using pixel ids
>>> large_pixs = PixelList().all_large()  # every large pixel
>>> small_pixs = PixelList().all_small()  # every large pixel
>>> large_pixs_det1 = PixelList().all_large(asics=[1])  # all large pixels from asic 1
_add_helper_columns()[source]#

Add additional helper columns

_verify()[source]#

Verify consistency of the data.

classmethod all(asics: list = [0, 1, 2, 3])[source]#
classmethod all_large(asics: list = [0, 1, 2, 3])[source]#
classmethod all_small(asics: list = [0, 1, 2, 3])[source]#
select_large(asics: list = [0, 1, 2, 3])[source]#

Return only large pixels from an existing pixel list

select_small(asics: list = [0, 1, 2, 3])[source]#

Return only small pixels from an existing pixel list

padre_meddea.util.pixels.get_pixel_str(asic_num: int, pixel_num: int)[source]#
padre_meddea.util.pixels.get_pixelid(asic_num: int, pixel_num: int) int[source]#

Given an asic number and a pixel number return the pixelid

padre_meddea.util.pixels.parse_pixelids(ids)[source]#

Given pixel id infomration, return the asic numbers and channel numbers

padre_meddea.util.pixels.pixel_to_str(pixel_num: int) str[source]#

Given a pixel number, return a standardized string.

padre_meddea.util.pixels.pixelid_to_str(ids)[source]#

Given unparsed pixel ids, return strings for each