Coverage for src/ufig/plugins/convert_photons_to_adu.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-12 19:08 +0000

1# Copyright (c) 2013 ETH Zurich, Institute of Astronomy, Lukas Gamper 

2# <lukas.gamper@usystems.ch> 

3""" 

4Created on Aug 19, 2014 

5@author: Chihway Chang 

6""" 

7 

8from ivy.plugin.base_plugin import BasePlugin 

9 

10 

11class Plugin(BasePlugin): 

12 """ 

13 Convert integer photon counts into float ADU's by multiplying the quantum efficiency 

14 and dividing gain. 

15 

16 :param gain: gain of CCD detector (e/ADU) 

17 :return: image that is rescaled to some specified zero point 

18 

19 """ 

20 

21 def __call__(self): 

22 # rescale zero point 

23 self.ctx.image /= self.ctx.parameters.gain 

24 

25 if hasattr(self.ctx, "image_mask"): 

26 self.ctx.image[~self.ctx.image_mask] = 0 

27 

28 def __str__(self): 

29 return "convert photons to ADUs"