Skip to content

Commit

Permalink
Use different methods for healpix manipulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Nov 18, 2024
1 parent 0d47df8 commit 9279af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/hats_import/margin_cache/margin_cache_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def _check_arguments(self):
"margin_order must be of a higher order than the highest order catalog partition pixel."
)

margin_pixel_nside = hp.order2nside(self.margin_order)
margin_pixel_avgsize = hp.nside2resol(margin_pixel_nside, arcmin=True)
margin_pixel_mindist = hp.avgsize2mindist(margin_pixel_avgsize)
margin_pixel_mindist = hp.order2mindist(self.margin_order)
if margin_pixel_mindist * 60.0 < self.margin_threshold:
raise ValueError("margin pixels must be larger than margin_threshold")

Expand Down
4 changes: 2 additions & 2 deletions src/hats_import/soap/resume_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import List, Optional, Tuple

import hats.pixel_math.healpix_shim as hp
from hats import pixel_math
import numpy as np
from hats import read_hats
from hats.catalog import Catalog
Expand Down Expand Up @@ -193,8 +194,7 @@ def source_to_object_map(object_catalog, source_catalog):

for source, objects in source_to_object.items():
# get all neighboring pixels
nside = hp.order2nside(source.order)
neighbors = hp.get_all_neighbours(nside, source.pixel, nest=True)
neighbors = pixel_math.get_margin(source.order, source.pixel, 0)

## get rid of -1s and normalize to max order
explosion_factor = 4 ** (max_order - source.order)
Expand Down

0 comments on commit 9279af3

Please sign in to comment.