Sersic fluxes¶
- galaxy.morphology.analyticFluxFrom0(r: Union[float, numpy.ndarray], n: Union[int, float], re: Union[float, numpy.ndarray], bn: Optional[float] = None, Ie: Optional[float] = None, mag: Optional[float] = None, offset: Optional[float] = None) Dict[str, Union[int, float]] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Analytically compute the integrated flux from 0 up to radius r for a Sersic profile of index n.
Note
If no Ie is given, values for mag and offset must be given instead.
- Parameters
r (float or list[float]) – radius up to which the integral is computed. If a list is given, the position will be computed at each radius in the list.
n (int or float) – Sersic index of the profile
re (float) – half-light radius
bn (float) –
(Optional) bn factor appearing in the Sersic profile defined as
\[2 \gamma(2n, b_n) = \Gamma(2n).\]Ie (float) – (Optional) intensity at half-light radius
mag (float) – (Optional) total magnitude used to compute Ie if not given
offset (float) – (Optional) magnitude offset in the magnitude system used
- Returns
analytical flux from 0 to r (value (value) and its error (err) as the dictionary {‘value’:value, ‘error’:err})
- Return type
dict
- Raises
ValueError – if r is neither int, nor float
- galaxy.morphology.BoverD(r: Union[float, numpy.ndarray], rd: float, rb: float, b1: Optional[float] = None, b4: Optional[float] = None, Ied: Optional[float] = None, Ieb: Optional[float] = None, magD: Optional[float] = None, magB: Optional[float] = None, offsetD: Optional[float] = None, offsetB: Optional[float] = None, noError: bool = False) Union[float, numpy.ndarray] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the ratio of the bulge flux (B) over the disk one (D) for a bulge-disk galaxy up to radius r.
Note
If no Ie is given, values for mag and offset must be given instead.
- Parameters
r (float or list[float]) – radius up to which the integral is computed. If a list is given, the position will be computed at each radius in the list.
rb (float) – half-light radius of the bulge
rd (float) – half-light radius of the disk
b1 (float) –
(Optional) b1 factor appearing in the disk profile defined as
\[2 \gamma(2, b_1) = 1.\]b4 (float) –
(Optional) b4 factor appearing in the disk profile defined as
\[2 \gamma(8, b_4) = 7!.\]Ied (float) – (Optional) intensity of the disk at half-light radius
Ied – (Optional) intensity of the bulge at half-light radius
magD (float) – (Optional) total magnitude of the disk used to compute Ied if not given
magB (float) – (Optional) total magnitude of the bulge used to compute Ieb if not given
noError (bool) – (Optional) whether to not raise an error or not if one of the Ie values could not be computed correctly. If set to True, np.nan is returned.
offsetB (float) – (Optional) magnitude offset in the magnitude system used for the bulge component
offsetD (float) – (Optional) magnitude offset in the magnitude system used for the disk component
- Returns
B/D ratio at all the given positions or np.nan if one of the intensities could not be computed correctly
- Return type
float or list[float]
- galaxy.morphology.BoverT(r: Union[float, numpy.ndarray], rd: float, rb: float, b1: Optional[float] = None, b4: Optional[float] = None, Ied: Optional[float] = None, Ieb: Optional[float] = None, magD: Optional[float] = None, magB: Optional[float] = None, offsetD: Optional[float] = None, offsetB: Optional[float] = None, noError: bool = False) Union[float, numpy.ndarray] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Computes the ratio of the bulge flux (B) over the total one (T=D+B) for a bulge-disk galaxy up to radius r.
Note
If no Ie is given, values for mag and offset must be given instead.
- Parameters
r (float or list[float]) – radius up to which the integral is computed. If a list is given, the position will be computed at each radius in the list.
rb (float) – half-light radius of the bulge
rd (float) – half-light radius of the disk
b1 (float) –
(Optional) b1 factor appearing in the disk profile defined as
\[2 \gamma(2, b_1) = 1.\]b4 (float) –
(Optional) b4 factor appearing in the disk profile defined as
\[2 \gamma(8, b_4) = 7!.\]Ied (float) – (Optional) intensity of the disk at half-light radius
Ied – (Optional) intensity of the bulge at half-light radius
magD (float) – (Optional) total magnitude of the disk used to compute Ied if not given
magB (float) – (Optional) total magnitude of the bulge used to compute Ieb if not given
noError (bool) – (Optional) whether to not raise an error or not if one of the Ie values could not be computed correctly. If set to True, np.nan is returned.
offsetB (float) – (Optional) magnitude offset in the magnitude system used for the bulge component
offsetD (float) – (Optional) magnitude offset in the magnitude system used for the disk component
- Returns
B/T ratio at all the given positions or np.nan if one of the intensities could not be computed correctly
- Return type
float or list[float]
- galaxy.morphology.DoverT(r: Union[float, numpy.ndarray], rd: float, rb: float, b1: Optional[float] = None, b4: Optional[float] = None, Ied: Optional[float] = None, Ieb: Optional[float] = None, magD: Optional[float] = None, magB: Optional[float] = None, offsetD: Optional[float] = None, offsetB: Optional[float] = None) Union[float, numpy.ndarray] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Computes the ratio of the disk flux (D) over the total one (T=D+B) for a bulge-disk galaxy up to radius r.
Note
If no Ie is given, values for mag and offset must be given instead.
- Parameters
r (float or list[float]) – radius up to which the integral is computed. If a list is given, the position will be computed at each radius in the list.
rb (float) – half-light radius of the bulge
rd (float) – half-light radius of the disk
b1 (float) –
(Optional) b1 factor appearing in the disk profile defined as
\[2 \gamma(2, b_1) = 1.\]b4 (float) –
(Optional) b4 factor appearing in the disk profile defined as
\[2 \gamma(8, b_4) = 7!.\]Ied (float) – (Optional) intensity of the disk at half-light radius
Ied – (Optional) intensity of the bulge at half-light radius
magD (float) – (Optional) total magnitude of the disk used to compute Ied if not given
magB (float) – (Optional) total magnitude of the bulge used to compute Ieb if not given
noError (bool) – (Optional) whether to not raise an error or not if one of the Ie values could not be computed correctly. If set to True, np.nan is returned.
offsetB (float) – (Optional) magnitude offset in the magnitude system used for the bulge component
offsetD (float) – (Optional) magnitude offset in the magnitude system used for the disk component
- Returns
D/T ratio at all the given positions or np.nan if one of the intensities could not be computed correctly
- Return type
float or list[float]
- galaxy.morphology.fluxSersic(r: Union[float, numpy.ndarray], n: Union[int, float], re: float, bn: Optional[float] = None, Ie: Optional[float] = None, mag: Optional[float] = None, offset: Optional[float] = None, start: float = 0.0) Dict[str, float] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the flux of a single Sersic profile of index n up to radius r using raw integration.
Note
If no Ie is given, values for mag and offset must be given instead.
- Parameters
r (float or list[float]) – radius up to which the integral is computed. If a list is given, the position will be computed at each radius in the list.
n (int or float) – Sersic index of the profile
re (float) – half-light radius
bn (float) –
(Optional) bn factor appearing in the Sersic profile defined as
\[2 \gamma(2n, b_n) = \Gamma(2n).\]Ie (float) – (Optional) intensity at half-light radius
mag (float) – (Optional) total magnitude used to compute Ie if not given
offset (float) – (Optional) magnitude offset in the magnitude system used
start (float) – (Optional) starting point of the integration
- Returns
integrated flux up to radius r (value) and an estimation of its absolute error (err) as the dictionary {‘value’:value, ‘error’:err}
- Return type
dict
- galaxy.morphology.fluxSersics(r: Union[float, numpy.ndarray], listn: List[Union[int, float]], listRe: List[float], listbn: Optional[List[float]] = None, listIe: Optional[List[float]] = None, listMag: Optional[List[float]] = None, listOffset: Optional[List[float]] = None, analytical: bool = False) Dict[str, float] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the flux of a sum of Sersic profiles up to radius r (starting from 0).
- Parameters
r (float or list[float]) – position at which the profiles are integrated. If a list if given, the position will be computed at each radius in the list.
listn (list[int] or list[float]) – list of Sersic index for each profile
listRe (list[float]) – list of half-light radii for each profile
analytical (bool) – (Optional) whether to use the analytical solution or integrate the profile
listbn (list[float]) – (Optional) list of bn factors appearing in Sersic profiles
listIe (list[float]) – (Optional) list of intensities at re for each profile
listMag (list[float]) – (Optional) list of total integrated magnitudes for each profile
listOffset (list[float]) – (Optional) list of magnitude offsets used in the magnitude system for each profile
- Returns
integrated flux of the sum of all the given Sersic profiles (value) and an estimation of the error (err) as the dictionary {‘value’:value, ‘error’err}
- Return type
dict
- Raises
ValueError – if listIe and listMag and listOffset are None
- galaxy.morphology.ratioFlux1D(r1: float, r2: float, listn: List[Union[int, float]], listRe: List[float], listbn: Optional[List[float]] = None, listIe: Optional[List[float]] = None, listMag: Optional[List[float]] = None, listOffset: Optional[List[float]] = None, analytical: bool = True) float [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the ratio of the flux of the sum of different Sersic profiles for a single galaxy at two different positions in the galaxy plane only.
This function computes the ratio from the 1D profiles, either integrating (analytical=False) or via an analytical solution (analytical=True).
Note
How to use
Easiest way is to provide two radii for r1 and r2, and then lists of Sersic profiles parameters.
For instance, a ratio at radii 1” and 3” for a disk (n=1, Re=10”) + bulge (n=4, Re=20”) decomposition would give something like
>>> ratioFlux1D(1, 3, [1, 4], [10, 20], listMag=[25, 30], listOffset=[30, 30])
Radii should be given with the same unit as the effective radii.
- Parameters
r1 (float) – first radius where the flux is computed
r2 (float) – second radius where the flux is computed
listn (list[int] or list[float]) – list of Sersic index for each profile
listRe (list[float]) – list of half-light radii for each profile
analytical (bool) – (Optional) whether to use the analytical solution or integrate the profile
listbn (list[float]) – (Optional) list of bn factors appearing in Sersic profiles
listIe (list[float]) – (Optional) list of intensities at re for each profile
listMag (list[float]) – (Optional) list of total integrated magnitudes for each profile
listOffset (list[float]) – (Optional) list of magnitude offsets used in the magnitude system for each profile
- Returns
ratio of fluxes at the two different positions
- Return type
float
- Raises
ValueError –
if listIe and listMag and listOffset are None
if the 2nd computed flux is 0
- galaxy.morphology.ratioFlux2D(r1: float, r2: float, Rd: float, Rb: float, where: List[str] = ['galaxy', 'galaxy'], noPSF: List[bool] = [False, False], Id: Optional[float] = None, Ib: Optional[float] = None, magD: Optional[float] = None, magB: Optional[float] = None, offsetD: Optional[float] = None, offsetB: Optional[float] = None, inclination: Union[int, float] = 0.0, PA: Union[int, float] = 0.0, arcsecToGrid: float = 0.03, fineSampling: int = 81, PSF: Dict = {'FWHMX': 0.8, 'FWHMY': 0.8, 'name': 'Gaussian2D', 'sigmaX': None, 'sigmaY': None, 'unit': 'arcsec'}, verbose: bool = True) float [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the ratio of the flux of a bulge+disk model between two radii either in the galaxy plane or in the sky plane. This function computes the ratio from 2D models (projected on the sky plane or not) with or without PSF convolution.
Note
How to use
Easiest way is to provide two radii for r1 and r2, and then lists of Sersic profiles parameters.
For instance, a ratio for a radius of 1 pixel (in galaxy plane) over 3 pixels (in sky plane) for a disk (n=1, Re=10 pixels, inclination=23°, PA=40°) + bulge (n=4, Re=20 pixels) decomposition would give something like
>>> ratioFlux2D(1, 3, 10, 20, magD=25, magB=30, offsetD=30, offsetB=30, inclination=23, PA=40, where=['galaxy', 'sky']})
- galaxy.morphology.total_flux(mag: Union[float, List[float], numpy.ndarray], offset: Union[float, List[float], numpy.ndarray]) Union[float, numpy.ndarray] [source]¶
Code author: Wilfried Mercier - IRAP <wilfried.mercier@irap.omp.eu>
Compute the integrated flux up to infinity. The flux and magnitude are related by the equation
\[m = -2.5 \log_{10} F_{\rm{tot}} + \rm{offset}\]- Parameters
offset (float or list[float] or ndarray[float]) – magnitude offset
mag (float or list[float] or ndarray[float]) – total magnitude
- Returns
total flux
- Return type
float or ndarray[float]