combine_sregions
- stcal.alignment.combine_sregions(sregion_list, det2world, intersect_footprint=None)[source]
Combine s_regions from input models to compute the s_region for the resampled data.
- Parameters:
sregion_list (list[str] or list[np.ndarray]) – List of s_regions from input models. If an element is a string, it will be converted to a footprint using util.sregion_to_footprint. If an element is already a footprint (2-D array of shape (N, 2)), it will be used directly.
det2world (~astropy.modeling.Model) – WCS detector-to-world transform for the resampled data. Must take in exactly two inputs (x, y) and return exactly two outputs (RA, Dec). Must have a valid inverse transform.
intersect_footprint (np.ndarray, optional) – Footprint of the output WCS in world coordinates, shape (N, 2). If provided, the combined footprint from the input s_region list will be intersected with this footprint.
- Returns:
The combined s_region.
- Return type:
- Raises:
ValueError – If there is no overlap between the input s_regions and the intersection footprint.