Image Pre-preparation

Astrometric Alignment

Grism Background Subtraction


grizli.prep Module

Align direct images & make mosaics


add_external_sources([root, maglim, fwhm, ...])

Add Gaussian sources in empty parts of an image derived from an external catalog

align_drizzled_image([root, mag_limits, ...])

Pipeline for astrometric alignment of drizzled image products

apply_persistence_mask(flt_file[, path, ...])

Make a mask for pixels flagged as being affected by persistence

apply_region_mask(flt_file[, dq_value, verbose])

Apply DQ mask from a DS9 region file

apply_region_mask_from_db(flt_file[, ...])

Query the exposure_region_mask table and apply masks

apply_saturated_mask(flt_file[, dq_value, ...])

Saturated WFC3/IR pixels have some pulldown in the opposite amplifier

apply_tweak_shifts(wcs_ref, shift_dict[, ...])

Apply derived shifts to exposure WCS

apply_visit_skyflat(visit[, skyfile, verbose])

Apply the skyflat


Convert an ASN file to a dictionary

blot_background([visit, bkg_params, ...])

Blot SEP background of drizzled image back to component FLT images

catalog_exposure_overlaps(ra, dec[, ...])

Count number of items in a list of footprints overlap with catalog positions


Check if a file or list of files is JWST image.


Make sure all files and modules are in place and print some information if they're not

clean_amplifier_residuals(files[, ...])

Fit and remove a 2D polynomial fit to the detector-frame UVIS/WFC images

clean_drizzle(root[, context, fix_wcs_system])

Zero-out WHT=0 pixels in drizzle mosaics

clip_lists(input, output[, clip])

Clip [x,y] arrays of objects that don't have a match within clip pixels in either direction

compute_SEP_auto_params(data, data_bkg, mask)

Compute SourceExtractor-like AUTO params with sep

drizzle_footprint(weight_image[, shrink, ...])

Footprint of image pixels where values > 0.

drizzle_overlaps(exposure_groups[, ...])

Combine overlapping visits into single output mosaics

extract_fits_log([file, get_dq])

not used

find_direct_grism_pairs([direct, grism, ...])

Compute pairs of direct and grism exposures

find_single_image_CRs(visit[, simple_mask, ...])

Use LACosmic to find CRs in parts of an ACS mosaic where only one exposure was available

fix_star_centers([root, mag_lim, verbose, ...])

Unset the CR bit (4096) in the centers of bright objects

fresh_flt_file(file[, preserve_dq, path, ...])

Copy "fresh" unmodified version of a data file from some central location


Get dictionary of SEP integer flags

get_filter_ee_ratio(tab, filter[, ref_filter])

Relative EE correction within a specified aperture, in arcsec.

get_hst_aperture_correction(filter[, raper, ...])

Get single aperture correction from tabulated EE curve

get_jwst_wfssbkg_file(file[, valid_flat, ...])

Divide flat-field from NIRISS wfssbkg file

get_kron_tot_corr(tab, filter[, inst, ...])

Compute total correction from tabulated EE curves


Get the path to an appropriate NIRCam wisp template file, assuming the templates are stored in [GRIZLI_PATH]/CONF/NircamWisp

get_rotated_column_average(data, mask, theta)

Get median along an image axis after rotating by and angle theta, e.g., for long NIRcam diffraction spikes

get_seg_iso_flux(data, seg, tab[, err, ...])

Integrate flux within the segmentation regions.

get_vexas_catalog([ra, dec, radius, ...])

VEXAS DR2 from vizier

get_vhs_catalog([ra, dec, radius, corners, ...])

VEXAS DR2 from vizier

get_visit_radec_from_database(visit[, nmax])

Get reference astrometry from grizli database

get_wfc3ir_kron_tot_corr(tab, filter[, ...])

Compute total correction from WFC3/IR EE curves

iterate_tweak_align(direct, grism[, ...])

Iterate tweak_align aligning exposures to a mosaic created from those exposures

log_wcs(root, drz_wcs, shift, rot, scale[, ...])

Save WCS offset information to an ascii file

make_SEP_FLT_catalog(flt_file[, ext, ...])

Make a catalog from a FLT file

make_SEP_catalog([root, sci, wht, ...])

Make a catalog from drizzle products using the SEP implementation of SourceExtractor

make_SEP_catalog_from_arrays(sci, err, mask)

Make a catalog from arrays using sep

make_drz_catalog([root, sexpath, threshold, ...])

Make a SExtractor catalog from drizzle products

make_visit_average_flat(visit[, clip_max, ...])

Make an average "skyflat" for exposures in a visit, e.g., for MIRI

manual_alignment(visit, ds9[, reference, ...])

Manual alignment of a visit with respect to an external region file

mask_snowballs(visit[, snowball_erode, ...])

Mask JWST IR snowballs

match_direct_grism_wcs([direct, grism, ...])

Match WCS of grism exposures to corresponding direct images

match_lists(input, output[, transform, scl, ...])

Compute matched objects and transformation between two (x,y) lists.

nircam_wisp_correction(calibrated_file[, ...])

Fit the NIRCam wisp template and subtract

oneoverf_column_correction(visit[, ...])

Masked column/row correction for 1/f noise in JWST exposures

process_direct_grism_visit([direct, grism, ...])

Full processing of a direct (+grism) image visit.


Get a region masks from a local DS9 window and make a table that can be sent to the exposure_region_mask database table.

separate_chip_sky(visit[, filters, ...])

Get separate background values for each chip.

set_grism_dfilter(direct, grism)

Set direct imaging filter for grism exposures

subtract_visit_angle_averages(visit[, ...])

Subtract angle averages from exposures in a visit group

tweak_align([direct_group, grism_group, ...])

Intra-visit shift alignment

tweak_flt([files, max_dist, threshold, ...])

Refine shifts of FLT files

update_wcs_fits_log(file, wcs_ref[, ...])

Make FITS log when updating WCS

visit_grism_sky([grism, apply, ...])

Subtract sky background from grism exposures