Skip to content
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

"Snowball" masking with snowblind #183

Merged
merged 27 commits into from
Dec 13, 2023
Merged

"Snowball" masking with snowblind #183

merged 27 commits into from
Dec 13, 2023

Conversation

gbrammer
Copy link
Owner

@gbrammer gbrammer commented Dec 5, 2023

Implement DQ masking with the snowblind module, which has better mask shapes that vary in size depending on the snowball intensity.

As of 5 Dec 2023, the functionality to run the masking on rate products has not yet been merged into the main snowblind repository, so it has to be installed from the fork:

pip install git+https://github.com/gbrammer/snowblind.git
snowblind

@gbrammer
Copy link
Owner Author

gbrammer commented Dec 5, 2023

With this PR, this algorithm is preferred in the initial data preprocessing in grizli.prep.mask_snowballs.

To refine the masks in existing exposures when making mosaics call grizli.aws.visit_processor.cutout_mosaic like

from grizli.aws import visit_processor

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

mos = visit_processor.cutout_mosaic('gds-snow', ra=53.0917130, dec=-27.7425336,
                              size=120,
                              filters=['F210M-CLEAR'],
                              clean_flt=False, s3output=None,
                              ir_scale=0.04,
                              half_optical=False,
                              weight_type='jwst',
                              kernel='square', pixfrac=0.8,
                              make_exptime_map=False,
                              skip_existing=False,
                              snowblind_kwargs=snowblind_kws, # set to something other than `None`
                             )

@gbrammer
Copy link
Owner Author

gbrammer commented Dec 5, 2023

h/t @jdavies-st

@pascaloesch
Copy link
Contributor

Note that snowblind requires scikit-image>=0.20.0, where 'skimage.morphology.isotropic_dilation' was introduced.

@gbrammer
Copy link
Owner Author

gbrammer commented Dec 7, 2023

Note that snowblind requires scikit-image>=0.20.0, where 'skimage.morphology.isotropic_dilation' was introduced.

Added in 93deb61. Thanks!

@jdavies-st
Copy link
Contributor

Note that snowblind requires scikit-image>=0.20.0, where 'skimage.morphology.isotropic_dilation' was introduced.

Thanks for noting this @pascaloesch. I'll update the requirements for snowblind and release.

@jdavies-st
Copy link
Contributor

snowblind 0.2.1 is now released with the updated functionality for working with _rate and _rateints files, and also with the updated scikit-image version requirement. Thanks! 👍

@gbrammer
Copy link
Owner Author

snowblind 0.2.1 is now released with the updated functionality for working with _rate and _rateints files, and also with the updated scikit-image version requirement. Thanks! 👍

Awesome, thanks!

@gbrammer gbrammer merged commit 09d06fd into master Dec 13, 2023
9 checks passed
@gbrammer gbrammer deleted the snowblind_mask branch April 25, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants