Skip to content

Commit

Permalink
Change cone search argument to radius_arcsec (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Feb 27, 2024
1 parent ee9f120 commit 5439475
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/lsdb/catalog/test_cone_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
def test_cone_search_filters_correct_points(small_sky_order1_catalog_cloud):
ra = 0
dec = -80
radius = 20
radius_degrees = 20
radius = radius_degrees * 3600
center_coord = SkyCoord(ra, dec, unit="deg")
cone_search_catalog = small_sky_order1_catalog_cloud.cone_search(ra, dec, radius).compute()
print(len(cone_search_catalog))
for _, row in small_sky_order1_catalog_cloud.compute().iterrows():
row_ra = row[small_sky_order1_catalog_cloud.hc_structure.catalog_info.ra_column]
row_dec = row[small_sky_order1_catalog_cloud.hc_structure.catalog_info.dec_column]
sep = SkyCoord(row_ra, row_dec, unit="deg").separation(center_coord)
if sep.degree <= radius:
if sep.degree <= radius_degrees:
assert len(cone_search_catalog.loc[cone_search_catalog["id"] == row["id"]]) == 1
else:
assert len(cone_search_catalog.loc[cone_search_catalog["id"] == row["id"]]) == 0
Expand All @@ -21,7 +22,8 @@ def test_cone_search_filters_correct_points(small_sky_order1_catalog_cloud):
def test_cone_search_filters_partitions(small_sky_order1_catalog_cloud):
ra = 0
dec = -80
radius = 20
radius_degrees = 20
radius = radius_degrees * 3600
hc_conesearch = small_sky_order1_catalog_cloud.hc_structure.filter_by_cone(ra, dec, radius)
consearch_catalog = small_sky_order1_catalog_cloud.cone_search(ra, dec, radius)
assert len(hc_conesearch.get_healpix_pixels()) == len(consearch_catalog.get_healpix_pixels())
Expand Down

0 comments on commit 5439475

Please sign in to comment.