Skip to content

Commit a715118

Browse files
committed
Merge branch 'main' of github.com:Jammy2211/PyAutoArray into main
2 parents 45a35f4 + 2485318 commit a715118

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

autoarray/mask/abstract_mask.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
from abc import ABC
44
import logging
55
import numpy as np
6-
from pathlib import Path
7-
from typing import Dict, Union
6+
from typing import Dict
87

98
from autoconf.fitsable import output_to_fits
109

autoarray/mask/mask_1d.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from enum import Enum
34
import logging
45
import numpy as np
56
from pathlib import Path
@@ -20,6 +21,10 @@
2021
logger = logging.getLogger(__name__)
2122

2223

24+
class Mask1DKeys(Enum):
25+
PIXSCA = "PIXSCA"
26+
ORIGIN = "ORIGIN"
27+
2328
class Mask1D(Mask):
2429
def __init__(
2530
self,
@@ -172,7 +177,8 @@ def header_dict(self) -> Dict:
172177
-------
173178
A dictionary containing the pixel scale of the mask, which can be output to a .fits file.
174179
"""
180+
175181
return {
176-
"PIXSCA": self.pixel_scales[0],
177-
"ORIGIN": self.origin[0],
182+
Mask1DKeys.PIXSCA: self.pixel_scales[0],
183+
Mask1DKeys.ORIGIN: self.origin[0],
178184
}

autoarray/mask/mask_2d.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22
import logging
3+
from enum import Enum
34
import numpy as np
45
from pathlib import Path
56
from typing import TYPE_CHECKING, Dict, List, Tuple, Union
@@ -30,6 +31,13 @@
3031
logger = logging.getLogger(__name__)
3132

3233

34+
class Mask2DKeys(Enum):
35+
PIXSCAY = "PIXSCAY"
36+
PIXSCAX = "PIXSCAX"
37+
ORIGINY = "ORIGINY"
38+
ORIGINX = "ORIGINX"
39+
40+
3341
class Mask2D(Mask):
3442
# noinspection PyUnusedLocal
3543
def __init__(
@@ -716,11 +724,12 @@ def header_dict(self) -> Dict:
716724
-------
717725
A dictionary containing the pixel scale of the mask, which can be output to a .fits file.
718726
"""
727+
719728
return {
720-
"PIXSCAY": self.pixel_scales[0],
721-
"PIXSCAX": self.pixel_scales[1],
722-
"ORIGINY": self.origin[0],
723-
"ORIGINX": self.origin[1],
729+
Mask2DKeys.PIXSCAY: self.pixel_scales[0],
730+
Mask2DKeys.PIXSCAX: self.pixel_scales[1],
731+
Mask2DKeys.ORIGINY: self.origin[0],
732+
Mask2DKeys.ORIGINX: self.origin[1],
724733
}
725734

726735
@property

0 commit comments

Comments
 (0)