-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invert bit position in quality flags #91
Conversation
Ouch. I think this means this code isn't tested properly? |
Yes, I will add a more realistic test that really fills 32 bit big endian integers as expected from the files and get the corrupt mask for them. |
Just noticed another thing: Lines 755 to 760 in 817a82e
This can be fixed by redefining the alias: Lines 85 to 93 in 28a97a4
like this CH_3_CONTAMINATION = CH_3B_RS | CH_3B_RS_ANOMALY
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Just two minor comments.
pygac/tests/test_pod.py
Outdated
self.assertEqual(bits[0][-1], 1) # the last bit is filled | ||
# The fatal flag fills only the first bit | ||
self.assertEqual(bits[1].sum(), 1) # only one bit is filled | ||
self.assertEqual(bits[1][0], 1) # only one bit is filled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is required, but elements 3 and 4 of the quality_indicators
array are not tested for byte order here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: I guess it should be "only the first bit is filled"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is required, but elements 3 and 4 of the
quality_indicators
array are not tested for byte order here
My idea is to check only the bit representation for the trivial cases (fist and last bit set). This should be sufficient to be sure that the bits look as expected for this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR corrects the quality flags which leads to differences in the masked scanlines as presented in #90.