smpy.map_mass

smpy.map_mass(data, method='kaiser_squires', coord_system='radec', pixel_scale=None, downsample_factor=None, output_dir='.', output_base_name='smpy_output', g1_col='g1', g2_col='g2', weight_col=None, mode='E', create_snr=False, create_counts_map=False, overlay_counts_map=False, save_fits=False, save_plots=True, print_timing=False, smoothing=None, **kwargs)[source]

Perform mass mapping using the specified method.

This is the main entry point for SMPy mass mapping operations. It provides a simple interface while maintaining access to all underlying functionality.

Parameters:
  • data (str or pathlib.Path) – Path to input FITS file containing shear catalog.

  • method (str, optional) – Mass mapping method to use. Options: ‘kaiser_squires’, ‘aperture_mass’, ‘ks_plus’.

  • coord_system (str, optional) – Coordinate system of input data. Options: ‘radec’, ‘pixel’.

  • pixel_scale (float, optional) – Pixel scale in arcminutes. Required for ‘radec’ coordinate system.

  • downsample_factor (int, optional) – Downsampling factor for pixel coordinates. Required for ‘pixel’ coordinate system.

  • output_dir (str, optional) – Directory to save output files.

  • output_base_name (str, optional) – Base name for output files.

  • g1_col (str, optional) – Column name for first shear component.

  • g2_col (str, optional) – Column name for second shear component.

  • weight_col (str, optional) – Column name for weights. If None, no weights are used.

  • mode (str or list, optional) – Shear mode(s) to compute. Options: ‘E’, ‘B’, or [‘E’, ‘B’].

  • create_snr (bool, optional) – Whether to create signal-to-noise ratio map.

  • create_counts_map (bool, optional) – Whether to create and save a per-pixel counts map PNG.

  • overlay_counts_map (bool, optional) – Whether to overlay per-pixel counts as text on the convergence map plots.

  • save_fits (bool, optional) – Whether to save maps as FITS files.

  • save_plots (bool, optional) – Whether to save mass and SNR plots as PNG files.

  • print_timing (bool, optional) – Whether to print timing information.

  • smoothing (float, optional) – Smoothing scale in pixels. If None, uses method default.

  • **kwargs – Additional method-specific parameters.

Returns:

result – Dictionary containing the computed mass maps.

Return type:

dict

Raises:

Examples

Basic usage with minimal parameters:

>>> result = map_mass(
...     data='catalog.fits',
...     coord_system='radec',
...     pixel_scale=0.168
... )

More advanced usage with custom parameters:

>>> result = map_mass(
...     data='catalog.fits',
...     method='ks_plus',
...     coord_system='radec',
...     pixel_scale=0.168,
...     smoothing=1.5,
...     create_snr=True,
...     mode=['E', 'B']
... )