Skip to content

Commit

Permalink
use mindist instead of resol for margin filter
Browse files Browse the repository at this point in the history
  • Loading branch information
smcguire-cmu committed Nov 19, 2024
1 parent c27133d commit 7c8dfb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hats/catalog/margin_cache/margin_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def filter_by_moc(self, moc: MOC) -> Self:
pixel sizes.
"""
max_order = moc.max_order
max_order_size = hp.nside2resol(2**max_order, arcmin=True)
if self.catalog_info.margin_threshold > max_order_size * 60:
max_order_size_arcsec = hp.order2mindist(max_order) * 60
if self.catalog_info.margin_threshold > max_order_size_arcsec:
raise ValueError(
f"Cannot Filter Margin: Margin size {self.catalog_info.margin_threshold} is "
f"greater than the size of a pixel at the highest order {max_order}."
Expand Down

0 comments on commit 7c8dfb7

Please sign in to comment.