Skip to content

Commit 03b42dc

Browse files
committed
Remove margin fine filtering.
1 parent c27133d commit 03b42dc

File tree

7 files changed

+11
-281
lines changed

7 files changed

+11
-281
lines changed

.github/workflows/pre-commit-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
push:
88
branches: [ main ]
99
pull_request:
10-
branches: [ main ]
10+
branches: [ main, margin ]
1111

1212
jobs:
1313
pre-commit-ci:

.github/workflows/testing-and-coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
push:
88
branches: [ main ]
99
pull_request:
10-
branches: [ main ]
10+
branches: [ main, margin ]
1111

1212
jobs:
1313
build:

src/hats/pixel_math/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from .healpix_pixel import HealpixPixel
44
from .healpix_pixel_convertor import HealpixInputTypes, get_healpix_pixel
5-
from .margin_bounding import check_margin_bounds
65
from .partition_stats import empty_histogram, generate_alignment, generate_histogram
76
from .pixel_margins import get_margin
87
from .spatial_index import compute_spatial_index, spatial_index_to_healpix

src/hats/pixel_math/healpix_shim.py

-20
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@ def npix2nside(param):
2020
return hp.npix2nside(param)
2121

2222

23-
def nside2npix(param):
24-
return hp.nside2npix(param)
25-
26-
2723
def order2npix(param):
2824
return hp.order2npix(param)
2925

3026

31-
def npix2order(param):
32-
return hp.npix2order(param)
33-
34-
3527
def nside2resol(*args, **kwargs):
3628
return hp.nside2resol(*args, **kwargs)
3729

@@ -63,10 +55,6 @@ def query_polygon(*args, **kwargs):
6355
return hp.query_polygon(*args, **kwargs)
6456

6557

66-
def boundaries(*args, **kwargs):
67-
return hp.boundaries(*args, **kwargs)
68-
69-
7058
def get_all_neighbours(*args, **kwargs):
7159
return hp.get_all_neighbours(*args, **kwargs)
7260

@@ -78,14 +66,6 @@ def ang2vec(*args, **kwargs):
7866
return hp.ang2vec(*args, **kwargs)
7967

8068

81-
def pix2ang(*args, **kwargs):
82-
return hp.pix2ang(*args, **kwargs)
83-
84-
85-
def vec2dir(*args, **kwargs):
86-
return hp.vec2dir(*args, **kwargs)
87-
88-
8969
def pix2xyf(*args, **kwargs):
9070
return hp.pix2xyf(*args, **kwargs)
9171

src/hats/pixel_math/margin_bounding.py

-139
This file was deleted.

tests/hats/pixel_math/test_margin_bounding.py

-109
This file was deleted.

tests/hats/pixel_math/test_spatial_index.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,21 @@ def test_spatial_index_to_healpix_low_order():
132132
def test_healpix_to_spatial_index_single():
133133
orders = [3, 3, 4, 1]
134134
pixels = [0, 12, 1231, 11]
135-
pixels_at_high_order = [p * (4 ** (SPATIAL_INDEX_ORDER - o)) for o, p in zip(orders, pixels)]
136-
lon, lat = hp.pix2ang(
137-
[2**SPATIAL_INDEX_ORDER] * len(orders), pixels_at_high_order, nest=True, lonlat=True
138-
)
139-
actual_spatial_indices = compute_spatial_index(lon, lat)
135+
136+
ra = [45.0, 45.0, 0.0, 225.0]
137+
dec = [7.11477952e-08, 1.94712207e01, 1.44775123e01, 4.18103150e01]
138+
139+
actual_spatial_indices = compute_spatial_index(ra, dec)
140140
test_spatial_indices = [healpix_to_spatial_index(o, p) for o, p in zip(orders, pixels)]
141141
assert np.all(test_spatial_indices == actual_spatial_indices)
142142

143143

144144
def test_healpix_to_spatial_index_array():
145145
orders = [3, 3, 4, 1]
146146
pixels = [0, 12, 1231, 11]
147-
pixels_at_high_order = [p * (4 ** (SPATIAL_INDEX_ORDER - o)) for o, p in zip(orders, pixels)]
148-
lon, lat = hp.pix2ang(
149-
[2**SPATIAL_INDEX_ORDER] * len(orders), pixels_at_high_order, nest=True, lonlat=True
150-
)
151-
actual_spatial_indices = compute_spatial_index(lon, lat)
147+
148+
ra = [45.0, 45.0, 0.0, 225.0]
149+
dec = [7.11477952e-08, 1.94712207e01, 1.44775123e01, 4.18103150e01]
150+
actual_spatial_indices = compute_spatial_index(ra, dec)
152151
test_spatial_indices = healpix_to_spatial_index(orders, pixels)
153152
assert np.all(test_spatial_indices == actual_spatial_indices)

0 commit comments

Comments
 (0)