original_docstring: 
      Compute the value of an entry of the `w_tilde_curvature` matrix, where this entry encodes the PSF convolution of
      the noise-map between two image pixels.
  
      The calculation is performed by over-laying the PSF kernel over two noise-map pixels in 2D. For all pixels where
      the two overlaid PSF kernels overlap, the following calculation is performed for every noise map value:
  
      `value = kernel_value_0 * kernel_value_1 * (1.0 / noise_value) ** 2.0`
  
      This calculation infers the fraction of flux that every PSF convolution will move between each pair of noise-map
      pixels and can therefore be used to efficiently calculate the curvature_matrix that is used in the linear algebra
      calculation of an inversion.
  
      The sum of all values where kernel pixels overlap is returned to give the `w_tilde` value.
  
      Parameters
      ----------
      value_native
          A two dimensional masked array of values (e.g. a noise-map, signal to noise map) which the w_tilde curvature
          values are computed from.
      kernel_native
          The two dimensional PSF kernel that w_tilde encodes the convolution of.
      ip0_y
          The y index of the first image pixel in the image pixel pair.
      ip0_x
          The x index of the first image pixel in the image pixel pair.
      ip1_y
          The y index of the second image pixel in the image pixel pair.
      ip1_x
          The x index of the second image pixel in the image pixel pair.
  
      Returns
      -------
      float
          The w_tilde value that encodes the value of PSF convolution between a pair of image pixels.
  
      
docstring: Compute the value of an entry of the `w_tilde_curvature` matrix, where this entry encodes the PSF convolution of
  the noise-map between two image pixels.
  
  The calculation is performed by over-laying the PSF kernel over two noise-map pixels in 2D. For all pixels where
  the two overlaid PSF kernels overlap, the following calculation is performed for every noise map value.
  
  
  
  This calculation infers the fraction of flux that every PSF convolution will move between each pair of noise-map
  pixels and can therefore be used to efficiently calculate the curvature_matrix that is used in the linear algebra
  calculation of an inversion.
  
  The sum of all values where kernel pixels overlap is returned to give the `w_tilde` value.
docstring_tokens: Compute the value of an entry of the ` w_tilde_curvature ` matrix where this entry encodes the PSF convolution of the noise - map between two image pixels . The calculation is performed by over - laying the PSF kernel over two noise - map pixels in 2D . For all pixels where the two overlaid PSF kernels overlap the following calculation is performed for every noise map value . This calculation infers the fraction of flux that every PSF convolution will move between each pair of noise - map pixels and can therefore be used to efficiently calculate the curvature_matrix that is used in the linear algebra calculation of an inversion . The sum of all values where kernel pixels overlap is returned to give the ` w_tilde ` value .
code: def w_tilde_curvature_value_from(
      value_native: np.ndarray,
      kernel_native: np.ndarray,
      ip0_y,
      ip0_x,
      ip1_y,
      ip1_x,
      renormalize=False,
  ) -> float:
      """
      Compute the value of an entry of the `w_tilde_curvature` matrix, where this entry encodes the PSF convolution of
      the noise-map between two image pixels.
  
      The calculation is performed by over-laying the PSF kernel over two noise-map pixels in 2D. For all pixels where
      the two overlaid PSF kernels overlap, the following calculation is performed for every noise map value:
  
      `value = kernel_value_0 * kernel_value_1 * (1.0 / noise_value) ** 2.0`
  
      This calculation infers the fraction of flux that every PSF convolution will move between each pair of noise-map
      pixels and can therefore be used to efficiently calculate the curvature_matrix that is used in the linear algebra
      calculation of an inversion.
  
      The sum of all values where kernel pixels overlap is returned to give the `w_tilde` value.
  
      Parameters
      ----------
      value_native
          A two dimensional masked array of values (e.g. a noise-map, signal to noise map) which the w_tilde curvature
          values are computed from.
      kernel_native
          The two dimensional PSF kernel that w_tilde encodes the convolution of.
      ip0_y
          The y index of the first image pixel in the image pixel pair.
      ip0_x
          The x index of the first image pixel in the image pixel pair.
      ip1_y
          The y index of the second image pixel in the image pixel pair.
      ip1_x
          The x index of the second image pixel in the image pixel pair.
  
      Returns
      -------
      float
          The w_tilde value that encodes the value of PSF convolution between a pair of image pixels.
  
      """
  
      curvature_value = 0.0
  
      kernel_shift_y = -(kernel_native.shape[1] // 2)
      kernel_shift_x = -(kernel_native.shape[0] // 2)
  
      ip_y_offset = ip0_y - ip1_y
      ip_x_offset = ip0_x - ip1_x
  
      if (
          ip_y_offset < 2 * kernel_shift_y
          or ip_y_offset > -2 * kernel_shift_y
          or ip_x_offset < 2 * kernel_shift_x
          or ip_x_offset > -2 * kernel_shift_x
      ):
          return curvature_value
  
      kernel_pixels = kernel_native.shape[0] * kernel_native.shape[1]
      kernel_count = 0
  
      for k0_y in range(kernel_native.shape[0]):
          for k0_x in range(kernel_native.shape[1]):
  
              value = value_native[
                  ip0_y + k0_y + kernel_shift_y, ip0_x + k0_x + kernel_shift_x
              ]
  
              if value > 0.0:
  
                  k1_y = k0_y + ip_y_offset
                  k1_x = k0_x + ip_x_offset
  
                  if (
                      k1_y >= 0
                      and k1_x >= 0
                      and k1_y < kernel_native.shape[0]
                      and k1_x < kernel_native.shape[1]
                  ):
  
                      kernel_count += 1
  
                      kernel_value_0 = kernel_native[k0_y, k0_x]
                      kernel_value_1 = kernel_native[k1_y, k1_x]
  
                      curvature_value += (
                          kernel_value_0 * kernel_value_1 * (1.0 / value) ** 2.0
                      )
  
      if renormalize:
          if kernel_count > 0:
              curvature_value *= kernel_pixels / kernel_count
  
      return curvature_value
code_tokens: def w_tilde_curvature_value_from ( value_native : np . ndarray , kernel_native : np . ndarray , ip0_y , ip0_x , ip1_y , ip1_x , renormalize = False , ) -> float : curvature_value = 0.0 kernel_shift_y = - ( kernel_native . shape [ 1 ] // 2 ) kernel_shift_x = - ( kernel_native . shape [ 0 ] // 2 ) ip_y_offset = ip0_y - ip1_y ip_x_offset = ip0_x - ip1_x if ( ip_y_offset < 2 * kernel_shift_y or ip_y_offset > - 2 * kernel_shift_y or ip_x_offset < 2 * kernel_shift_x or ip_x_offset > - 2 * kernel_shift_x ) : return curvature_value kernel_pixels = kernel_native . shape [ 0 ] * kernel_native . shape [ 1 ] kernel_count = 0 for k0_y in range ( kernel_native . shape [ 0 ] ) : for k0_x in range ( kernel_native . shape [ 1 ] ) : value = value_native [ ip0_y + k0_y + kernel_shift_y , ip0_x + k0_x + kernel_shift_x ] if value > 0.0 : k1_y = k0_y + ip_y_offset k1_x = k0_x + ip_x_offset if ( k1_y >= 0 and k1_x >= 0 and k1_y < kernel_native . shape [ 0 ] and k1_x < kernel_native . shape [ 1 ] ) : kernel_count += 1 kernel_value_0 = kernel_native [ k0_y , k0_x ] kernel_value_1 = kernel_native [ k1_y , k1_x ] curvature_value += ( kernel_value_0 * kernel_value_1 * ( 1.0 / value ) ** 2.0 ) if renormalize : if kernel_count > 0 : curvature_value *= kernel_pixels / kernel_count return curvature_value
short_docstring: Compute the value of an entry of the `w_tilde_curvature` matrix, where this entry encodes the PSF convolution of
  the noise-map between two image pixels.
short_docstring_tokens: Compute the value of an entry of the ` w_tilde_curvature ` matrix where this entry encodes the PSF convolution of the noise - map between two image pixels .
comment: """
      Compute the value of an entry of the `w_tilde_curvature` matrix, where this entry encodes the PSF convolution of
      the noise-map between two image pixels.
  
      The calculation is performed by over-laying the PSF kernel over two noise-map pixels in 2D. For all pixels where
      the two overlaid PSF kernels overlap, the following calculation is performed for every noise map value:
  
      `value = kernel_value_0 * kernel_value_1 * (1.0 / noise_value) ** 2.0`
  
      This calculation infers the fraction of flux that every PSF convolution will move between each pair of noise-map
      pixels and can therefore be used to efficiently calculate the curvature_matrix that is used in the linear algebra
      calculation of an inversion.
  
      The sum of all values where kernel pixels overlap is returned to give the `w_tilde` value.
  
      Parameters
      ----------
      value_native
          A two dimensional masked array of values (e.g. a noise-map, signal to noise map) which the w_tilde curvature
          values are computed from.
      kernel_native
          The two dimensional PSF kernel that w_tilde encodes the convolution of.
      ip0_y
          The y index of the first image pixel in the image pixel pair.
      ip0_x
          The x index of the first image pixel in the image pixel pair.
      ip1_y
          The y index of the second image pixel in the image pixel pair.
      ip1_x
          The x index of the second image pixel in the image pixel pair.
  
      Returns
      -------
      float
          The w_tilde value that encodes the value of PSF convolution between a pair of image pixels.
  
      """