snowblind: algorithms for cleaning JWST data
snowblind provides steps for JWST near-infrared data that improve on, or add to, steps of the official jwst pipeline. They run like the pipeline's own steps, on their own or as hooks inside the jwst pipelines.
Read the documentation for how each step works and how to choose its settings.
What it provides
Steps
SnowblindStepflags snowballs, the large cosmic-ray events that leave a saturated core inside a jump-flagged halo. It grows each halo to follow the shape of the event, snowballs cut by the edge of the detector included, flags the ring around the core to the end of the integration, and flags the core's persistence in the later integrations of the ramp, for times measured for each detector and packaged with snowblind. It replaces the jump step'sexpand_large_events, which draws circles or ellipses, and works on rate products as well as ramps, so it can be applied after the fact.PersistenceFlagStepflags the pixels that saturated in an earlier exposure of the same detector, and the pixels next to them, for a time measured for each detector and packaged with snowblind. The jwstpersistencestep (as of jwst 3.0) needs a time chosen by hand and the exposures run one after another; this step takes a whole set of finished_rateor_calfiles at once.OpenPixelStepfinds open and hot pixels that have appeared since the reference bad-pixel mask was made, by comparing the exposures of each detector. Experimental.StreamCleanStepremoves 1/f noise (striping) from the ramp along each output channel's readout stream. Unlike the jwstclean_flicker_noisestep, it applies the same linear filter to every group difference, so it adds no noise along the ramp and does better the more groups there are.ResetRampFitStepis the jwst likelihood ramp fit with the reset level as an extra point at the start, so pixels with only one unsaturated group, such as the cores of bright stars, still get a rate.is deprecated and will be removed. It flags, in readouts that average several frames per group, the group after each jump and the group before saturation; the jwst saturation step (since jwst 1.16) and jump step flag the groups that need it and the ramp fits leave them out, so the step mostly removes good data.JumpPlusStepSparseResampleStepandSparseOutlierDetectionStepare the jwst resample and outlier detection steps for images with drizzle replaced by spizzle. The mosaic's variance planes are the exact variance of each pixel, and a noise factor image gives what the correlation between neighboring pixels adds to the noise of a sum over them; both steps are faster than the jwst steps.TiledOutlierStepfinds outliers against one reference built from the input pixels of all the exposures at once, on a grid finer than the pixels, so it resolves undersampled star cores: it finds more cosmic rays near stars and flags far fewer star cores than the jwst step, with the same settings for every filter, and never allocates a mosaic-sized array.
Pipelines
snowblind_detector1iscalwebb_detector1with StreamCleanStep, SnowblindStep and ResetRampFitStep in place, the SIRS reference-pixel correction turned on, and the pixels next to saturated ones flagged CHARGELOSS rather than SATURATED, so that SATURATED marks only the pixels that saturated. It works as a drop-in replacement.snowblind_image3iscalwebb_image3withTiledOutlierStepandSparseResampleStepin place (--outlier_step=sparse_outlierusesSparseOutlierDetectionStepfor the outliers). Also a drop-in replacement.
Installation
pip install snowblind
snowblind needs jwst 2.0.0 or later; earlier releases of snowblind work with earlier jwst releases. The resampling and outlier detection steps need spizzle as well:
pip install 'snowblind[spizzle]'
Getting started
Run Detector1 with the 1/f cleaning, the reset-anchored fit and the snowball flagging (and the SIRS reference-pixel correction, which the 1/f cleaning is matched to):
strun snowblind_detector1 jw..._uncal.fits
Or add only the snowball flagging to the jwst pipeline, as a hook after its jump step:
from jwst.pipeline import Detector1Pipeline
from snowblind import SnowblindStep
steps = {"jump": {"expand_large_events": False, "post_hooks": [SnowblindStep]}}
Detector1Pipeline.call("jw..._uncal.fits", steps=steps, save_results=True)
Flag persistence in a set of _cal files, after calwebb_image2:
from glob import glob
from snowblind import PersistenceFlagStep
PersistenceFlagStep.call(sorted(glob("jw*_cal.fits")), save_results=True, suffix="cal", output_dir="persist")
This writes each file again in persist/, with DO_NOT_USE and
PERSISTENCE set where an earlier exposure of the same detector saturated
recently.
Run Image3 with the snowblind outlier detection and resampling, which saves
the noise factor as <product>_nfactor.fits next to the _i2d.fits mosaic:
strun snowblind_image3 jw..._image3_asn.json
Results
StreamCleanStep on a dark exposure, against no cleaning and the jwst
clean_flicker_noise step:
The persistence of saturated stars against the time since their exposure
ended, which sets the time PersistenceFlagStep flags them for:
Citing snowblind
Please cite snowblind through its Zenodo record DOI,
10.5281/zenodo.15791614, that
always points to the latest release.
@software{snowblind,
author = {Davies, James E.},
title = {snowblind: algorithms for cleaning JWST data},
publisher = {Zenodo},
doi = {10.5281/zenodo.15791614},
url = {https://github.com/mpi-astronomy/snowblind}
}
The same information is in CITATION.cff.
Please open an issue if you have any problems!
Metadata
Release files for snowblind 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snowblind-1.4.1.tar.gz | 4.5 MB | With provenance | Details for snowblind-1.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snowblind-1.4.1-py3-none-any.whl | Python 3 | none | any | Details for snowblind-1.4.1-py3-none-any.whl |
Total release size: 5.0 MB
Release files / snowblind-1.4.1.tar.gz
| Download URL | snowblind-1.4.1.tar.gz |
|---|---|
| Size | 4.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
092a04c7055d7d7bb7498042fc2742fcd953e2a5be394c511779252f46faac77
|
|
BLAKE2b-256 checksum How to use checksums |
89e5b3addb64485171a170de452fe6d41d3e84e10f9921c559bb49655e097e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / snowblind-1.4.1-py3-none-any.whl
| Download URL | snowblind-1.4.1-py3-none-any.whl |
|---|---|
| Size | 412.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c65a8dab61be3b97184049f8b5eee6ccf1aaf7b69bad113a2bd9dd39cf8f322b
|
|
BLAKE2b-256 checksum How to use checksums |
c5a01af4647b2fde2e4f578d54347e250a827be0954f8a2290479130eb4a445d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for snowblind 1.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for snowblind-1.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.