autolens.twins.ObservationSetup#
- class ObservationSetup[source]#
Bases:
objectHow a lens is observed: mask, PSF, observed noise map and sampling.
- Parameters:
mask (
Mask2D) – The mask of the observation; twins are simulated and stored on it.psf (
Optional[Convolver]) – The PSF as anal.Convolver(already normalised, as held by the dataset).noise_map (
Array2D) – The observed noise map (standard deviation per pixel) onmask. It is the default noise of every twin (ruling R2).pixel_scales (
Optional[Tuple[float,float]]) – Default to the mask’s values.origin (
Optional[Tuple[float,float]]) – Default to the mask’s values.over_sample_size_lp (
Union[int,Array2D]) – Over-sampling of the light-profile and pixelization grids (an int or anaa.Array2Donmask), as used by the fit.over_sample_size_pixelization (
Union[int,Array2D]) – Over-sampling of the light-profile and pixelization grids (an int or anaa.Array2Donmask), as used by the fit.cosmology – The cosmology the twin is interpreted in;
Nonemeans the tracer’s own.exposure_time (
Optional[float]) – Only used by the"poisson"noise route, which requires both.background_sky_level (
Optional[float]) – Only used by the"poisson"noise route, which requires both.
Methods
An
al.Imagingofdataobserved with this setup: masked with the setup mask and over-sampled with its over-sample sizes, following the aggregator's reload order (build unmasked,apply_maskonce,apply_over_sampling).Rebuild the masked, over-sampled
Imaginga model-fit used from itsimage/dataset.fits(HDUs: 0 mask, 1 data, 2 noise map, 3 PSF, 4 light-profile over-sampling, 5 pixelization over-sampling), as written byAnalysisImaging.save_attributes(autolens/imaging/model/analysis.py).The setup of a masked
al.Imagingdataset: its mask, PSF, noise map and over-sampling.The setup of a model-fit output directory (the folder holding
image/andfiles/), read fromimage/dataset.fitsexactly as the aggregator does (seedataset_from_fit_directory).A copy of this setup with the given fields replaced, e.g.
setup.with_(exposure_time=2000.0, background_sky_level=1.0).Attributes
The constructor arguments of this setup, by name.
The masked lens-plane grid, over-sampled with
over_sample_size_lp.- classmethod from_dataset(dataset, cosmology=None, exposure_time=None, background_sky_level=None)[source]#
The setup of a masked
al.Imagingdataset: its mask, PSF, noise map and over-sampling. The PSF and noise map are copied so later changes to the dataset do not leak into the setup.
- static dataset_from_fit_directory(path)[source]#
Rebuild the masked, over-sampled
Imaginga model-fit used from itsimage/dataset.fits(HDUs: 0 mask, 1 data, 2 noise map, 3 PSF, 4 light-profile over-sampling, 5 pixelization over-sampling), as written byAnalysisImaging.save_attributes(autolens/imaging/model/analysis.py).This replicates PyAutoGalaxy’s aggregator reload
_imaging_from(autogalaxy/aggregator/imaging/imaging.pylines 29-115) andagg_util.mask_header_fromline for line, for a single (non-summed) analysis, without needing anaf.Fit. If that recipe changes, change this.
- classmethod from_fit_directory(path, cosmology=None, exposure_time=None, background_sky_level=None)[source]#
The setup of a model-fit output directory (the folder holding
image/andfiles/), read fromimage/dataset.fitsexactly as the aggregator does (seedataset_from_fit_directory).
- with_(**overrides)[source]#
A copy of this setup with the given fields replaced, e.g.
setup.with_(exposure_time=2000.0, background_sky_level=1.0).Fields that depend on the mask (noise map, array over-sampling) are not re-derived: replacing the mask requires replacing them too.
- dataset_from(data, noise_map=None)[source]#
An
al.Imagingofdataobserved with this setup: masked with the setup mask and over-sampled with its over-sample sizes, following the aggregator’s reload order (build unmasked,apply_maskonce,apply_over_sampling).- Parameters:
data – An
aa.Array2D(masked or native) or an ndarray (native or slim).noise_map – Defaults to the setup’s observed noise map.