potpyri.utils.utilities

General utilities for catalogs, coordinates, and numeric parsing.

Used by absolute photometry and other steps that need Vizier catalog IDs or coordinate handling.

Functions

find_catalog(catalog, fil, coord_ra, coord_dec)

Return Vizier catalog ID and column names for the given catalog and filter.

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.find_catalog(catalog, fil, coord_ra, coord_dec)[source]

Return Vizier catalog ID and column names for the given catalog and filter.

Supports SDSS, 2MASS, UKIRT, PS1, SKYMAPPER. For southern u-band, uses SkyMapper automatically.

Parameters:
  • catalog (str) – Catalog name (e.g. ‘PS1’, ‘SDSS’, ‘2MASS’).

  • fil (str) – Filter band (e.g. ‘r’, ‘g’, ‘J’).

  • coord_ra (float) – Right ascension (used for catalog selection).

  • coord_dec (float) – Declination (used for catalog selection; <0 can trigger SkyMapper for u-band).

Returns:

(catalog, catalog_ID, ra_col, dec_col, mag_col, err_col) for use in Vizier queries. catalog_ID/ra/dec/mag/err may be None if filter not supported.

Return type:

tuple

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