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

is_number(num)

Return True if the value can be interpreted as a number.

parse_coord(ra, dec)

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 (str or number) – 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 (str or float) – Right ascension.

  • dec (str or float) – Declination.

Returns:

ICRS coordinate, or None if parsing fails.

Return type:

SkyCoord or None