Skip to main content
Ctrl+K

hats 0.7.3.dev38+g9078104ab documentation

Using HATS

  • Getting Started
  • Directory Scheme
  • Notebooks
    • Catalog Size Inspection
    • Cone Search / Nearest Neighbor
    • Using MOC with HATS
  • API Reference
    • hats
      • hats.catalog
        • hats.catalog.association_catalog
        • hats.catalog.catalog
        • hats.catalog.catalog_collection
        • hats.catalog.catalog_type
        • hats.catalog.dataset
        • hats.catalog.healpix_dataset
        • hats.catalog.index
        • hats.catalog.map
        • hats.catalog.margin_cache
        • hats.catalog.partition_info
      • hats.inspection
        • hats.inspection.visualize_catalog
      • hats.io
        • hats.io.file_io
        • hats.io.parquet_metadata
        • hats.io.paths
        • hats.io.skymap
        • hats.io.validation
      • hats.loaders
        • hats.loaders.read_hats
      • hats.pixel_math
        • hats.pixel_math.healpix_pixel
        • hats.pixel_math.healpix_pixel_convertor
        • hats.pixel_math.healpix_pixel_function
        • hats.pixel_math.healpix_shim
        • hats.pixel_math.partition_stats
        • hats.pixel_math.pixel_margins
        • hats.pixel_math.region_to_moc
        • hats.pixel_math.sparse_histogram
        • hats.pixel_math.spatial_index
        • hats.pixel_math.validators
      • hats.pixel_tree
        • hats.pixel_tree.moc_filter
        • hats.pixel_tree.moc_utils
        • hats.pixel_tree.negative_tree
        • hats.pixel_tree.pixel_alignment
        • hats.pixel_tree.pixel_alignment_types
        • hats.pixel_tree.pixel_tree
      • hats.search
        • hats.search.region_search

Project

  • About & Citation
  • Contribution Guide
  • .rst

hats.search.region_search

Contents

  • Functions
  • Module Contents
    • box_filter()
    • cone_filter()
    • polygon_filter()
    • get_cartesian_polygon()

hats.search.region_search#

Functions#

box_filter(→ nested_pandas.NestedFrame)

Filters a dataframe to only include points within the specified box region.

cone_filter(data_frame, ra, dec, radius_arcsec, metadata)

Filters a dataframe to only include points within the specified cone

polygon_filter(→ nested_pandas.NestedFrame)

Filters a dataframe to only include points within the specified polygon.

get_cartesian_polygon(vertices)

Creates the convex polygon to filter pixels with. It transforms the

Module Contents#

box_filter(data_frame: nested_pandas.NestedFrame, ra: tuple[float, float], dec: tuple[float, float], metadata: hats.catalog.TableProperties) → nested_pandas.NestedFrame[source]#

Filters a dataframe to only include points within the specified box region.

Parameters:
data_framenpd.NestedFrame

DataFrame containing points in the sky

ratuple[float,float]

Right ascension range, in degrees

dectuple[float,float]

Declination range, in degrees

metadataTableProperties

hats Catalog with catalog_info that matches data_frame

Returns:
NestedFrame

A new DataFrame with the rows from data_frame filtered to only the points inside the box region.

cone_filter(data_frame: nested_pandas.NestedFrame, ra, dec, radius_arcsec, metadata: hats.catalog.TableProperties)[source]#

Filters a dataframe to only include points within the specified cone

Parameters:
data_framenpd.NestedFrame

DataFrame containing points in the sky

rafloat

Right Ascension of the center of the cone in degrees

decfloat

Declination of the center of the cone in degrees

radius_arcsecfloat

Radius of the cone in arcseconds

metadatahc.TableProperties

hats TableProperties with metadata that matches data_frame

Returns:
NestedFrame

A new DataFrame with the rows from data_frame filtered to only the points inside the cone

polygon_filter(data_frame: nested_pandas.NestedFrame, polygon, metadata: hats.catalog.TableProperties) → nested_pandas.NestedFrame[source]#

Filters a dataframe to only include points within the specified polygon.

Parameters:
data_framenpd.NestedFrame

DataFrame containing points in the sky

polygonConvexPolygon

Convex spherical polygon of interest, used to filter points

metadataTableProperties

hats Catalog with catalog_info that matches dataframe

Returns:
NestedFrame

A new DataFrame with the rows from dataframe filtered to only the pixels inside the polygon.

get_cartesian_polygon(vertices: list[tuple[float, float]])[source]#

Creates the convex polygon to filter pixels with. It transforms the vertices, provided in sky coordinates of ra and dec, to their respective cartesian representation on the unit sphere.

Parameters:
verticeslist[tuple[float, float]]

The list of vertices of the polygon to filter pixels with, as a list of (ra,dec) coordinates, in degrees.

Returns:
sphgeom.ConvexPolygon

The convex polygon object.

previous

hats.search

next

About

Contents
  • Functions
  • Module Contents
    • box_filter()
    • cone_filter()
    • polygon_filter()
    • get_cartesian_polygon()

By LINCC Frameworks

© Copyright 2025, LINCC Frameworks.