Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

KinematicLensing/BinnedFit

Repository files navigation

BinnedFit

A fitting pipeline to extract gravational lensing signals utilizing galaxy's morphology (photometric) and kinematic (spectroscopic) information. The theoritical formalism of this kinematic lensing idea is presented in arXiv:1311.1489.

Requirements

This package depends on the following Python libraries:

Overview of this repository

  1. The galaxy slit spectra data are stored in the data class Spec2D defined in spec2D.py. Spec2D provides many useful methods to display the spectra data, and to easily overplot data with model for visualization. This notebook demonstrates how Spec2D works.

  2. Models to fit galaxy images are managed by the ImageFit class defined in imageFit.py. A demo for fitting a galaxy image with ImageFit is available at this notebook.

  3. A simple strategy to model the galaxy slit spectrum is to fit a single Gaussian profile $G_i$($\lambda$ | $A_i$, $\sigma_i$, $\mu_i$) = $\frac{A_i}{2 \pi \sigma_i^2}$ exp($\frac{-(\lambda-\mu_i)^2}{2 \sigma_i^2}$) across each positional bin $i$ of a slit spectrum. The best-fitted $\mu_i$ specifies the peak $\lambda$ value of bin $i$, and $\sigma_i$ is the 1$\sigma$ scatter of line width at bin $i$. This positional Gaussian-fit procedure is managed by the GaussFit class defined in gaussFit.py. For a spectral data array with $N$ position bins, GaussFit essentially uses a total of 3$\times$$N$ degrees of freedom to model the spectrum array ($A_1$, $A_2$, ... $A_N$), ($\sigma_1$, $\sigma_2$, ... $\sigma_N$), ($\mu_1$, $\mu_2$, ... $\mu_N$).

    We also have the GaussFitDouble class to handle doublet emission lines with double Gaussian profiles. An example notebook for the usage of GaussFit and GaussFitDouble is available here.

  4. Typically, the rotation curve from an observed galaxy slit spectrum can be well-described via an arctan function. We can then use this contraint to decrease the degrees of freedom (d.o.f) used in GaussFit to model the spectra. i.e. replacing the d.o.f. provided in ($\mu_1$, $\mu_2$, ... $\mu_N$) with few parameters that specify an arctan rotaion curve. This d.o.f reduced model is coded up in the RotFitSingle and RotFitDouble classes (for siglet and doublet emission lines respectively) in rotCurveFit.py. This is essentially how binnedFit deals with the spectra data. This notebook demonstrates how to apply RotFitSingle and RotFitDouble on mock data.

  5. Finally, connecting all the above modeling pieces together to perform parameter inferences on galaxy image+spectra data, we have the GammaInference class defined in gamma.py to manage the overall MCMC sampling process. An example tutorial on how to run the fitting pipeline is demonstrated in this notebook.

  6. To analyze the MCMC chains generated from the output of GammaInference, one can find methods provided in the ChainTool class written in chainTool.py. Check this notebook for the usage of ChainTool, and this notebook for displaying multiple chains.

About

kinematic lensing modeling

Resources

Stars

0 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors