hipscatalog_gen.score_density_hybrid package

Submodules

hipscatalog_gen.score_density_hybrid.pipeline module

Hybrid density-first then score-based selection pipeline.

normalize_score_density_hybrid(ddf, cfg, diag_ctx, log_fn, persist_ddfs=False, avoid_computes=True)[source]

Add __score__ column and compute window without mutating cfg.

Parameters:
  • ddf (Any) – Dask-like collection with score columns or expressions.

  • cfg (Any) – Parsed configuration object.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • persist_ddfs (bool) – Whether to persist intermediate DDFs.

  • avoid_computes (bool) – Whether to avoid explicit compute() calls when possible.

Returns:

Tuple (ddf_with_score, ScoreDensityHybridParams).

Raises:

ValueError – If the score expression/configuration is invalid.

Return type:

tuple[Any, ScoreDensityHybridParams]

prepare_score_density_hybrid(ddf, cfg, diag_ctx, log_fn, params, persist_ddfs=False, avoid_computes=True)[source]

Restrict to a score window using pre-computed params.

Parameters:
  • ddf (Any) – Dask-like collection with __score__ already attached.

  • cfg (Any) – Parsed configuration object.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • params (ScoreDensityHybridParams) – Resolved score parameters.

  • persist_ddfs (bool) – Whether to persist the filtered DDF.

  • avoid_computes (bool) – Whether to avoid explicit compute() calls when possible.

Returns:

Dask-like collection filtered to the score window with unique IDs attached.

run_score_density_hybrid_selection(remainder_ddf, densmaps, keep_cols, ra_col, dec_col, cfg, out_dir, diag_ctx, log_fn, avoid_computes=True, params=None)[source]

Execute the score_density_hybrid selection.

Parameters:
  • remainder_ddf (Any) – Dask-like collection after pre-filtering.

  • densmaps (Dict[int, ndarray]) – Mapping depth -> densmap counts.

  • keep_cols (List[str]) – Ordered list of columns to keep in tiles.

  • ra_col (str) – Name of the RA column.

  • dec_col (str) – Name of the DEC column.

  • cfg (Any) – Parsed configuration object.

  • out_dir – Output directory for HiPS tiles.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • avoid_computes (bool) – Whether to avoid explicit compute() calls when possible.

  • params (ScoreDensityHybridParams | None) – Resolved score parameters (required).

Return type:

dict[str, dict[str, int]]

Module contents

Hybrid score + density selection mode.

prepare_score_density_hybrid(ddf, cfg, diag_ctx, log_fn, params, persist_ddfs=False, avoid_computes=True)[source]

Restrict to a score window using pre-computed params.

Parameters:
  • ddf (Any) – Dask-like collection with __score__ already attached.

  • cfg (Any) – Parsed configuration object.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • params (ScoreDensityHybridParams) – Resolved score parameters.

  • persist_ddfs (bool) – Whether to persist the filtered DDF.

  • avoid_computes (bool) – Whether to avoid explicit compute() calls when possible.

Returns:

Dask-like collection filtered to the score window with unique IDs attached.

run_score_density_hybrid_selection(remainder_ddf, densmaps, keep_cols, ra_col, dec_col, cfg, out_dir, diag_ctx, log_fn, avoid_computes=True, params=None)[source]

Execute the score_density_hybrid selection.

Parameters:
  • remainder_ddf (Any) – Dask-like collection after pre-filtering.

  • densmaps (Dict[int, ndarray]) – Mapping depth -> densmap counts.

  • keep_cols (List[str]) – Ordered list of columns to keep in tiles.

  • ra_col (str) – Name of the RA column.

  • dec_col (str) – Name of the DEC column.

  • cfg (Any) – Parsed configuration object.

  • out_dir – Output directory for HiPS tiles.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • avoid_computes (bool) – Whether to avoid explicit compute() calls when possible.

  • params (ScoreDensityHybridParams | None) – Resolved score parameters (required).

Return type:

dict[str, dict[str, int]]