drizzle_from_visit

grizli.utils.drizzle_from_visit(visit, output=None, pixfrac=1.0, kernel='point', clean=True, include_saturated=True, keep_bits=None, dryrun=False, skip=None, extra_wfc3ir_badpix=True, verbose=True, scale_photom=True, context='jwst_1130.pmap', weight_type='jwst_var', rnoise_percentile=99, calc_wcsmap=False, niriss_ghost_kwargs={}, snowblind_kwargs=None, jwst_dq_flags=['DO_NOT_USE', 'OTHER_BAD_PIXEL', 'UNRELIABLE_SLOPE', 'UNRELIABLE_BIAS', 'NO_SAT_CHECK', 'NO_GAIN_VALUE', 'HOT', 'WARM', 'DEAD', 'RC', 'LOW_QE'], nircam_hot_pixel_kwargs={}, niriss_hot_pixel_kwargs=None, get_dbmask=True, saturated_lookback=10000.0, write_sat_file=False, sat_kwargs={}, query_persistence_pixels=True, **kwargs)[source]

Make drizzle mosaic from exposures in a visit dictionary

Parameters
visitdict

Visit dictionary with ‘product’ and ‘files’ keys

outputWCS, Header, ImageHDU

Output frame definition. Can be a WCS object, header, or FITS HDU. If None, then generates a WCS with grizli.utils.make_maximal_wcs

pixfracfloat

Drizzle pixfrac

kernelstr

Drizzle kernel (e.g., ‘point’, ‘square’)

cleanbool

Remove exposure files after adding to the mosaic

include_saturatedbool

Include pixels with saturated DQ flag

keep_bitsint, None

Extra DQ bits to keep as valid

dryrunbool

If True, don’t actually produce the output

skipint

Slice skip to drizzle a subset of exposures

extra_wfc3ir_badpixbool

Apply extra WFC3/IR bad pix to DQ

verbosebool

Some verbose message printing

scale_photombool

For JWST, apply photometry scale corrections from the grizli/data/photom_correction.yml table

contextstr

JWST calibration context to use for photometric scaling

weight_type‘err’, ‘median_err’, ‘time’, ‘jwst’, ‘jwst_var’, ‘median_variance’

Exposure weighting strategy.

  • The default ‘err’ strategy uses the full uncertainty array defined in the ERR image extensions. The alternative

  • The ‘median_err’ strategy uses the median of the ERR extension

  • The ‘time’ strategy weights ‘median_err’ by the TIME extension, if available

  • For the ‘jwst’ strategy, if ‘VAR_POISSON’ and ‘VAR_RNOISE’ extensions found, weight by VAR_RNOISE + median(VAR_POISSON). Fall back to ‘median_err’ otherwise.

  • For ‘jwst_var’, use the weight as in weight_type='jwst' but also make a full variance map propagated from the ERR noise model.

rnoise_percentilefloat

Percentile defining the upper limit of valid VAR_RNOISE values, if that extension is found in the exposure files(e.g., for JWST)

calc_wcsmapbool

Calculate and return the WCS map

get_dbmaskbool

Get the bad pixel mask from the database

niriss_ghost_kwargsdict

Keyword arguments for niriss_ghost_mask

snowblind_kwargsdict

Arguments to pass to jwst_snowblind_mask if snowblind hasn’t already been run on JWST exposures

jwst_dq_flagslist

List of JWST flag names to include in the bad pixel mask. To ignore, set to None

nircam_hot_pixel_kwargsdict

Keyword arguments for grizli.jwst_utils.flag_nircam_hot_pixels. Set to None to disable and use the static bad pixel tables.

niriss_hot_pixel_kwargsdict

Keyword arguments for grizli.jwst_utils.flag_nircam_hot_pixels when running on NIRISS exposures. Set to None to disable and use the static bad pixel tables.

saturated_lookbackfloat

Time, in seconds, to look for saturated pixels in previous exposures that can cause persistence. Skip if saturated_lookback <= 0.

write_sat_filebool

Write persistence saturation tables

sat_kwargsdict

keyword arguments to get_saturated_pixels

query_persistence_pixelsbool

Also try to query the full saturated pixel history from the DB with saturated_lookback

Returns
outsciarray-like

SCI array

outwhtarray-like

Inverse variance WHT array

outvararray-like

Optional variance array, if the input weights are not explicitly inverse variance

headerHeader

Image header

flistlist

List of files that were drizzled to the mosaic

wcs_tabTable

Table of WCS parameters of individual exposures