original_docstring: 
      The matrix w_tilde is a matrix of dimensions [image_pixels, image_pixels] that encodes the PSF convolution of
      every pair of image pixels given the noise map. This can be used to efficiently compute the curvature matrix via
      the mappings between image and source pixels, in a way that omits having to perform the PSF convolution on every
      individual source pixel. This provides a significant speed up for inversions of imaging datasets.
  
      When w_tilde is used to perform an inversion, the mapping matrices are not computed, meaning that they cannot be
      used to compute the data vector. This method creates the vector `w_tilde_data` which allows for the data
      vector to be computed efficiently without the mapping matrix.
  
      The matrix w_tilde_data is dimensions [image_pixels] and encodes the PSF convolution with the `weight_map`,
      where the weights are the image-pixel values divided by the noise-map values squared:
  
      weight = image / noise**2.0
  
      Parameters
      ----------
      image_native
          The two dimensional masked image of values which `w_tilde_data` is computed from.
      noise_map_native
          The two dimensional masked noise-map of values which `w_tilde_data` is computed from.
      kernel_native
          The two dimensional PSF kernel that `w_tilde_data` encodes the convolution of.
      native_index_for_slim_index
          An array of shape [total_x_pixels*sub_size] that maps pixels from the slimmed array to the native array.
  
      Returns
      -------
      ndarray
          A matrix that encodes the PSF convolution values between the imaging divided by the noise map**2 that enables
          efficient calculation of the data vector.
      
docstring: The matrix w_tilde is a matrix of dimensions [image_pixels, image_pixels] that encodes the PSF convolution of
  every pair of image pixels given the noise map. This can be used to efficiently compute the curvature matrix via
  the mappings between image and source pixels, in a way that omits having to perform the PSF convolution on every
  individual source pixel. This provides a significant speed up for inversions of imaging datasets.
  
  When w_tilde is used to perform an inversion, the mapping matrices are not computed, meaning that they cannot be
  used to compute the data vector. This method creates the vector `w_tilde_data` which allows for the data
  vector to be computed efficiently without the mapping matrix.
  
  The matrix w_tilde_data is dimensions [image_pixels] and encodes the PSF convolution with the `weight_map`,
  where the weights are the image-pixel values divided by the noise-map values squared.
  
  weight = image / noise**2.0
docstring_tokens: The matrix w_tilde is a matrix of dimensions [ image_pixels image_pixels ] that encodes the PSF convolution of every pair of image pixels given the noise map . This can be used to efficiently compute the curvature matrix via the mappings between image and source pixels in a way that omits having to perform the PSF convolution on every individual source pixel . This provides a significant speed up for inversions of imaging datasets . When w_tilde is used to perform an inversion the mapping matrices are not computed meaning that they cannot be used to compute the data vector . This method creates the vector ` w_tilde_data ` which allows for the data vector to be computed efficiently without the mapping matrix . The matrix w_tilde_data is dimensions [ image_pixels ] and encodes the PSF convolution with the ` weight_map ` where the weights are the image - pixel values divided by the noise - map values squared . weight = image / noise ** 2 . 0
code: def w_tilde_data_imaging_from(
      image_native: np.ndarray,
      noise_map_native: np.ndarray,
      kernel_native: np.ndarray,
      native_index_for_slim_index,
  ) -> np.ndarray:
      """
      The matrix w_tilde is a matrix of dimensions [image_pixels, image_pixels] that encodes the PSF convolution of
      every pair of image pixels given the noise map. This can be used to efficiently compute the curvature matrix via
      the mappings between image and source pixels, in a way that omits having to perform the PSF convolution on every
      individual source pixel. This provides a significant speed up for inversions of imaging datasets.
  
      When w_tilde is used to perform an inversion, the mapping matrices are not computed, meaning that they cannot be
      used to compute the data vector. This method creates the vector `w_tilde_data` which allows for the data
      vector to be computed efficiently without the mapping matrix.
  
      The matrix w_tilde_data is dimensions [image_pixels] and encodes the PSF convolution with the `weight_map`,
      where the weights are the image-pixel values divided by the noise-map values squared:
  
      weight = image / noise**2.0
  
      Parameters
      ----------
      image_native
          The two dimensional masked image of values which `w_tilde_data` is computed from.
      noise_map_native
          The two dimensional masked noise-map of values which `w_tilde_data` is computed from.
      kernel_native
          The two dimensional PSF kernel that `w_tilde_data` encodes the convolution of.
      native_index_for_slim_index
          An array of shape [total_x_pixels*sub_size] that maps pixels from the slimmed array to the native array.
  
      Returns
      -------
      ndarray
          A matrix that encodes the PSF convolution values between the imaging divided by the noise map**2 that enables
          efficient calculation of the data vector.
      """
  
      kernel_shift_y = -(kernel_native.shape[1] // 2)
      kernel_shift_x = -(kernel_native.shape[0] // 2)
  
      image_pixels = len(native_index_for_slim_index)
  
      w_tilde_data = np.zeros((image_pixels,))
  
      weight_map_native = image_native / noise_map_native ** 2.0
  
      for ip0 in range(image_pixels):
  
          ip0_y, ip0_x = native_index_for_slim_index[ip0]
  
          value = 0.0
  
          for k0_y in range(kernel_native.shape[0]):
              for k0_x in range(kernel_native.shape[1]):
  
                  weight_value = weight_map_native[
                      ip0_y + k0_y + kernel_shift_y, ip0_x + k0_x + kernel_shift_x
                  ]
  
                  if not np.isnan(weight_value):
                      value += kernel_native[k0_y, k0_x] * weight_value
  
          w_tilde_data[ip0] = value
  
      return w_tilde_data
code_tokens: def w_tilde_data_imaging_from ( image_native : np . ndarray , noise_map_native : np . ndarray , kernel_native : np . ndarray , native_index_for_slim_index , ) -> np . ndarray : kernel_shift_y = - ( kernel_native . shape [ 1 ] // 2 ) kernel_shift_x = - ( kernel_native . shape [ 0 ] // 2 ) image_pixels = len ( native_index_for_slim_index ) w_tilde_data = np . zeros ( ( image_pixels , ) ) weight_map_native = image_native / noise_map_native ** 2.0 for ip0 in range ( image_pixels ) : ip0_y , ip0_x = native_index_for_slim_index [ ip0 ] value = 0.0 for k0_y in range ( kernel_native . shape [ 0 ] ) : for k0_x in range ( kernel_native . shape [ 1 ] ) : weight_value = weight_map_native [ ip0_y + k0_y + kernel_shift_y , ip0_x + k0_x + kernel_shift_x ] if not np . isnan ( weight_value ) : value += kernel_native [ k0_y , k0_x ] * weight_value w_tilde_data [ ip0 ] = value return w_tilde_data
short_docstring: The matrix w_tilde is a matrix of dimensions [image_pixels, image_pixels] that encodes the PSF convolution of
  every pair of image pixels given the noise map.
short_docstring_tokens: The matrix w_tilde is a matrix of dimensions [ image_pixels image_pixels ] that encodes the PSF convolution of every pair of image pixels given the noise map .
comment: """
      The matrix w_tilde is a matrix of dimensions [image_pixels, image_pixels] that encodes the PSF convolution of
      every pair of image pixels given the noise map. This can be used to efficiently compute the curvature matrix via
      the mappings between image and source pixels, in a way that omits having to perform the PSF convolution on every
      individual source pixel. This provides a significant speed up for inversions of imaging datasets.
  
      When w_tilde is used to perform an inversion, the mapping matrices are not computed, meaning that they cannot be
      used to compute the data vector. This method creates the vector `w_tilde_data` which allows for the data
      vector to be computed efficiently without the mapping matrix.
  
      The matrix w_tilde_data is dimensions [image_pixels] and encodes the PSF convolution with the `weight_map`,
      where the weights are the image-pixel values divided by the noise-map values squared:
  
      weight = image / noise**2.0
  
      Parameters
      ----------
      image_native
          The two dimensional masked image of values which `w_tilde_data` is computed from.
      noise_map_native
          The two dimensional masked noise-map of values which `w_tilde_data` is computed from.
      kernel_native
          The two dimensional PSF kernel that `w_tilde_data` encodes the convolution of.
      native_index_for_slim_index
          An array of shape [total_x_pixels*sub_size] that maps pixels from the slimmed array to the native array.
  
      Returns
      -------
      ndarray
          A matrix that encodes the PSF convolution values between the imaging divided by the noise map**2 that enables
          efficient calculation of the data vector.
      """