1+ from astropy .table import Table
2+ from astropy .io import fits
13import copy
24
35import numpy as np
1113
1214from autoarray .dataset .imaging .dataset import Imaging
1315from autoarray .dataset .interferometer .dataset import Interferometer
14- from autoarray .inversion .inversion .mapper_valued import MapperValued
1516from autoarray .inversion .inversion .dataset_interface import DatasetInterface
1617from autoarray .inversion .linear_obj .linear_obj import LinearObj
1718from autoarray .inversion .pixelization .mappers .abstract import AbstractMapper
@@ -851,3 +852,34 @@ def data_linear_func_matrix_dict(self):
851852 @property
852853 def mapper_operated_mapping_matrix_dict (self ) -> Dict :
853854 raise NotImplementedError
855+
856+ @property
857+ def fits_table_mapper_dict (self ) -> Dict [AbstractMapper , np .ndarray ]:
858+
859+ fits_table_mapper_dict = {}
860+
861+ mapper_list = self .cls_list_from (cls = AbstractMapper )
862+
863+ for mapper in mapper_list :
864+ reconstruction = np .stack (
865+ [
866+ mapper .mapper_grids .source_plane_mesh_grid [:, 0 ],
867+ mapper .mapper_grids .source_plane_mesh_grid [:, 1 ],
868+ self .reconstruction_dict [mapper ],
869+ self .reconstruction_noise_map_dict [mapper ],
870+ ],
871+ axis = 1 ,
872+ )
873+
874+ pixels_table = Table (
875+ data = reconstruction ,
876+ names = ['x' , 'y' , 'reconstruction' , 'noise_map' ],
877+ )
878+
879+ pixels_table .meta ["MESH_TYPE" ] = type (mapper .mapper_grids .source_plane_mesh_grid )
880+
881+ fits_table = fits .table_to_hdu (pixels_table )
882+
883+ fits_table_mapper_dict [mapper ] = fits_table
884+
885+ return fits_table_mapper_dict
0 commit comments