Closed qwert3434 closed 11 months ago
It's great to call this out. Next step is to submit a pull request that fixes this.
It's great to call this out. Next step is to submit a pull request that fixes this.
Cool. I will fix it and run some tests locally first to make sure it works as intended, then submit a pull request.
Closed in #115
In some functions (like wrapper.extract_det1_events), (~clobber) are used to reverse the Bool parameters. This is causing new files not being generated whether clobber is True or False. "not clobber" should be used instead of ~clobber. Because ~ is a bitwise operator so ~True will be ~(0001)=1110 which is -2 in two's complement. (A simple test result is attached)
There are other places that uses bitwise operators like util.straylight_background it uses "all_mask = all_mask & ~rm"(line 495). Both & and ~ are bitwise operators. I didn't check exactly what the code wants to do but they are not the same with 'and' and 'not' operators. Since there's an issue with using ~clobber, the use of other bitwise operators might need a double check as well.