yaw.catalog.patch.Patch#
- class yaw.catalog.patch.Patch(cache_path: Path | str, center: AngularCoordinates | None = None)[source]#
Bases:
HandlesDataChunkA single spatial patch of catalog data.
Data has point coordinates and optionally weights and redshifts. This data is cached on disk in a binary file (
data.bin) that is read when accessing any of the classes data attributes. Additionaly meta data, such as the patch center and radius, that describe the spatial distribution of the contained data points, are availble and stored as YAML file (meta.yml)The cached data is organised in a single directory as follows:
[cache_path]/ ├╴ data.bin ├╴ meta.yml ├╴ binning (created by trees.BinnedTrees) └╴ trees.pkl (created by trees.BinnedTrees)
Supports efficient pickeling as long as the cached data is not deleted or moved.
Methods
__init__(cache_path[, center])copy_chunk_info(*[, drop_patch_ids])Copy the data attribute information.
Load the cached object data with coordinates and optional weights and redshifts.
Attributes
Patch meta data; number of records stored in the patch, the sum of weights, and distribution of objects on sky through the center point and containing radius.
Directory where (meta) data is cached.
Coordinates in right ascension and declination, in radian.
Path to binary file with patch data.
Whether this data source provides kappa (or any scalar values).
Patches never provide patch IDs.
Whether this data source provides redshifts.
Whether this data source provides weights.
Kappa or
Noneif there are no kappa.Redshifts or
Noneif there are no redshifts.Weights or
Noneif there are no weights.- cache_path: Path#
Directory where (meta) data is cached.
- property coords: AngularCoordinates#
Coordinates in right ascension and declination, in radian.
- copy_chunk_info(*, drop_patch_ids: bool = False) DataChunkInfo#
Copy the data attribute information.
- property data_path: Path#
Path to binary file with patch data.
- property has_kappa: bool#
Whether this data source provides kappa (or any scalar values).
- property has_patch_ids: Literal[False]#
Patches never provide patch IDs.
- property has_redshifts: bool#
Whether this data source provides redshifts.
- property has_weights: bool#
Whether this data source provides weights.
- property kappa: NDArray | None#
Kappa or
Noneif there are no kappa.
- load_data() TypeDataChunk[source]#
Load the cached object data with coordinates and optional weights and redshifts.
- Returns:
A numpy array with composite data type. The fields represent the different data columns and can be
ra,dec,weights, andredshifts, where the latter two are optional.
- meta: Metadata#
Patch meta data; number of records stored in the patch, the sum of weights, and distribution of objects on sky through the center point and containing radius.
- property redshifts: NDArray | None#
Redshifts or
Noneif there are no redshifts.
- property weights: NDArray | None#
Weights or
Noneif there are no weights.