Utils
Shared helpers exported from hipscatalog_gen.utils. Most functions are
prefixed with underscores but are re-exported via __all__ for pipeline use.
Example: resolve column names and validate RA/DEC:
from hipscatalog_gen.utils import _resolve_col_name, _validate_and_normalize_radec
ra = _resolve_col_name("RA", ddf, header=True)
dec = _resolve_col_name("DEC", ddf, header=True)
ddf = _validate_and_normalize_radec(ddf, ra, dec, log_fn)
Create directory and parents if they do not exist. |
|
Write UTF-8 text to file. |
|
Best-effort detection of a HATS catalog root directory. |
|
Return current UTC time in HiPS-friendly ISO 8601 format. |
|
Return local timestamp string for logging. |
|
Format a duration in seconds as HH:MM:SS.mmm. |
|
Log a compact one-line summary for a depth and pipeline phase. |
|
Prefer public Dask-like interfaces; fall back to LSDB ._ddf only when needed. |
|
Return column names referenced in a score expression. |
|
Resolve a column spec that can be a name or 1-based index. |
|
Return an empty DataFrame with same columns/dtypes as a collection. |
|
Validate RA/DEC ranges and normalize RA into [0, 360] if needed. |