Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve errors + docs #122

Merged
merged 7 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions docs/ipynb/casestudies/transit.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion prose/blocks/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
reference: Image,
name=None,
verbose=False,
discard_tolerance=0.8,
discard_tolerance=0.5,
match_tolerance=5,
):
"""Set Image sources to reference sources (from a reference Image)
Expand Down
2 changes: 1 addition & 1 deletion prose/blocks/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, name, mode: str = None, limit=10000, **kwargs):
self.limit = limit

if self.mode == "replace":
self.require = ["sources"]
self.read = ["sources"]

def get_catalog(self, image):
raise NotImplementedError()
Expand Down
3 changes: 3 additions & 0 deletions prose/blocks/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def __init__(self, radii: np.ndarray = None, scale: bool = True, name=None):
self._radii = radii
self.scale = scale

if self.scale:
self.read.append("fwhm")

def run(self, image: Image):
if self.scale:
radii = np.array(image.fwhm * self._radii)
Expand Down
4 changes: 3 additions & 1 deletion prose/core/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def _check_require(self, image):
if not image.plate_solved:
raise AttributeError(f"Image must have valid WCS")
if not hasattr(image, _require) and not hasattr(image.computed, _require):
raise AttributeError(f"Image must have attribute '{_require}'")
raise AttributeError(
f"[{self.__class__.__name__}] Image must have attribute '{_require}'"
)

def _run(self, buffer):
t0 = time()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prose"
version = "3.2.4"
version = "3.2.5"
description = "Modular image processing pipelines for Astronomy"
authors = ["Lionel Garcia"]
license = "MIT"
Expand Down