smpy.coordinates.radec.RADecSystem¶
- class smpy.coordinates.radec.RADecSystem[source]¶
Implementation for RA/Dec celestial coordinates.
Handles celestial coordinates including spherical corrections and appropriate binning for sky projections. Applies coordinate transformations to account for spherical geometry effects.
- __init__()¶
Methods
__init__()calculate_boundaries(coord1, coord2)Calculate field boundaries in RA/Dec space.
create_grid(data_df, boundaries, config)Create shear grid in RA/Dec space.
get_grid_parameters(config)Get RA/Dec specific grid parameters.
prepare_data(data_df)Prepare data for gridding by validating and transforming coordinates.
transform_coordinates(data_df)Transform RA/Dec coordinates by centering and flattening RA.
- get_grid_parameters(config)[source]¶
Get RA/Dec specific grid parameters.
Extract celestial coordinate system parameters including angular resolution for grid spacing.
- Parameters:
config (dict) – Configuration dictionary containing RA/Dec settings.
- Returns:
grid_params – Grid parameters dictionary containing: - resolution_arcmin: Grid spacing in arcminutes
- Return type:
dict
- create_grid(data_df, boundaries, config)[source]¶
Create shear grid in RA/Dec space.
Create a regular grid in celestial coordinates accounting for spherical projection effects and appropriate angular binning.
- Parameters:
data_df (pandas.DataFrame) – DataFrame with scaled coordinates and shear data.
boundaries (dict) – Dictionary with coordinate boundaries.
config (dict) – Configuration dictionary with RA/Dec parameters.
- Returns:
g1_grid (numpy.ndarray) – 2D array containing binned first shear component values.
g2_grid (numpy.ndarray) – 2D array containing binned second shear component values.
- calculate_boundaries(coord1, coord2)[source]¶
Calculate field boundaries in RA/Dec space.
Determine coordinate ranges for celestial coordinates and set up both scaled boundaries (accounting for spherical projection) and true boundaries (preserving original coordinates).
- Parameters:
coord1 (numpy.ndarray) – RA values in degrees.
coord2 (numpy.ndarray) – Dec values in degrees.
- Returns:
scaled_boundaries (dict) – Dictionary with scaled coordinate boundaries accounting for spherical projection effects.
true_boundaries (dict) – Dictionary with original celestial coordinate boundaries.
- transform_coordinates(data_df)[source]¶
Transform RA/Dec coordinates by centering and flattening RA.
Apply coordinate transformations to account for spherical geometry by centering coordinates and flattening RA using cos(Dec) correction.
- Parameters:
data_df (pandas.DataFrame) – DataFrame with coord1(RA), coord2(Dec) columns.
- Returns:
transformed_df – DataFrame with additional scaled coordinates corrected for spherical projection effects.
- Return type:
pandas.DataFrame