hpmcm.cluster module
- class hpmcm.cluster.ClusterData(i_cluster, footprint, sources, orig_cluster=None)[source]
Bases:
objectClass that defines clusters
A cluster is a set of sources within a footprint of adjacent pixels.
- Parameters:
i_cluster (int)
footprint (Footprint)
sources (np.ndarray)
orig_cluster (int | None)
- i_cluster
Cluster ID
- Type:
int
- orig_cluster
Id of the original cluster this cluster was made from
- Type:
int
- sources
Data about the sources in this cluster
- Type:
np.ndarray
- n_src
Number of sources in this cluster
- Type:
int
- n_unique
Number of catalogs contributing sources to this cluster
- Type:
int
- objects
Data about the objects in this cluster
- Type:
list[ObjectData]
- x_cent
X-pixel value of cluster centroid (in WCS used to do matching)
- Type:
float
- y_cent
Y-pixel value of cluster centroid (in WCS used to do matching)
- Type:
float
- rms_dist
RMS distance of sources to the centroid
- Type:
float
- snr_mean
mean signal-to-noise
- Type:
float
- snr_rms
RMS of signal-to-noise
- Type:
float
- dist_2
Distances of sources to the centroid
- Type:
np.ndarray
- addObject(cell_data, mask=None)[source]
Add a new object to this cluster
- Return type:
- Parameters:
cell_data (CellData)
mask (ndarray | None)
- property catalog_id: ndarray
Return the catalog indices for all the sources in the cluster
- extract(cell_data)[source]
Extract the x_pix, y_pix and snr data from the sources in this cluster
- Return type:
None- Parameters:
cell_data (CellData)
- hasRefCatalog(ref_cat_id=0)[source]
Is there a source from the reference catalog
- Return type:
bool- Parameters:
ref_cat_id (int)
- property src_id: ndarray
Return the ids for all the sources in the cluster
- property src_idx: ndarray
Return the indices for all the sources in the cluster
- property x_cluster: ndarray
Return the x-positions of the soures w.r.t. the footprint
- property x_pix: ndarray
Return the x-positions of the soures w.r.t. the WCS
- property y_cluster: ndarray
Return the y-positions of the soures w.r.t. the footprint
- property y_pix: ndarray
Return the x-positions of the soures w.r.t. the WCS
- class hpmcm.cluster.ShearClusterData(i_cluster, footprint, sources, orig_cluster=None, pixel_match_scale=1)[source]
Bases:
ClusterDataSubclass of ClusterData that can compute shear statisitics
- Parameters:
i_cluster (int)
footprint (Footprint)
sources (np.ndarray)
orig_cluster (int | None)
pixel_match_scale (int)
- pixel_match_scale
Number of pixel merged in the original counts map
- Type:
int