diff --git a/autoarray/structures/arrays/uniform_2d.py b/autoarray/structures/arrays/uniform_2d.py index 80ba89e4a..9c14f6647 100644 --- a/autoarray/structures/arrays/uniform_2d.py +++ b/autoarray/structures/arrays/uniform_2d.py @@ -4,6 +4,8 @@ from pathlib import Path from typing import List, Optional, Tuple, Union +from autoconf import conf + from autoarray.mask.mask_2d import Mask2D from autoarray.structures.abstract_structure import Structure from autoarray.structures.header import Header @@ -257,6 +259,10 @@ def __new__( array_2d.slim[7] = value of first sub-pixel in pixel 7. array_2d.slim[8] = value of first sub-pixel in pixel 8. + In **PyAutoCTI** all `Array2D` objects are used in their `native` representation without sub-gridding. + Significant memory can be saved by only store this format, thus the `native_binned_only` config override + can force this behaviour. It is recommended users do not use this option to avoid unexpected behaviour. + Parameters ---------- values @@ -333,6 +339,9 @@ def __new__( array_2d.output_to_fits(file_path="/path/for/output") """ + if conf.instance["general"]["structures"]["native_binned_only"]: + store_native = True + values = array_2d_util.convert_array_2d( array_2d=values, mask_2d=mask, @@ -416,7 +425,13 @@ def binned(self) -> "Array2D": performed by taking the mean of all (y,x) values in each sub pixel. If the array is stored in 1D it is return as is. If it is stored in 2D, it must first be mapped from 2D to 1D. + + In **PyAutoCTI** all `Array2D` objects are used in their `native` representation without sub-gridding. + Significant memory can be saved by only store this format, thus the `native_binned_only` config override + can force this behaviour. It is recommended users do not use this option to avoid unexpected behaviour. """ + if conf.instance["general"]["structures"]["native_binned_only"]: + return self array_2d_slim = self.slim