Skip to content

Commit

Permalink
Update path (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein authored May 23, 2024
1 parent 4eb41cd commit ac269bc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mirar/processors/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from astropy.wcs import WCS

from mirar.data import Image, ImageBatch
from mirar.paths import BASE_NAME_KEY, FITS_MASK_KEY, get_output_dir
from mirar.paths import BASE_NAME_KEY, FITS_MASK_KEY, base_code_dir, get_output_dir
from mirar.processors.base_processor import BaseImageProcessor

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -102,15 +102,25 @@ def __init__(
output_dir=output_dir,
only_write_mask=only_write_mask,
)
self.mask_path = mask_path
self.mask_path = Path(mask_path) if mask_path is not None else None
self.mask_path_key = mask_path_key
if mask_path is None and mask_path_key is None:
raise ValueError("Must specify either mask_path or mask_path_key")
if mask_path is not None and mask_path_key is not None:
raise ValueError("Must specify either mask_path or mask_path_key, not both")

def description(self) -> str:
return f"Processor to mask bad pixels using a pre-defined map: {self.mask_path}"

if self.mask_path is None:
return (
f"Mask bad pixels using a pre-defined map with key"
f"{self.mask_path_key}"
)

return (
f"Mask bad pixels using a pre-defined map at "
f"{self.mask_path.relative_to(base_code_dir)}"
)

def get_mask(self, image) -> np.ndarray:
"""
Expand Down

0 comments on commit ac269bc

Please sign in to comment.