Skip to content

Commit

Permalink
change snowblind default to min_radius=4
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed Dec 5, 2023
1 parent 027afb7 commit e525e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion grizli/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -3377,7 +3377,7 @@ def oneoverf_column_correction(visit, thresholds=[10,1.5], dilate_iter=[10,2], i

_im.flush()

SNOWBLIND_KWARGS = dict(new_jump_flag=1024, min_radius=6,
SNOWBLIND_KWARGS = dict(new_jump_flag=1024, min_radius=4,
growth_factor=1.5, unset_first=True)

def mask_snowballs(visit, snowball_erode=3, snowball_dilate=18, mask_bit=1024, instruments=['NIRCAM','NIRISS'], max_fraction=0.3, unset4=False, snowblind_kwargs=SNOWBLIND_KWARGS, **kwargs):
Expand Down Expand Up @@ -3436,6 +3436,7 @@ def mask_snowballs(visit, snowball_erode=3, snowball_dilate=18, mask_bit=1024, i
if snowblind_kwargs is not None:
sdq, sfrac = utils.jwst_snowblind_mask(_file, **snowblind_kwargs)
if sdq is not None:
# Close and reopen
_im.close()
with pyfits.open(_file, mode='update') as _xim:
_xim['DQ'].data |= sdq.astype(_xim['DQ'].data.dtype)
Expand Down
2 changes: 1 addition & 1 deletion grizli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5751,7 +5751,7 @@ def jwst_crds_photom_scale(hdul, context='jwst_1130.pmap', update=True, verbose=
return scale


def jwst_snowblind_mask(rate_file, require_prefix='jw', max_fraction=0.3, new_jump_flag=1024, min_radius=6, growth_factor=1.5, unset_first=True, verbose=True, **kwargs):
def jwst_snowblind_mask(rate_file, require_prefix='jw', max_fraction=0.3, new_jump_flag=1024, min_radius=4, growth_factor=1.5, unset_first=True, verbose=True, **kwargs):
"""
Update JWST DQ mask with `snowblind`. See
https://github.com/mpi-astronomy/snowblind.
Expand Down

0 comments on commit e525e9a

Please sign in to comment.