potpyri.utils.utilities
General utilities for coordinates and numeric parsing.
Vizier catalog IDs and find_catalog() live in potpyri.utils.catalogs;
they are re-exported here for backward compatibility.
Functions
|
Return True if the value can be interpreted as a number. |
|
Parse RA and Dec strings into an astropy SkyCoord. |
- potpyri.utils.utilities.is_number(num)[source]
Return True if the value can be interpreted as a number.
- Parameters:
num (
strornumber) – Value to test.- Returns:
True if float(num) succeeds, False otherwise.
- Return type:
bool
- potpyri.utils.utilities.parse_coord(ra, dec)[source]
Parse RA and Dec strings into an astropy SkyCoord.
Accepts decimal degrees or sexagesimal (e.g. ‘12:30:00’ or ‘12.5’).
- Parameters:
ra (
strorfloat) – Right ascension.dec (
strorfloat) – Declination.
- Returns:
ICRS coordinate, or None if parsing fails.
- Return type:
SkyCoordorNone