Skip to content

Commit 6b363da

Browse files
Jammy2211Jammy2211
authored andcommitted
added fits_are_Zoomed to config
1 parent ddd8b74 commit 6b363da

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

autoarray/config/visualize/plots.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# For example, if `plots: fit: subplot_fit=True``, the ``fit_dataset.png`` subplot file will
44
# be plotted every time visualization is performed.
55

6+
subplot_format: [png] # Output format of all subplots, can be png, pdf or both (e.g. [png, pdf])
7+
fits_are_zoomed: true # If true, output .fits files are zoomed in on the center of the unmasked region image, saving hard-disk space.
8+
69
dataset: # Settings for plots of all datasets (e.g. ImagingPlotter, InterferometerPlotter).
710
subplot_dataset: true # Plot subplot containing all dataset quantities (e.g. the data, noise-map, etc.)?
811
imaging: # Settings for plots of imaging datasets (e.g. ImagingPlotter)

autoarray/structures/arrays/uniform_2d.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,25 @@ def native(self) -> "Array2D":
293293
values=self, mask=self.mask, header=self.header, store_native=True
294294
)
295295

296+
@property
297+
def native_for_fits(self) -> "Array2D":
298+
"""
299+
Return a `Array2D` for output to a .fits file, where the data is stored in its `native` representation,
300+
which is an ``ndarray`` of shape [total_y_pixels, total_x_pixels].
301+
302+
Depending on configuration files, this array could be zoomed in on such that only the unmasked region
303+
of the image is included in the .fits file, to save hard-disk space. Alternatively, the original `shape_native`
304+
of the data can be retained.
305+
306+
If it is already stored in its `native` representation it is return as it is. If not, it is mapped from
307+
`slim` to `native` and returned as a new `Array2D`.
308+
"""
309+
310+
311+
return Array2D(
312+
values=self, mask=self.mask, header=self.header, store_native=True
313+
)
314+
296315
@property
297316
def native_skip_mask(self) -> "Array2D":
298317
"""

0 commit comments

Comments
 (0)