gbrammer / grizli

Grizli: The "Grism redshift and line" analysis software
MIT License
67 stars 51 forks source link

Refine mosaic weight strategies #166

Open gbrammer opened 1 year ago

gbrammer commented 1 year ago

The fix implemented at https://github.com/gbrammer/grizli/pull/165 appears to improve the profile shapes of stars in drizzled image mosaics, though it does not necessarily produce statistically robust inverse variance wht images. Explore strategies for making optimal science and weight images for

  1. Source detection
  2. Photometry
  3. Morphological analysis with, e.g., galfit.
gbrammer commented 1 year ago

Added time weighting in PR https://github.com/gbrammer/grizli/pull/167.

gbrammer commented 1 year ago

Added jwst weighting in https://github.com/gbrammer/grizli/commit/af8d36a04d802afbaa9eb68f566586762d09bdc6, which weights by VAR_RNOISE + median(VAR_POISSON) if those extensions are available and falls back to the median_err strategy otherwise (e.g., for HST).

gbrammer commented 1 year ago

Fix bug in jwst weighting in https://github.com/gbrammer/grizli/commit/84ab356cb0f3e6cb7a54ba06356fd23ab38e185a.

gbrammer commented 1 year ago

More robust "tweak" alignment parameters updated in https://github.com/gbrammer/grizli/commit/a1d8bf96471d88b9dc05f1136d924d3200b6e231, with limits on source FLUX_RADIUS and matching tolerances.

The iterate_tweak_align function can also iterate the alignment corrections by aligning each exposure to a catalog made from the combination of the exposures in a visit, which should be deeper and more precise than the astrometry of individual exposures.

gbrammer commented 1 year ago

To use the updated weighting scheme when creating mosaics, run

grizli.aws.visit_processor.cutout_mosaic(...,
    weight_type='jwst',
    make_exptime_map=True,
)

The latter will make an exposure-time map that can be used to regenerate the Poisson component of the image variance map.