Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
smcguire-cmu committed Nov 22, 2024
1 parent d090da7 commit cfdb7af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lsdb/catalog/dataset/healpix_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def plot_points(
dec_column: str | None = None,
color_col: str | None = None,
projection: str = "MOL",
title: str = None,
title: str | None = None,
fov: Quantity | Tuple[Quantity, Quantity] = None,
center: SkyCoord | None = None,
wcs: astropy.wcs.WCS = None,
Expand Down Expand Up @@ -775,6 +775,12 @@ def plot_points(
if dec_column is None:
dec_column = self.hc_structure.catalog_info.dec_column

if ra_column is None:
raise ValueError("Catalog has no RA Column")

if dec_column is None:
raise ValueError("Catalog has no DEC Column")

if title is None:
title = f"Points in the {self.name} catalog"

Expand Down
8 changes: 7 additions & 1 deletion tests/lsdb/catalog/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import numpy.testing as npt
import pandas as pd
import pytest
from hats.io.file_io import read_fits_image
from astropy.coordinates import SkyCoord
from astropy.visualization.wcsaxes import WCSAxes
from hats.inspection.visualize_catalog import get_fov_moc_from_wcs
from hats.io.file_io import read_fits_image
from hats.pixel_math import HealpixPixel, spatial_index_to_healpix
from mocpy import WCS

Expand All @@ -25,6 +25,12 @@
from lsdb.dask.merge_catalog_functions import filter_by_spatial_index_to_pixel


@pytest.fixture(autouse=True)
def reset_matplotlib():
yield
plt.close("all")


def test_catalog_pixels_equals_hc_catalog_pixels(small_sky_order1_catalog, small_sky_order1_hats_catalog):
assert small_sky_order1_catalog.get_healpix_pixels() == small_sky_order1_hats_catalog.get_healpix_pixels()

Expand Down

0 comments on commit cfdb7af

Please sign in to comment.