|
1 | 1 | class AbstractPreloads: |
2 | | - def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None): |
| 2 | + def __init__( |
| 3 | + self, |
| 4 | + curvature_matrix=None, |
| 5 | + mapper_galaxy_dict=None, |
| 6 | + source_plane_mesh_grid=None, |
| 7 | + image_plane_mesh_grid=None, |
| 8 | + ): |
3 | 9 | """ |
4 | 10 | Container for quantities that are *preloaded* into a fit / inversion: computed once and |
5 | 11 | injected so that repeated evaluations reuse them instead of recomputing them. |
@@ -42,7 +48,24 @@ def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None): |
42 | 48 | plane); when invariant across evaluations it is built once and reused here, so the |
43 | 49 | `mapper` (and therefore the `mapping_matrix` and `regularization_matrix`) is not rebuilt. |
44 | 50 | Stored opaquely — the consumer (e.g. PyAutoLens's `TracerToInversion`) populates and |
45 | | - interprets it. |
| 51 | + interprets it. Valid ONLY when the datasets sharing it have identical grids (e.g. the |
| 52 | + channels of a datacube) — a mapper embeds a dataset's own data-grid mappings. |
| 53 | + source_plane_mesh_grid |
| 54 | + The pre-computed source-plane mesh geometry (e.g. the ray-traced centres a Delaunay |
| 55 | + triangulation is built over), for consumers whose datasets share a lens model but NOT |
| 56 | + their grids (e.g. multi-exposure imaging with per-exposure pixel offsets and PSFs). |
| 57 | + Unlike `mapper_galaxy_dict`, this preloads only the mesh: each dataset still builds its |
| 58 | + own mapper by mapping its own (offset) data grid onto this shared mesh. Stored opaquely |
| 59 | + in the consumer's plane-grouped structure (PyAutoLens: the `traced_mesh_grid_pg_list` |
| 60 | + of the lead dataset). The mapping matrix, curvature matrix, blurred mapping matrix and |
| 61 | + regularization matrix are all deliberately NOT preloadable this way — offsets/PSFs make |
| 62 | + the first three per-dataset, and regularization may be data-adaptive. |
| 63 | + image_plane_mesh_grid |
| 64 | + The image-plane counterpart of `source_plane_mesh_grid` (the mesh centres before |
| 65 | + ray-tracing, in the lead dataset's frame), carried alongside it as metadata for |
| 66 | + downstream consumers (e.g. mapper plotting). Same opaque plane-grouped structure. |
46 | 67 | """ |
47 | 68 | self.curvature_matrix = curvature_matrix |
48 | 69 | self.mapper_galaxy_dict = mapper_galaxy_dict |
| 70 | + self.source_plane_mesh_grid = source_plane_mesh_grid |
| 71 | + self.image_plane_mesh_grid = image_plane_mesh_grid |
0 commit comments