hpmcm.wcs_match module
- class hpmcm.wcs_match.WcsMatch(match_wcs, **kwargs)[source]
Bases:
MatchClass to do N-way matching using a provided WCS.
This uses the provided WCS to define a Skymap that covers the full region begin matched.
Notes
This expectes a list of parquet files with pandas DataFrames that contain the following columns.
Column name
Description
id
source ID
ra
RA in degrees
dec
DEC in degress
snr
Signal-to-Noise of source, used for filtering and centroiding
- Parameters:
match_wcs (wcs.WCS)
kwargs (Any)
- classmethod create(ref_dir, region_size, pixel_size, **kwargs)[source]
Helper function to create a Match object.
This will use the provided arguments to create a WCS, and then create and return a WcsMatch matcher.
- Return type:
- Parameters:
ref_dir (tuple[float, float]) – Reference Direction (RA, DEC) in degrees
region_size (tuple[float, float]) – Size of match region, in degrees
pix_size – Pixel size in degrees
pixel_size (float)
kwargs (Any)
- Return type:
Object to create matches for the requested region
- pixToWorld(x_pix, y_pix)[source]
Convert local coords in pixels to world coordinates (RA, DEC)
- Return type:
tuple[ndarray,ndarray]- Parameters:
x_pix (ndarray)
y_pix (ndarray)
- reduceDataFrame(df)[source]
Reduce a single input DataFrame
- Return type:
DataFrame- Parameters:
df (DataFrame)
Notes
This applies a trivial cut on signal-to-noise (snr>1). and adds the pixel coordinates to the DataFrame.
This will add these columns to the output dataframes
Column
Description
id
Index of object inside catalog
ra
Source RA
dec
Source DEC
x_pix
X-coordinate in global WCS frame
y_pix
Y-coordinate in global WCS frame
snr
Signal-to-noise ratio
- hpmcm.wcs_match.createGlobalWcs(ref_dir, pix_size, n_pix)[source]
Helper function to create the WCS used to project the sources in a skymap
- Return type:
WCS- Parameters:
ref_dir (tuple[float, float]) – Reference Direction (RA, DEC) in degrees
pix_size (float) – Pixel size in degrees
n_pix (ndarray) – Number of pixels in x, y
- Return type:
WCS to create the pixel grid