-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fixing non-NaNable ccd images #158
Conversation
@@ -255,8 +255,8 @@ def single_image_photometry(ccd_image, sourcelist, camera, observatory_location, | |||
"SKIPPING THIS IMAGE!") | |||
return None, None | |||
|
|||
# Set high pixels to NaN | |||
ccd_image.data[ccd_image.data > max_adu] = np.nan | |||
# Set high pixels to NaN (make sure ccd_image.data is a float array first) |
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.
I think you still need a line here making the data float, it just doesn't need a type check:
# Set high pixels to NaN (make sure ccd_image.data is a float array first) | |
# Set high pixels to NaN (make sure ccd_image.data is a float array first) | |
ccd_image.data = ccd_image.data.astype(float) |
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.
Didn't I cast it to float during the NaN replacement? (On iPhone, can't see code)
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.
You cast it as float for the comparison (inside the brackets) but the data itself is still int I think
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.
I think I fixed it now.
OK, it is now fixed. Sigh. I would have sworn I had been clever. Can you PLEASE test this with the integer image, just in case?
|
I just pushed a test which I verified fails without your fix 🎉 but unfortunately found out about #161 along the way 😭 . |
… flagging with NaN.
9e6e437
to
56c7e28
Compare
I implemented a fix for the ccddata not being NaN-able by converting it to float if needed. Can you check that your image will now process.
I also updated the CHANGES.rst file to cover recent changes.
Fixes #157