Skip to content

Commit

Permalink
Add toggle when finding_bad_pixels to overwrite the existing dq array…
Browse files Browse the repository at this point in the history
… or start a new clean one.
  • Loading branch information
AarynnCarter committed Aug 7, 2024
1 parent 0ea9999 commit aa46abc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spaceKLIP/imagetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ def subtract_background(self,

def find_bad_pixels(self,
method='dqarr',
overwrite_dq=True,
dqarr_kwargs={},
sigclip_kwargs={},
custom_kwargs={},
Expand All @@ -794,6 +795,10 @@ def find_bad_pixels(self,
- custom: use a custom bad pixel map
The default is 'dqarr'.
overwrite_dq : bool, optional
Toggle to start a new empty DQ array, or built upon the existing array.
The default is True
dqarr_kwargs : dict, optional
Keyword arguments for the 'dqarr' identification method. Available keywords are:
Expand Down Expand Up @@ -854,8 +859,11 @@ def find_bad_pixels(self,
maskfile = self.database.obs[key]['MASKFILE'][j]
mask = ut.read_msk(maskfile)

# Make copy of DQ array filled with zeros, i.e. all good pixels
pxdq_temp = np.zeros_like(pxdq)
if overwrite_dq:
# Make copy of DQ array filled with zeros, i.e. all good pixels
pxdq_temp = np.zeros_like(pxdq)
else:
pxdq_temp = pxdq

# Skip file types that are not in the list of types.
if self.database.obs[key]['TYPE'][j] in types:
Expand Down

0 comments on commit aa46abc

Please sign in to comment.