SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
sersicprior.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4# EB 24/07/2019
5# Plot the Sérsic prior as defined in the documentation
6
7import numpy as np
8import matplotlib
9matplotlib.rcParams['text.usetex'] = True
10matplotlib.rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}",r"\usepackage{sansmath}", r"\sansmath"]
11matplotlib.rcParams['font.family'] = ['sans-serif']
12matplotlib.rcParams.update({'font.size': 20})
13
14import matplotlib.pyplot as plt
15
16
17f, ax = plt.subplots(1,1, figsize=(12,9), dpi=150)
18plt.subplots_adjust(left=0.08, right=0.99, bottom=0.11, top=0.98, wspace=0.3, hspace=0.4)
19xmin = 0.3
20xmax = 8.0
21npoints = 400
22x = np.linspace(xmin, xmax, npoints)
23s0 = 4
24s2 = np.exp(x - s0)
25y = np.exp(-s2*s2 / 2.0)
26norm = sum(y) * (xmax - xmin) / npoints
27y /= norm
28ax.set_xlim(0, 8.3)
29ax.plot(x,y,linewidth=3)
30ax.set_xlabel("Sérsic index", fontsize=24)
31ax.set_ylabel("prior", fontsize=24)
32ax.grid(linewidth=0.5, linestyle=':')
33plt.savefig("sersicprior.svg")
34plt.savefig("sersicprior.pdf")
35