Skip to content

Commit

Permalink
Remove margin fine filtering. (#421)
Browse files Browse the repository at this point in the history
* Remove margin fine filtering.

* Remove unused unseen.
  • Loading branch information
delucchi-cmu authored Nov 18, 2024
1 parent c27133d commit f732d78
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ main, margin ]

jobs:
pre-commit-ci:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ main, margin ]

jobs:
build:
Expand Down
1 change: 0 additions & 1 deletion src/hats/pixel_math/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .healpix_pixel import HealpixPixel
from .healpix_pixel_convertor import HealpixInputTypes, get_healpix_pixel
from .margin_bounding import check_margin_bounds
from .partition_stats import empty_histogram, generate_alignment, generate_histogram
from .pixel_margins import get_margin
from .spatial_index import compute_spatial_index, spatial_index_to_healpix
24 changes: 0 additions & 24 deletions src/hats/pixel_math/healpix_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ def npix2nside(param):
return hp.npix2nside(param)


def nside2npix(param):
return hp.nside2npix(param)


def order2npix(param):
return hp.order2npix(param)


def npix2order(param):
return hp.npix2order(param)


def nside2resol(*args, **kwargs):
return hp.nside2resol(*args, **kwargs)

Expand All @@ -48,10 +40,6 @@ def ring2nest(*args, **kwargs):
return hp.ring2nest(*args, **kwargs)


def unseen_pixel():
return hp.pixelfunc.UNSEEN


## Query


Expand All @@ -63,10 +51,6 @@ def query_polygon(*args, **kwargs):
return hp.query_polygon(*args, **kwargs)


def boundaries(*args, **kwargs):
return hp.boundaries(*args, **kwargs)


def get_all_neighbours(*args, **kwargs):
return hp.get_all_neighbours(*args, **kwargs)

Expand All @@ -78,14 +62,6 @@ def ang2vec(*args, **kwargs):
return hp.ang2vec(*args, **kwargs)


def pix2ang(*args, **kwargs):
return hp.pix2ang(*args, **kwargs)


def vec2dir(*args, **kwargs):
return hp.vec2dir(*args, **kwargs)


def pix2xyf(*args, **kwargs):
return hp.pix2xyf(*args, **kwargs)

Expand Down
139 changes: 0 additions & 139 deletions src/hats/pixel_math/margin_bounding.py

This file was deleted.

109 changes: 0 additions & 109 deletions tests/hats/pixel_math/test_margin_bounding.py

This file was deleted.

19 changes: 9 additions & 10 deletions tests/hats/pixel_math/test_spatial_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,21 @@ def test_spatial_index_to_healpix_low_order():
def test_healpix_to_spatial_index_single():
orders = [3, 3, 4, 1]
pixels = [0, 12, 1231, 11]
pixels_at_high_order = [p * (4 ** (SPATIAL_INDEX_ORDER - o)) for o, p in zip(orders, pixels)]
lon, lat = hp.pix2ang(
[2**SPATIAL_INDEX_ORDER] * len(orders), pixels_at_high_order, nest=True, lonlat=True
)
actual_spatial_indices = compute_spatial_index(lon, lat)

ra = [45.0, 45.0, 0.0, 225.0]
dec = [7.11477952e-08, 1.94712207e01, 1.44775123e01, 4.18103150e01]

actual_spatial_indices = compute_spatial_index(ra, dec)
test_spatial_indices = [healpix_to_spatial_index(o, p) for o, p in zip(orders, pixels)]
assert np.all(test_spatial_indices == actual_spatial_indices)


def test_healpix_to_spatial_index_array():
orders = [3, 3, 4, 1]
pixels = [0, 12, 1231, 11]
pixels_at_high_order = [p * (4 ** (SPATIAL_INDEX_ORDER - o)) for o, p in zip(orders, pixels)]
lon, lat = hp.pix2ang(
[2**SPATIAL_INDEX_ORDER] * len(orders), pixels_at_high_order, nest=True, lonlat=True
)
actual_spatial_indices = compute_spatial_index(lon, lat)

ra = [45.0, 45.0, 0.0, 225.0]
dec = [7.11477952e-08, 1.94712207e01, 1.44775123e01, 4.18103150e01]
actual_spatial_indices = compute_spatial_index(ra, dec)
test_spatial_indices = healpix_to_spatial_index(orders, pixels)
assert np.all(test_spatial_indices == actual_spatial_indices)

0 comments on commit f732d78

Please sign in to comment.