ioutils.ephemeris.load_compact_parq_ephem
ioutils.ephemeris.load_compact_parq_ephem(
fpath,
dtypes=None,
filters=None,
columns=None,
coord_map=None,
)Loads a compacted ephemeris parquet file and decompresses it.
This reverses the transformation applied by compact_ephem_parq_cols:
- Divides factored columns by their factors to recover original values.
- Converts HEALPix indices back to lon/lat coordinates.
Parameters
fpath : str or Path-
Path to the compacted ephemeris Parquet file.
dtypes : dict, default = None-
Dictionary mapping original column names to (factor, stored_dtype, navalue, original_dtype).
- factor: factor multiplied to the stored value for compaction
- stored_dtype: distinguishes floating NaN from integer sentinel storage
- navalue: value used instead of NaN for integer storage
- original_dtype: The final desired dtype after decompression
Must match the dtypes used during compaction. If None, uses
EPH_DTYPES_BASE... warning:: A non-floating output dtype cannot represent NaN. Missing values decode to 0 for such output dtypes. Floating output dtypes (including
float32andfloat64) preserve NaN. filters : str, list, or pqfilt expression, default = None-
PQfilt filters using original column names. Strings and parsed expression trees support repeated columns,
&,|,~, and parentheses::filters="(vmag > 10 & vmag < 20) | alpha > 100"Legacy tuple lists remain supported:
AND format (list of tuples)::
filters=[('alpha', '>', 10), ('vmag', '<', 20)]DNF format (list of lists): OR between groups, AND within::
filters=[[('alpha', '>', 10)], [('vmag', '>', 20)]]For factored columns, values are automatically scaled. Missing values (nulls, NaNs, and integer sentinels) do not satisfy comparisons, including negated comparisons. Use
is nulloris not nullto test missingness. A row may still match another OR branch. Coordinate columns (stored as HEALPix) are not supported for filtering.Supported operators: ‘>’, ‘>=’, ‘<’, ‘<=’, ‘==’, ‘!=’, ‘in’, ‘not in’, ‘is null’, ‘is not null’.
Noneor an empty list applies no filter. columns : list of str, default = None-
Columns to load and return. Use original names (e.g., ‘alpha’, ‘ra’).
coord_map : dict, default = None-
Mapping from coord_name to (lon_col, lat_col). If None, uses DEFAULT_COORD_MAP.
Returns
: pd.DataFrame-
Decompressed ephemeris DataFrame with original column names and values.
Raises
: ValueError-
If a filter is specified for a coordinate column.
Notes
HEALPix parameters (scheme and nside) are automatically parsed from column names. Expected format: {coord_name}_hpidx_{ring|nested}_{nside_expr}