hipscat.pixel_math.validators
#
Module Contents#
Classes#
Error messages for the coordinate validators |
Functions#
|
Validates that a cone search radius is positive |
Validates that declination values are in the [-90,90] degree range |
|
|
Checks if the polygon contain a minimum of three vertices, that they are |
|
Checks if all the vertices of the polygon are contained in a same plane. |
|
Checks if ra and dec values are valid for the box search. |
- validate_radius(radius_arcsec: float)[source]#
Validates that a cone search radius is positive
- Parameters:
radius_arcsec (float) – The cone radius, in arcseconds
- Raises:
ValueError – if radius is non-positive
- validate_declination_values(dec: float | List[float])[source]#
Validates that declination values are in the [-90,90] degree range
- Parameters:
dec (float | List[float]) – The declination values to be validated
- Raises:
ValueError – if declination values are not in the [-90,90] degree range
- validate_polygon(vertices: numpy.ndarray)[source]#
Checks if the polygon contain a minimum of three vertices, that they are unique and that the polygon does not fall on a great circle.
- Parameters:
vertices (np.ndarray) – The polygon vertices, in cartesian coordinates
- Raises:
ValueError – exception if the polygon is invalid.
- is_polygon_degenerate(vertices: numpy.ndarray) bool [source]#
Checks if all the vertices of the polygon are contained in a same plane. If the plane intersects the center of the sphere, the polygon is degenerate.
- Parameters:
vertices (np.ndarray) – The polygon vertices, in cartesian coordinates
- Returns:
A boolean, which is True if the polygon is degenerate, i.e. if it falls on a great circle, False otherwise.
- validate_box_search(ra: Tuple[float, float] | None, dec: Tuple[float, float] | None)[source]#
Checks if ra and dec values are valid for the box search.
At least one range of ra or dec must have been provided
Ranges must be pairs of non-duplicate minimum and maximum values, in degrees
Declination values, if existing, must be in ascending order
Declination values, if existing, must be in the [-90,90] degree range
- Parameters:
ra (Tuple[float, float]) – Right ascension range, in degrees
dec (Tuple[float, float]) – Declination range, in degrees