# Miscentering Effects¶

If galaxy cluster centers are not properly identified on the sky, then quantities measured in annuli around that center will not match theoretical models. This effect is detailed in Johnston et al. (2007) and Yang et al. (2006).

To summarize, if a cluster center is incorrectly identified on the sky by a distance \(R_{\rm mis}\) then the surface mass density becomes:

That is, the average surface mass density at distance \(R\) away from the incorrect center is the average of the circle drawn around that incorrect center. To get the miscentered profiles of a *single cluster* you would use

```
from cluster_toolkit import miscentering
mass = 1e14 #Msun/h
conc = 5 #arbitrary
Omega_m = 0.3
#Calculate Rp and Sigma here, where Sigma is centered
Rmis = 0.25 #Mpc/h; typical value
Sigma_mis_single = miscentering.Sigma_mis_single_at_R(Rp, Rp, Sigma, mass, conc, Omega_m, Rmis)
```

As you can see `Rp`

is passed in twice. It is first used as the location at which to evaluate `Sigma_mis`

and then as the locations at which `Sigma`

is known. So if you wanted those two radial arrays can be different.

The \(\Delta\Sigma\) profile is defined the usual way

which can be calculated using this module using

```
DeltaSigma_mis_single = miscentering.DeltaSigma_mis_at_R(Rp, Rp, Sigma_mis_single)
```

## Stacked Miscentering¶

In a stack of clusters, the amount of miscentering will follow a distribution \(P(R'|R_{\rm mis})\) given some characteristic miscentering length \(R_{\rm mis}\). That is, some clusters will be miscentered more than others. Simet et al. (2017) for SDSS and Melchior et al. (2017) assume a Raleigh distribution for the amount of miscentering \(R'\):

In McClintock et al. (2019) we used a Gamma profile for the mistnering:

Both of these are available in the toolkit. We see that \(R_{\rm mis}\) is a free parameter, giving rise to a miscentered projected stacked density profile:

which can then itself be integrated to get \(\Delta\Sigma_{\rm mis^{\rm stack}}\). To calculate these in the code you would use:

```
from cluster_toolkit import miscentering
#Assume Sigma at R_perp are computed here
Sigma_mis = miscentering.Sigma_mis_at_R(R_perp, R_perp, Sigma, mass, concentration, Omega_m, R_mis)
DeltaSigma_mis = miscentering.DeltaSigma_mis_at_R(R_perp, R_perp, Sigma_mis)
```