process_direct_grism_visit

grizli.prep.process_direct_grism_visit(direct={}, grism={}, radec=None, outlier_threshold=5, align_clip=30, align_thresh=None, align_mag_limits=[14, 23, 0.05], align_rms_limit=2, align_triangle_ba_max=0.9, align_ref_border=100, align_min_flux_radius=1.0, align_min_nexp=2, align_assume_close=False, align_transform=None, align_guess=None, align_final_niter=8, max_err_percentile=99, catalog_mask_pad=0.05, match_catalog_density=None, column_average=True, sky_iter=10, run_tweak_align=True, tweak_fit_order=-1, skip_direct=False, fix_stars=False, tweak_max_dist=100.0, tweak_n_min=10, tweak_threshold=1.5, tweak_ref_exp=0, tweak_mosaic_iters=0, align_simple=True, single_image_CRs=True, skymethod='localmin', drizzle_params={}, iter_atol=0.0001, static_mask=False, imaging_bkg_params=None, run_separate_chip_sky=True, separate_chip_kwargs={}, reference_catalogs=['GAIA', 'PS1', 'SDSS', 'WISE'], use_self_catalog=False, nircam_wisp_kwargs={}, skip_nircam_grism_sky=True, oneoverf_kwargs={}, snowball_kwargs={}, angle_background_kwargs={}, miri_skyflat=True, miri_skyfile=None, use_skyflats=True, do_pure_parallel_wcs=True, write_ctx=False)[source]

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

Parameters
directdict

Dictionary with keys ‘files’ and ‘product’ for the direct images.

grismdict

Dictionary with keys ‘files’ and ‘product’ for the grism images.

radeclist

RA, Dec of the field center for the alignment.

outlier_thresholdfloat

Threshold for outlier rejection in the alignment.

align_clipfloat

Clip threshold for alignment.s

align_threshfloat

Threshold for alignment.

align_mag_limitslist

Magnitude limits for alignment.

align_rms_limitfloat

RMS limit for alignment.

align_triangle_ba_maxfloat

Maximum BA for triangle alignment.

align_ref_borderint

Border for alignment reference catalog.

align_min_flux_radiusfloat

Minimum flux radius for alignment.

align_min_nexpint

Minimum number of exposures for alignment.

align_assume_closebool

Assume close exposures for alignment.

align_transformstr

Transform for alignment.

align_guessstr

Guess for alignment.

align_final_niterint

Final number of iterations for alignment.

max_err_percentilefloat

Maximum error percentile for alignment.

catalog_mask_padfloat

Padding for the catalog mask.

match_catalog_densityfloat

Density for the match catalog.

column_averagebool

Compute column averages.

sky_iterint

Number of iterations for the sky.

run_tweak_alignbool

Run tweak alignment.

tweak_fit_orderint

Fit order for tweak alignment.

skip_directbool

Skip direct images.

fix_starsbool

Fix stars.

tweak_max_distfloat

Maximum distance for tweak alignment.

tweak_n_minint

Minimum number of stars for tweak alignment.

tweak_thresholdfloat

Threshold for tweak alignment.

tweak_ref_expint

Reference exposure for tweak alignment.

tweak_mosaic_itersint

Number of iterations for tweak mosaic.

align_simplebool

Simple alignment.

single_image_CRsbool

Single image CRs.

skymethodstr

Sky method. Options are ‘localmin’ and ‘globalmin’.

drizzle_paramsdict

Drizzle parameters.

iter_atolfloat

Absolute tolerance for iterations.

static_maskbool

Static mask.

imaging_bkg_paramsdict

Imaging background parameters.

run_separate_chip_skybool

Run separate chip sky.

separate_chip_kwargsdict

Separate chip sky parameters.

reference_catalogslist

Reference catalogs.

use_self_catalogbool

Use self catalog.

nircam_wisp_kwargsdict

NIRCam WISP parameters.

skip_nircam_grism_skybool

Skip NIRCam grism sky.

oneoverf_kwargsdict

One over f parameters.

snowball_kwargsdict

Snowball parameters.

angle_background_kwargsdict

Angle background parameters.

miri_skyflatbool

MIRI skyflat.

miri_skyfilestr

MIRI skyfile.

use_skyflatsbool

Use skyflats.

do_pure_parallel_wcsbool

Do pure parallel WCS.

write_ctxbool

Write context.

Returns
statusbool

Runtime status. True if successful.

Notes

For imaging exposures:

  1. Copies of individual exposures with fresh_flt_file

  • Run stwcs.updatewcs.updatewcs on each FLT

  1. “tweak” shift alignment of individual FLTs

  • If ACS or UVIS, do preliminary AstroDrizzle run to flag CRs

  1. Run AstroDrizzle to create first-pass mosaic

  2. Astrometric alignment of the drizzled image reference catalogs with align_drizzled_image

  • Propagate alignment back to FLT exposures

  1. Redrizzle visit mosaic with updated astrometry

  2. optional Subtract mosaic background from exposures with blot_background

  3. Make final visit catalog

  4. optional Fill saturated stars with ePSF models with fix_star_centers

For grism exposures:

If grism exposures are specified, first do the above for the direct images and then,

  1. Assign (refined) WCS of associated direct image to each grism exposure (match_direct_grism_wcs)

  2. Run AstroDrizzle to flag additional CRs, bad pixels

  3. Subtract 2D sky background (visit_grism_sky)

  • optional additional column-average grism background

  1. Redrizzle grism mosaic