Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W Tilde Imaging With Interpolation #184

Closed
Jammy2211 opened this issue Dec 1, 2021 · 0 comments
Closed

W Tilde Imaging With Interpolation #184

Jammy2211 opened this issue Dec 1, 2021 · 0 comments

Comments

@Jammy2211
Copy link
Owner

In issue #180 we discuss how we can extend the mapping_matrix_from() function to include source pixel interpolation.

The more efficient w_tilde formalism for an inversion doe not use the mapping_matrix and directly constructs a matrix for the inversion via the function curvature_matrix_via_w_tilde_curvature_preload_imaging_from in the module https://github.com/Jammy2211/PyAutoArray/blob/master/autoarray/inversion/linear_eqn/linear_eqn_util.py

I need to extend this function to use source pixel interpolation. I am not 100% certain on how to do this yet, however I think it can be built into the function data_slim_to_pixelization_unique_from in the module https://github.com/Jammy2211/PyAutoArray/blob/master/autoarray/inversion/mappers/mapper_util.py

This function determines every unique set of mappings between image sub-pixels in a given image pixel and source pixels. For example, if we have a sub-grid of size 2x2 and 3 sub-pixels in image pixel 0 map to the same source pixel 4, this matrix will add an entry to signify that 3 sub-pixels in image pixel 0 map to source pixel 4.

These unique mappings are encoded in the data_to_pixel_unique array, with the weight associated with these mappings in the array data_weights. Again, in the example above, 3 sub-pixels map to a unique source pixel, meaning that their data weight is 0.25*3 = 0.75.

The data weights are constructed as follows (I've simplified the code):

  for ip_sub in range(ip_sub_start, ip_sub_end):

      pix = pixelization_index_for_sub_slim_index[ip_sub]

      for i in range(pix_size):

          if data_to_pix_unique[ip, i] == pix:

              data_weights[ip, i] += sub_fraction

If we have the interpolations arrays described in #180 this becomes:

  for ip_sub in range(ip_sub_start, ip_sub_end):

      pix_indexes = pixelization_indexes_for_sub_slim_index[ip_sub]

     for pix in pix_indexes:

         pixelization_interpolation_weight = pixelization_interpolation_weights[ip_sub, pix]

          for i in range(pix_size):

              if data_to_pix_unique[ip, i] == pix:

                   data_weights[ip, i] += sub_fraction * pixelization_interpolation_weight

Here's hoping...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants