yaq-project / yaqd-seek

yaq daemons for Seek thermal cameras
GNU Lesser General Public License v3.0
3 stars 2 forks source link

issues with signal offset #10

Closed ddkohler closed 1 year ago

ddkohler commented 1 year ago

16-bit readouts sometimes come back as numbers both near zero and 2^16 (this is a terrible situation for plotting). Possible solutions:

ksunden commented 1 year ago

this reads to me as one of two things:

1: these are not being treated as signed integers when they are (not sure why they would be signed, cameras ususally aren't) or vice versa

2: there is an off by one in reading the bytes so bytes which should be AABBCCDDEEFF... are read as integers AB BC CD DE EF... (missing the first byte) This has previously been seen with the InGaAs array detector, for instance.

ksunden commented 1 year ago

https://github.com/yaq-project/yaqd-seek/blob/main/yaqd_seek/_seek_compact.py#L141-L142

Yeah, if you are subtracting like this, you should either upgrade the dtype to int32 (signed, larger so no risk of saturation) or do something like data -= np.minimum(data, cal) to avoid underflow rather than adding an arbitrary offset

ddkohler commented 1 year ago

Right indeed @ksunden; I should be treating readouts as signed ints. Fix incoming.

Will also upgrade to int32 for subtraction.

ddkohler commented 1 year ago

closed via #11