CMOS detectors: result.image has type float64 instead of int
The documentation of simple_adc (https://esa.gitlab.io/pyxel/doc/stable/references/model_groups/readout_electronics.html#simple-adc) says the default type is uint32.
However, I noticed that result.image, by default, has dtype float64:
result.image.dtype
Out[3]: dtype('float64')
When I used the following extra configuration:
- name: simple_adc
func: pyxel.models.readout_electronics.simple_adc
enabled: true
arguments:
data_type: uint16
I ended up with the following dtype:
result.image.dtype
Out[2]: dtype('float32')
This array correspond to ADU and is thus limited to integer only if I'm not mistaken. Unless there's a reason and a usecase to have float, wouldn't it be more accurate and with smaller disk and memory usage to store int instead?
I also remember seeing a page like this one for CCD but for CMOS, where it explicitely said image had a dtype of float64, but I can't seem to find it now.
Depending on the adc_bit_resolution
, it could potentially be limited to a smaller number of bits to save even more space (uint8, uint16 or uint32). It's nice to have the option in simple_adc, but since this is closely related to adc_bit_resolution
, it means to me we have to specify the same parameter twice. And also, to me it make more sense to attach the dtype of result.image to the detector definition, as it depends on it directly, while attaching it to a specific step mean if you're using another, you might end up with a different dtype, with the same detector. But I also might miss usecase that explain why it was decided that way.
Hope it helps, Christophe