sp_validation.survey

SURVEY.

Description:

This file contains methods to deal with the survey geometry. Some methods are UNIONS-/CFIS-specific.

Author:

Martin Kilbinger <martin.kilbinger@cea.fr>

get_area(dd, area_tile, verbose=False)[source]

Get area.

Return total survey area. This ignores masking as well as overlaps between tiles, and provides therefore an overestimation. of the actual observed area.

Parameters:
  • dd (numpy.ndarray) – galaxy catalog

  • area_tile (float) – area per tile in square degree

  • verbose (bool, optional) – verbose output if True, default is False

Returns:

  • float – area in square degrees

  • float – area in square arc minutes

  • list of float – tile IDs

missing_tiles(tile_IDs, path_tile_ID, path_found_ID, path_missing_ID, verbose=False)[source]

Missing tiles.

Compute completeness, and identify missing tiles.

Parameters:
  • tile_IDs (list of string) – input tile IDs in catalogue

  • path_tile_ID (string) – input tile ID path to match

  • path_found_ID (string) – output found tile ID path

  • path_missing_ID (string) – output missing tile ID path

  • verbose (bool) – verbose output if True

Returns:

  • int – number of tiles found, -1 if ID file path not found

  • int – number of tiles missing, -1 if ID file path not found

write_tile_id_gal_counts(detection_IDs, galaxy_IDs, shape_IDs, fname)[source]

Write Tile ID Galaxy Counts.

Write number of galaxies per tile ID to file.

Parameters:
  • detection_IDs (list) – input tile ID for each detected object

  • galaxy_IDs (list) – input tile ID for each selected galaxy

  • shape_IDs (list) – input tile ID for each galaxy with measured shape

  • fname (str) – output file name

get_footprint(patch, ra, dec)[source]

Get Footprint.

Return coordinates within footprint of patch.

Parameters:
  • patch (str) – patch name

  • ra (array of float) – R,A, coordintates

  • dec (array of float) – DEC coordinates

Returns:

list of coordinates withint footprint

Return type:

list of float

area_from_coords(ra, dec, nside)[source]

Survey area from galaxy coordinates via HEALPix pixel counting.

Bins the galaxy positions onto a HEALPix grid at resolution nside and sums the area of every occupied pixel. This ignores partial-pixel coverage and so overestimates the true observed area, but needs no external mask.

Parameters:
  • ra (array of float) – Right-ascension coordinates in degrees.

  • dec (array of float) – Declination coordinates in degrees.

  • nside (int) – HEALPix resolution parameter.

Returns:

Area in square degrees.

Return type:

float

n_eff_density(w, area_deg2)[source]

Effective galaxy number density per square arcminute.

Uses the weighted definition n_eff = (Σw)² / (A · Σw²) where A is the survey area in square arcminutes (area_deg2 · 3600). Returns 0.0 when Σw² == 0 to avoid division by zero.

Parameters:
  • w (array of float) – Per-galaxy weights.

  • area_deg2 (float) – Survey area in square degrees.

Returns:

Effective number density in galaxies per square arcminute.

Return type:

float

ellipticity_dispersion(e1, e2, w)[source]

Per-component weighted ellipticity dispersion.

Computes sqrt(0.5 · (⟨e1²⟩ + ⟨e2²⟩)) where each component average is weighted by . This is the per-component RMS convention; it differs by a factor √2 from the summed-component sigma_e returned by effective_survey_stats(). Keep the two conventions distinct.

Parameters:
  • e1 (array of float) – Ellipticity components.

  • e2 (array of float) – Ellipticity components.

  • w (array of float) – Per-galaxy weights.

Returns:

Per-component ellipticity dispersion.

Return type:

float

additive_bias(e1, e2, w, R)[source]

Weighted additive-bias estimates (c1, c2).

Returns the weighted mean of the response-corrected ellipticities ⟨e1 / R⟩ and ⟨e2 / R⟩, weighted by w.

Parameters:
  • e1 (array of float) – Ellipticity components (before response correction).

  • e2 (array of float) – Ellipticity components (before response correction).

  • w (array of float) – Per-galaxy weights.

  • R (float) – Multiplicative shear response.

Returns:

(c1, c2) additive-bias estimates.

Return type:

tuple of float

effective_survey_stats(e1, e2, w, area_deg2)[source]

Effective survey statistics for a shear catalogue.

Bundles the area-dependent number density and the summed-component shape noise. Here sigma_e = sqrt(Σ[w²(e1² + e2²)] / Σw²) sums over both components (no 0.5 factor); this is distinct from the per-component ellipticity_dispersion(), differing by a factor √2.

Parameters:
  • e1 (array of float) – Ellipticity components.

  • e2 (array of float) – Ellipticity components.

  • w (array of float) – Per-galaxy weights.

  • area_deg2 (float) – Survey area in square degrees.

Returns:

Keys n_eff, sigma_e, sum_w, sum_w2.

Return type:

dict