hipscatalog_gen.mag_global package

Submodules

hipscatalog_gen.mag_global.pipeline module

Pipeline steps for magnitude-complete selection.

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

Add __mag__ column and compute selection window without mutating cfg.

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

  • 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_mag, MagGlobalParams).

Raises:
  • ValueError – When magnitude/flux configuration is invalid or missing.

  • KeyError – If configured magnitude/flux columns are not present.

Return type:

tuple[Any, MagGlobalParams]

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

Restrict to the configured magnitude window using pre-computed params.

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

  • cfg (Any) – Parsed configuration object.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • params (MagGlobalParams) – Resolved magnitude 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 magnitude window.

run_mag_global_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 mag_global selection path and write tiles.

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 (MagGlobalParams | None) – Optional resolved magnitude parameters (auto-resolved when None).

Return type:

dict[str, dict[str, int]]

Module contents

Magnitude-complete selection mode.

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

Add __mag__ column and compute selection window without mutating cfg.

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

  • 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_mag, MagGlobalParams).

Raises:
  • ValueError – When magnitude/flux configuration is invalid or missing.

  • KeyError – If configured magnitude/flux columns are not present.

Return type:

tuple[Any, MagGlobalParams]

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

Restrict to the configured magnitude window using pre-computed params.

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

  • cfg (Any) – Parsed configuration object.

  • diag_ctx – Diagnostics context factory.

  • log_fn – Logging callback.

  • params (MagGlobalParams) – Resolved magnitude 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 magnitude window.

run_mag_global_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 mag_global selection path and write tiles.

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 (MagGlobalParams | None) – Optional resolved magnitude parameters (auto-resolved when None).

Return type:

dict[str, dict[str, int]]