From 9279af3f5f87152043aa822692afd0f5eb20cacc Mon Sep 17 00:00:00 2001 From: Melissa DeLucchi Date: Mon, 18 Nov 2024 13:16:34 -0500 Subject: [PATCH] Use different methods for healpix manipulation. --- src/hats_import/margin_cache/margin_cache_arguments.py | 4 +--- src/hats_import/soap/resume_plan.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hats_import/margin_cache/margin_cache_arguments.py b/src/hats_import/margin_cache/margin_cache_arguments.py index 69542f07..b56a2a4e 100644 --- a/src/hats_import/margin_cache/margin_cache_arguments.py +++ b/src/hats_import/margin_cache/margin_cache_arguments.py @@ -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") diff --git a/src/hats_import/soap/resume_plan.py b/src/hats_import/soap/resume_plan.py index e4447fc2..1c696724 100644 --- a/src/hats_import/soap/resume_plan.py +++ b/src/hats_import/soap/resume_plan.py @@ -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 @@ -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)