DiamondLightSource / DiamondLightSource/durin

16 and 8 bit data

Open
#11 1 comment 0 reactions 1 assignee Claimed by @graeme-winter View on GitHub
Dominant language
C
Stars
3
Forks
6
Avg merge
1h 21m
Merged PRs (30d)
2

Description

Following from https://www.globalphasing.com/autoproc/wiki/index.cgi?DataProcessingHdf5Eiger16bit201910, where neggia does not help XDS detect overexposed pixels for 16 bit data.

The reason this "works" for durin is because durin pretends the raw data is signed when converting to 32 bit in the `COPY_AND_MASK` macro in `plugin.c` (resulting in sign rather than zero extension). This means that values over 32767 are interpreted as the corresponding negative number (in particular, 65535 is interpreted as -1).

This was a deliberate decision made after discussion with @graeme-winter a while ago, so overloaded pixels would be handled "as expected", even though it was a departure from neggia. This certainly seems to have been the better direction to take.

But it is maybe a bit too simple. Perhaps it would be better to treat the source data as unsigned, and identify the proper upper bound (even if it's just UINT_N_MAX) and only make negative (or -1) for pixels at or above that value. Compare with the suggested patch to neggia here:
https://github.com/CV-GPhL/neggia/commit/2d478640fbe1b88649bbf1d77d44cef2aba447e1

This would likely be a bigger issue for 8-bit data, where the highest value durin would be able to read would be 127, when it may be only the value 255 should be interpreted as -1.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.