1- import ast
21import numpy as np
32
43from autoarray .structures import arrays
54from autoarray import exc
65
76
8- class AbstractData (object ):
7+ class AbstractDataset (object ):
98 def __init__ (self , data , noise_map , exposure_time_map = None ):
109 """A collection of abstract 2D for different data_type classes (an image, pixel-scale, noise-map, etc.)
1110
1211 Parameters
1312 ----------
1413 data : arrays.Array
15- The array of the image data_type, in units of electrons per second.
14+ The array of the image data_type, in unit_label of electrons per second.
1615 pixel_scales : float
1716 The size of each pixel in arc seconds.
1817 psf : PSF
1918 An array describing the PSF kernel of the image.
2019 noise_map : NoiseMap | float | ndarray
21- An array describing the RMS standard deviation error in each pixel, preferably in units of electrons per
20+ An array describing the RMS standard deviation error in each pixel, preferably in unit_label of electrons per
2221 second.
2322 background_noise_map : NoiseMap
2423 An array describing the RMS standard deviation error in each pixel due to the background sky noise_map,
25- preferably in units of electrons per second.
24+ preferably in unit_label of electrons per second.
2625 poisson_noise_map : NoiseMap
2726 An array describing the RMS standard deviation error in each pixel due to the Poisson counts of the source,
28- preferably in units of electrons per second.
27+ preferably in unit_label of electrons per second.
2928 exposure_time_map : arrays.Array
3029 An array describing the effective exposure time in each imaging pixel.
3130 background_sky_map : aa.Scaled
@@ -82,7 +81,7 @@ def potential_chi_squared_max(self):
8281
8382 def array_from_electrons_per_second_to_counts (self , array ):
8483 """
85- For an array (in electrons per second) and an exposure time mappers, return an array in units counts.
84+ For an array (in electrons per second) and an exposure time mappers, return an array in unit_label counts.
8685
8786 Parameters
8887 ----------
@@ -93,7 +92,7 @@ def array_from_electrons_per_second_to_counts(self, array):
9392
9493 def array_from_counts_to_electrons_per_second (self , array ):
9594 """
96- For an array (in counts) and an exposure time mappers, convert the array to units electrons per second
95+ For an array (in counts) and an exposure time mappers, convert the array to unit_label electrons per second
9796
9897 Parameters
9998 ----------
@@ -107,7 +106,7 @@ def array_from_counts_to_electrons_per_second(self, array):
107106
108107 def array_from_adus_to_electrons_per_second (self , array , gain ):
109108 """
110- For an array (in counts) and an exposure time mappers, convert the array to units electrons per second
109+ For an array (in counts) and an exposure time mappers, convert the array to unit_label electrons per second
111110
112111 Parameters
113112 ----------
@@ -121,7 +120,7 @@ def array_from_adus_to_electrons_per_second(self, array, gain):
121120
122121 @property
123122 def image_counts (self ):
124- """The image in units of counts."""
123+ """The image in unit_label of counts."""
125124 return self .array_from_electrons_per_second_to_counts (self .data )
126125
127126
@@ -209,54 +208,3 @@ def load_exposure_time_map(
209208 return ExposureTimeMap .from_exposure_time_and_inverse_noise_map (
210209 exposure_time = exposure_time , inverse_noise_map = inverse_noise_map
211210 )
212-
213-
214- def load_positions (positions_path ):
215- """Load the positions of an image.
216-
217- Positions correspond to a set of pixels in the lensed source galaxy that are anticipated to come from the same \
218- multiply-imaged region of the source-plane. Mass models which do not trace the pixels within a threshold value of \
219- one another are resampled during the non-linear search.
220-
221- Positions are stored in a .dat file, where each line of the file gives a list of list of (y,x) positions which \
222- correspond to the same region of the source-plane. Thus, multiple source-plane regions can be input over multiple \
223- lines of the same positions file.
224-
225- Parameters
226- ----------
227- positions_path : str
228- The path to the positions .dat file containing the positions (e.g. '/path/to/positions.dat')
229- """
230- with open (positions_path ) as f :
231- position_string = f .readlines ()
232-
233- positions = []
234-
235- for line in position_string :
236- position_list = ast .literal_eval (line )
237- positions .append (position_list )
238-
239- return positions
240-
241-
242- def output_positions (positions , positions_path ):
243- """Output the positions of an image to a positions.dat file.
244-
245- Positions correspond to a set of pixels in the lensed source galaxy that are anticipated to come from the same \
246- multiply-imaged region of the source-plane. Mass models which do not trace the pixels within a threshold value of \
247- one another are resampled during the non-linear search.
248-
249- Positions are stored in a .dat file, where each line of the file gives a list of list of (y,x) positions which \
250- correspond to the same region of the source-plane. Thus, multiple source-plane regions can be input over multiple \
251- lines of the same positions file.
252-
253- Parameters
254- ----------
255- positions : [[[]]]
256- The lists of positions (e.g. [[[1.0, 1.0], [2.0, 2.0]], [[3.0, 3.0], [4.0, 4.0]]])
257- positions_path : str
258- The path to the positions .dat file containing the positions (e.g. '/path/to/positions.dat')
259- """
260- with open (positions_path , "w" ) as f :
261- for position in positions :
262- f .write ("%s\n " % position )
0 commit comments