Skip to content

Commit 7308db3

Browse files
committed
Abstraction of data groups (e.g. imaging) renamed from 'data' to 'dataset'
1 parent de2f767 commit 7308db3

21 files changed

Lines changed: 117 additions & 117 deletions

autoarray/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
)
1010
from autoarray.structures.kernel import Kernel as kernel
1111
from autoarray.structures.visibilities import Visibilities as visibilities
12-
from autoarray.data.imaging import Imaging as imaging
13-
from autoarray.data.interferometer import Interferometer as interferometer
14-
from autoarray.data import data_converter
12+
from autoarray.dataset.imaging import Imaging as imaging
13+
from autoarray.dataset.interferometer import Interferometer as interferometer
14+
from autoarray.dataset import data_converter
1515
from autoarray.operators.convolution import Convolver as convolver
1616
from autoarray.operators.fourier_transform import Transformer as transformer
1717
from autoarray.operators.inversion.mappers import mapper
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from autoarray import exc
55

66

7-
class AbstractData(object):
7+
class AbstractDataset(object):
88
def __init__(self, data, noise_map, exposure_time_map=None):
99
"""A collection of abstract 2D for different data_type classes (an image, pixel-scale, noise-map, etc.)
1010
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
from autoarray.mask import mask as msk
99
from autoarray.structures import kernel, arrays
1010
from autoarray.masked import masked_structures
11-
from autoarray.data import abstract_data, data_converter
11+
from autoarray.dataset import abstract_dataset, data_converter
1212

1313
logger = logging.getLogger(__name__)
1414

1515

16-
class AbstractImaging(abstract_data.AbstractData):
16+
class AbstractImagingSet(abstract_dataset.AbstractDataset):
1717
@property
1818
def image(self):
1919
return self.data
@@ -360,7 +360,7 @@ def output_to_fits(
360360
)
361361

362362

363-
class Imaging(AbstractImaging):
363+
class Imaging(AbstractImagingSet):
364364
def __init__(
365365
self,
366366
image,
@@ -373,7 +373,7 @@ def __init__(
373373
name=None,
374374
**kwargs
375375
):
376-
"""A collection of 2D imaging data(an image, noise-map, psf, etc.)
376+
"""A collection of 2D imaging dataset(an image, noise-map, psf, etc.)
377377
378378
Parameters
379379
----------
@@ -557,7 +557,7 @@ def from_fits(
557557
time map and gain.
558558
"""
559559

560-
image = abstract_data.load_image(
560+
image = abstract_dataset.load_image(
561561
image_path=image_path, image_hdu=image_hdu, pixel_scales=pixel_scales
562562
)
563563

@@ -574,7 +574,7 @@ def from_fits(
574574
else:
575575
inverse_noise_map = None
576576

577-
exposure_time_map = abstract_data.load_exposure_time_map(
577+
exposure_time_map = abstract_dataset.load_exposure_time_map(
578578
exposure_time_map_path=exposure_time_map_path,
579579
exposure_time_map_hdu=exposure_time_map_hdu,
580580
pixel_scales=pixel_scales,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
import autoarray as aa
55

66
from autoarray import exc
7-
from autoarray.data import abstract_data
7+
from autoarray.dataset import abstract_dataset
88

99

1010
logger = logging.getLogger(__name__)
1111

1212

13-
class AbstractInterferometer(abstract_data.AbstractData):
13+
class AbstractInterferometerSet(abstract_dataset.AbstractDataset):
1414
@property
1515
def visibilities(self):
1616
return self.data
@@ -74,7 +74,7 @@ def output_to_fits(
7474
)
7575

7676

77-
class Interferometer(AbstractInterferometer):
77+
class Interferometer(AbstractInterferometerSet):
7878
def __init__(
7979
self,
8080
visibilities,

autoarray/fit/fit.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import numpy as np
22

3-
from autoarray.masked import masked_data as md
3+
from autoarray.masked import masked_dataset as md
44
from autoarray.util import fit_util
55

66

7-
def fit(masked_data, model_data, inversion=None):
7+
def fit(masked_dataset, model_data, inversion=None):
88

9-
if isinstance(masked_data, md.MaskedImaging):
9+
if isinstance(masked_dataset, md.MaskedImaging):
1010
return ImagingFit(
11-
mask=masked_data.mask,
12-
image=masked_data.image,
13-
noise_map=masked_data.noise_map,
11+
mask=masked_dataset.mask,
12+
image=masked_dataset.image,
13+
noise_map=masked_dataset.noise_map,
1414
model_image=model_data,
1515
inversion=inversion,
1616
)
17-
elif isinstance(masked_data, md.MaskedInterferometer):
17+
elif isinstance(masked_dataset, md.MaskedInterferometer):
1818
return InterferometerFit(
19-
visibilities_mask=masked_data.visibilities_mask,
20-
visibilities=masked_data.visibilities,
21-
noise_map=masked_data.noise_map,
19+
visibilities_mask=masked_dataset.visibilities_mask,
20+
visibilities=masked_dataset.visibilities,
21+
noise_map=masked_dataset.noise_map,
2222
model_visibilities=model_data,
2323
inversion=inversion,
2424
)
@@ -28,7 +28,7 @@ class DataFit(object):
2828

2929
# noinspection PyUnresolvedReferences
3030
def __init__(self, mask, data, noise_map, model_data, inversion=None):
31-
"""Class to fit simulator where the data structures are any dimension.
31+
"""Class to fit simulator where the dataset structures are any dimension.
3232
3333
Parameters
3434
-----------
@@ -37,7 +37,7 @@ def __init__(self, mask, data, noise_map, model_data, inversion=None):
3737
noise_map : ndarray
3838
The noise_map-map of the observed simulator.
3939
mask: msk.Mask
40-
The masks that is applied to the data.
40+
The masks that is applied to the dataset.
4141
model_data : ndarray
4242
The model simulate the fitting image is fitted with.
4343
@@ -48,14 +48,14 @@ def __init__(self, mask, data, noise_map, model_data, inversion=None):
4848
chi_squared_map : ndarray
4949
The chi-squared map of the fit ((datas - model_data) / noise_maps ) **2.0
5050
chi_squared : float
51-
The overall chi-squared of the model's fit to the data, summed over every simulator-point.
51+
The overall chi-squared of the model's fit to the dataset, summed over every simulator-point.
5252
reduced_chi_squared : float
5353
The reduced chi-squared of the model's fit to simulate (chi_squared / number of datas points), summed over \
5454
every simulator-point.
5555
noise_normalization : float
5656
The overall normalization term of the noise_map-map, summed over every simulator-point.
5757
likelihood : float
58-
The overall likelihood of the model's fit to the data, summed over evey simulator-point.
58+
The overall likelihood of the model's fit to the dataset, summed over evey simulator-point.
5959
"""
6060
self.mask = mask
6161
self.data = data
@@ -83,7 +83,7 @@ def chi_squared_map(self):
8383

8484
@property
8585
def signal_to_noise_map(self):
86-
"""The signal-to-noise_map of the data and noise-map which are fitted."""
86+
"""The signal-to-noise_map of the dataset and noise-map which are fitted."""
8787
signal_to_noise_map = np.divide(self.data, self.noise_map)
8888
signal_to_noise_map[signal_to_noise_map < 0] = 0
8989
return signal_to_noise_map
@@ -138,7 +138,7 @@ def figure_of_merit(self):
138138

139139
class ImagingFit(DataFit):
140140
def __init__(self, mask, image, noise_map, model_image, inversion=None):
141-
"""Class to fit simulator where the data structures are any dimension.
141+
"""Class to fit simulator where the dataset structures are any dimension.
142142
143143
Parameters
144144
-----------
@@ -147,7 +147,7 @@ def __init__(self, mask, image, noise_map, model_image, inversion=None):
147147
noise_map : ndarray
148148
The noise_map-map of the observed simulator.
149149
mask: msk.Mask
150-
The masks that is applied to the data.
150+
The masks that is applied to the dataset.
151151
model_data : ndarray
152152
The model simulate the fitting image is fitted with.
153153
@@ -158,14 +158,14 @@ def __init__(self, mask, image, noise_map, model_image, inversion=None):
158158
chi_squared_map : ndarray
159159
The chi-squared map of the fit ((datas - model_data) / noise_maps ) **2.0
160160
chi_squared : float
161-
The overall chi-squared of the model's fit to the data, summed over every simulator-point.
161+
The overall chi-squared of the model's fit to the dataset, summed over every simulator-point.
162162
reduced_chi_squared : float
163163
The reduced chi-squared of the model's fit to simulate (chi_squared / number of datas points), summed over \
164164
every simulator-point.
165165
noise_normalization : float
166166
The overall normalization term of the noise_map-map, summed over every simulator-point.
167167
likelihood : float
168-
The overall likelihood of the model's fit to the data, summed over evey simulator-point.
168+
The overall likelihood of the model's fit to the dataset, summed over evey simulator-point.
169169
"""
170170

171171
super(ImagingFit, self).__init__(
@@ -194,7 +194,7 @@ def __init__(
194194
model_visibilities,
195195
inversion=None,
196196
):
197-
"""Class to fit simulator where the data structures are any dimension.
197+
"""Class to fit simulator where the dataset structures are any dimension.
198198
199199
Parameters
200200
-----------
@@ -203,7 +203,7 @@ def __init__(
203203
noise_map : ndarray
204204
The noise_map-map of the observed simulator.
205205
visibilities_mask: msk.Mask
206-
The masks that is applied to the data.
206+
The masks that is applied to the dataset.
207207
model_data : ndarray
208208
The model simulate the fitting image is fitted with.
209209
@@ -214,14 +214,14 @@ def __init__(
214214
chi_squared_map : ndarray
215215
The chi-squared map of the fit ((datas - model_data) / noise_maps ) **2.0
216216
chi_squared : float
217-
The overall chi-squared of the model's fit to the data, summed over every simulator-point.
217+
The overall chi-squared of the model's fit to the dataset, summed over every simulator-point.
218218
reduced_chi_squared : float
219219
The reduced chi-squared of the model's fit to simulate (chi_squared / number of datas points), summed over \
220220
every simulator-point.
221221
noise_normalization : float
222222
The overall normalization term of the noise_map-map, summed over every simulator-point.
223223
likelihood : float
224-
The overall likelihood of the model's fit to the data, summed over evey simulator-point.
224+
The overall likelihood of the model's fit to the dataset, summed over evey simulator-point.
225225
"""
226226

227227
super(InterferometerFit, self).__init__(

autoarray/mask/mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def unmasked_blurred_array_from_padded_array_psf_and_image_shape(
340340
):
341341
"""For a padded grid and psf, compute an unmasked blurred image from an unmasked unblurred image.
342342
343-
This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \
343+
This relies on using the lens dataset's padded-grid, which is a grid of (y,x) coordinates which extends over the \
344344
entire image as opposed to just the masked region.
345345
346346
Parameters

autoarray/masked/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .masked_structures import MaskedArray as array, MaskedGrid as grid
2-
from .masked_data import (
2+
from .masked_dataset import (
33
MaskedImaging as imaging,
44
MaskedInterferometer as interferometer,
55
)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66

77

8-
class AbstractMaskedData(object):
8+
class AbstractMaskedDataset(object):
99
def __init__(
1010
self,
1111
mask,
@@ -38,7 +38,7 @@ def __init__(
3838
self.inversion_uses_border = inversion_uses_border
3939

4040

41-
class MaskedImaging(AbstractMaskedData):
41+
class MaskedImaging(AbstractMaskedDataset):
4242
def __init__(
4343
self,
4444
imaging,
@@ -49,10 +49,10 @@ def __init__(
4949
inversion_uses_border=True,
5050
):
5151
"""
52-
The lens data is the collection of data_type (image, noise-map, PSF), a mask, grid, convolver \
52+
The lens dataset is the collection of data_type (image, noise-map, PSF), a mask, grid, convolver \
5353
and other utilities that are used for modeling and fitting an image of a strong lens.
5454
55-
Whilst the image, noise-map, etc. are loaded in 2D, the lens data creates reduced 1D arrays of each \
55+
Whilst the image, noise-map, etc. are loaded in 2D, the lens dataset creates reduced 1D arrays of each \
5656
for lensing calculations.
5757
5858
Parameters
@@ -183,7 +183,7 @@ def signal_to_noise_limited_from_signal_to_noise_limit(self, signal_to_noise_lim
183183
)
184184

185185

186-
class MaskedInterferometer(AbstractMaskedData):
186+
class MaskedInterferometer(AbstractMaskedDataset):
187187
def __init__(
188188
self,
189189
interferometer,
@@ -194,10 +194,10 @@ def __init__(
194194
inversion_uses_border=True,
195195
):
196196
"""
197-
The lens data is the collection of data_type (image, noise-map, primary_beam), a mask, grid, convolver \
197+
The lens dataset is the collection of data_type (image, noise-map, primary_beam), a mask, grid, convolver \
198198
and other utilities that are used for modeling and fitting an image of a strong lens.
199199
200-
Whilst the image, noise-map, etc. are loaded in 2D, the lens data creates reduced 1D arrays of each \
200+
Whilst the image, noise-map, etc. are loaded in 2D, the lens dataset creates reduced 1D arrays of each \
201201
for lensing calculations.
202202
203203
Parameters

0 commit comments

Comments
 (0)