autolens.twins.transform.ReplaceTotalMassWithStellarPlusDark#
- class ReplaceTotalMassWithStellarPlusDark[source]#
Bases:
objectReplace the total-mass profile(s) of one galaxy by stellar mass following its MGE light plus a dark-matter halo, keeping the replaced galaxy’s projected mass inside theta_E,parent (the one deliberate preservation, recorded in
preserved).apply(twin)returns(tracer, setup, record)and mutates nothing:every
MassProfileattribute of the galaxy that is not light and not anExternalShear(e.g. itsIsothermal) is removed;the light basis attribute
lightis replaced by the stellarBasisoflmp.Gaussianthatag.MassBudgetsolves. Its members copy the centre,ell_comps,sigmaand intensity of the light Gaussians, so the galaxy’s light is unchanged and its stellar mass isUpsilontimes that light. (Adding the stellar basis beside the light basis would count the light twice.)the dark profile is added as the attribute
dark_name, centred on the light;external shear (galaxy attribute or tracer field), the source and all other galaxies are unchanged (
keep_shear=Falseremoves the replaced galaxy’sExternalShearattributes and the tracer’sExternalShearfields).
The aperture is
einstein_radius_aperture_from(tracer, setup.grid, centre): the whole parent tracer’s Einstein radius, centred on the replaced mass centre.- Parameters:
galaxy (
str) – The galaxy to transform: its name in the tracer (the key of the fit’saf.Collection, e.g."lens", or"galaxy_<index>"for a tracer built from a list), or a role from the reference’s provenanceroles.light (
str) – The name of the galaxy’s MGE light attribute: aBasisof solved-intensitylp.Gaussianprofiles (linear, operated or non-Gaussian members raiseProfileException: they have nolmp.Gaussiancounterpart).scale_radius_kpc (
float) – The fixed dark-profile scale radius, in kpc (ruling R4). It is converted to arc-seconds withcosmology.arcsec_per_kpc_from(redshift=galaxy.redshift), the cosmology being the setup’s, or the tracer’s when the setup has none.f_dark (
float) – The dark fraction of the replaced mass inside theta_E,parent (stellar fraction1 - f_dark). Ignored whenbudgetis given.budget (
Union[MassBudget,Dict[str,Dict[str,float]],None]) – Alternatively anag.MassBudgetor itsfractionsdictionary,{galaxy: {"stellar": f_*, "dark": f_dark}}; only its fractions are used (the aperture is always the Einstein-radius aperture). A budget naming more than one galaxy raisesNotImplementedError(ruling R7).dark_cls – The dark profile class;
al.mp.NFWSphby default, or e.g.al.mp.gNFWSphwithinner_slopepassed indark_fixed.keep_shear (
bool) – Keep the external shear (default). It never enters M_ref.aperture_settings (
Optional[Dict]) –sub_size_interior,sub_size_edge,sub_size_centreandcentre_refine_pixelsof the aperture integrator (defaults: those ofag.CircularAperture). AgNFWconvergence does onequadper point, so pass coarse sub-sizes for it (e.g. 2, 4, 4).einstein_radius_pixel_scale (
float) – The resolution of the grid on which the critical curve, and so theta_E, is traced.grid (
Optional[Grid2D]) – The uniform grid on which aperture masses are integrated; defaults to the setup mask’s full (unmasked) geometry. The aperture must lie within it.dark_name (
str) – The galaxy attribute the dark profile is stored as.dark_fixed – Further fixed constructor arguments of
dark_cls, e.g.inner_slope.
Methods
Attributes