Skip to content

Commit

Permalink
Fix issue feder-observatory#157 with setting ccd_data to float before…
Browse files Browse the repository at this point in the history
… flagging with NaN.
  • Loading branch information
JuanCab committed Aug 17, 2023
1 parent 481ab5f commit c3876ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stellarphot/photometry/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def single_image_photometry(ccd_image, sourcelist, camera, observatory_location,
"SKIPPING THIS IMAGE!")
return None, None

# Set high pixels to NaN
# Set high pixels to NaN (make sure ccd_image.data is a float array first)
if ccd_image.data.dtype != np.float:
ccd_image.data = ccd_image.data.astype(np.float)
ccd_image.data[ccd_image.data > max_adu] = np.nan

# Extract necessary values from sourcelist structure
Expand Down

0 comments on commit c3876ac

Please sign in to comment.