build_driz_weight

stcal.resample.utils.build_driz_weight(model, weight_type=None, good_bits=None, flag_name_map=None)[source]

Build drizzle weight map.

Create a weight map that is used for weighting input images when they are co-added to the output model.

Parameters:
  • model (dict) – Input model: a dictionary of relevant keywords and values.

  • weight_type (str or None, optional) – The weighting type (“exptime”, “ivm”, or “ivm-sky”) for adding models’ data. For weight_type="ivm" and weight_type="ivm-sky", the weighting will be determined per-pixel using the inverse of either the read noise (VAR_RNOISE) or sky variance (VAR_SKY) arrays, respectively. If the array does not exist, the weight is set to 1 for all pixels (i.e., equal weighting). If weight_type="exptime", the weight will be set equal to the measurement time when available and to the exposure time otherwise for pixels not flagged in the DQ array of the model. The default value of None will set weights to 1 for pixels not flagged in the DQ array of the model. Pixels flagged as “bad” in the DQ array will have their weights set to 0.

  • good_bits (int, str, None, optional) –

    An integer bit mask, None, a Python list of bit flags, a comma-, or '|'-separated, '+'-separated string list of integer bit flags or mnemonic flag names that indicate what bits in models’ DQ bitfield array should be ignored (i.e., zeroed).

    See Resample for more information.

  • flag_name_map (astropy.nddata.BitFlagNameMap, dict, None, optional) – A ~astropy.nddata.BitFlagNameMap object or a dictionary that provides mapping from mnemonic bit flag names to integer bit values in order to translate mnemonic flags to numeric values when bit_flags that are comma- or ‘+’-separated list of mnemonic bit flag names.