get_overlap

jwst.wfs_combine.wfs_combine.get_overlap(sci_int_1, sci_int_2, nom_off_x, nom_off_y)[source]

Apply nominal offsets to determine the overlap in interpolated images.

Nominal offsets are calculated as image 2 relative to image 1.

The resulting two subarrays are the pixels common to both. In other words, image 2 is shifted onto the frame of image 1, with the dimensions of the subarrays equal to the dimensions of the overlap.

To illustrate with pseudocode for a 1D array with length ‘length’: for a given offset ‘off’, the resulting initial and final indices, and the elements of arrays indexed are:

for off < 0 : ix = 0 and final_x = length - abs(off)
   subarray indices: sub_1[0: length - abs(off)]
   subarray indices: sub_2[0: length - abs(off)]

for off = 0 : ix = 0 ; final_x = length)
   subarray indices: sub_1[0: length]
   subarray indices: sub_2[0: length]

for off > 0 : ix = off ; final_x = length
   subarray indices: sub_1[0: length - off]
   subarray indices: sub_2[off: length]
Parameters:
sci_int_1ndarray

Interpolated SCI array (float) for image 1

sci_int_2ndarray

Interpolated SCI array (float) for image 2

nom_off_xint

Nominal offset in x-direction

nom_off_yint

Nominal offset in y-direction

Returns:
sub_1ndarray

Overlapping subarray (float) for interpolated image 1

sub_2ndarray

Overlapping subarray (float) for interpolated image 2