Shape Profiling
Classes for Shape Profiling
The shape_profs_classes
module defines the DensShapeProfs
and DensShapeProfsGadget
classes that provide shape profiling capabilities. They inherit from the DensShapeProfsBase
class (not relevant for the user). In addition to shape profiling, they also provide an interface to density profiling, including ellipsoidal shell-based density profiling.
- class shape_profs.shape_profs_classes.DensShapeProfs[source]
Bases:
DensShapeProfsBase
Class for density profile calculations
Its public methods are the same as those of
DensShapeProfsBase
:getShapeCatLocal()
,getShapeCatGlobal()
,vizLocalShapes()
,vizGlobalShapes()
,plotGlobalEpsHist()
,plotLocalEpsHist()
,plotGlobalTHist()
,plotLocalTHist()
,dumpShapeCatLocal()
,dumpShapeCatGlobal()
,getR200()
,getIdxCat()
,getXYZMasses()
,getMassesCenters()
,_getMassesCenters()
,estDensProfs()
,fitDensProfs()
,estConcentrations()
,plotDensProfs()
,getObjInfo()
- Parameters
xyz ((N2,3) floats, N2 >> N1) – positions of all simulation particles in config.InUnitLength_in_cm
masses ((N2,) floats) – masses of all simulation particles in config.InUnitMass_in_g
idx_cat (list of length N1) – each entry of the list is a list containing indices of particles belonging to an object
r200 ((N1,) floats) – R_200 radii of the parent halos in config.InUnitLength_in_cm
L_BOX (float) – simulation box side length in config.InUnitLength_in_cm
SNAP (string) – snapshot identifier, e.g. ‘024’
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
- __init__()[source]
- Parameters
xyz ((N2,3) floats, N2 >> N1) – positions of all simulation particles in config.InUnitLength_in_cm
masses ((N2,) floats) – masses of all simulation particles in config.InUnitMass_in_g
idx_cat (list of length N1) – each entry of the list is a list containing indices of particles belonging to an object
r200 ((N1,) floats) – R_200 radii of the parent halos in config.InUnitLength_in_cm
L_BOX (float) – simulation box side length in config.InUnitLength_in_cm
SNAP (string) – snapshot identifier, e.g. ‘024’
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
- class shape_profs.shape_profs_classes.DensShapeProfsBase[source]
Bases:
DensProfsBase
Class for density profile and shape profile calculations
Its public methods are
getShapeCatLocal()
,getShapeCatGlobal()
,vizLocalShapes()
,vizGlobalShapes()
,plotGlobalEpsHist()
,plotLocalEpsHist()
,plotGlobalTHist()
,plotLocalTHist()
,dumpShapeCatLocal()
,dumpShapeCatGlobal()
and those ofDensProfsBase
: getR200()`,getIdxCat()
,getXYZMasses()
,getMassesCenters()
,_getMassesCenters()
,estDensProfs()
,fitDensProfs()
,estConcentrations()
,plotDensProfs()
,getObjInfo()
.- Parameters
xyz ((N2,3) floats, N2 >> N1) – positions of all simulation particles in Mpc/h (internal length units)
masses ((N2,) floats) – masses of all simulation particles in 10^10*M_sun/h (internal mass units)
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
r200 ((N1,) floats) – R_200 radii of the parent halos in Mpc/h (internal length units)
obj_size ((N1,) integers) – indicates how many particles are in each object
SNAP (string) – snapshot identifier, e.g. ‘024’
L_BOX (float) – simulation box side length in Mpc/h (internal length units)
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
SUFFIX (string) – either ‘_dm_’ or ‘_gx_’ or ‘_’ (latter for CosmicProfsDirect)
- __init__()[source]
- Parameters
xyz ((N2,3) floats, N2 >> N1) – positions of all simulation particles in Mpc/h (internal length units)
masses ((N2,) floats) – masses of all simulation particles in 10^10*M_sun/h (internal mass units)
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
r200 ((N1,) floats) – R_200 radii of the parent halos in Mpc/h (internal length units)
obj_size ((N1,) integers) – indicates how many particles are in each object
SNAP (string) – snapshot identifier, e.g. ‘024’
L_BOX (float) – simulation box side length in Mpc/h (internal length units)
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
SUFFIX (string) – either ‘_dm_’ or ‘_gx_’ or ‘_’ (latter for CosmicProfsDirect)
- dumpShapeCatGlobal()[source]
Dumps all relevant global shape data into
CAT_DEST
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- dumpShapeCatLocal()[source]
Dumps all relevant local shape data into
CAT_DEST
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- getShapeCatGlobal()[source]
Get all relevant global shape data
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- Returns
d in units of config.OutUnitLength_in_cm, q, s, minor, inter, major, obj_centers in units of config.OutUnitLength_in_cm, obj_masses in units of config.OutUnitMass_in_g
- Return type
structured array, containing 3 x (number_of_objs,) double arrays, 3 x (number_of_objs, 3) double arrays
- getShapeCatLocal()[source]
Get all relevant local shape data
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- Returns
d in units of config.OutUnitLength_in_cm, q, s, minor, inter, major, obj_centers in units of config.OutUnitLength_in_cm, obj_masses in units of config.OutUnitMass_in_g
- Return type
structured array, containing 3 x (number_of_objs, r_res) double arrays, 3 x (number_of_objs, r_res, 3) double arrays
- plotGlobalEpsHist()[source]
Plot global ellipticity histogram
- Parameters
HIST_NB_BINS (int) – number of histogram bins
obj_numbers (list of int) – list of object indices of interest
- plotGlobalTHist()[source]
Plot global triaxiality histogram
- Parameters
katz_dubinski_config (dictionary) – dictionary with parameters to the Katz-Dubinski algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
HIST_NB_BINS (int) – number of histogram bins
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- plotLocalEpsHist()[source]
Plot local ellipticity histogram at depth
frac_r200
- Parameters
frac_r200 (float) – depth of objects to plot ellipticity, in units of R200
HIST_NB_BINS (int) – number of histogram bins
obj_numbers (list of int) – list of object indices of interest
- plotLocalTHist()[source]
Plot local triaxiality histogram at depth
frac_r200
- Parameters
HIST_NB_BINS (int) – number of histogram bins
frac_r200 (float) – depth of objects to plot triaxiality, in units of R200
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- plotShapeProfs()[source]
Draws shape profiles, also mass bin-decomposed ones
- Parameters
nb_bins (int) – Number of mass bins to plot density profiles for
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- vizGlobalShapes()[source]
Visualize global shape of objects with numbers
obj_numbers
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- vizLocalShapes()[source]
Visualize local shape of objects with numbers
obj_numbers
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- class shape_profs.shape_profs_classes.DensShapeProfsGadget[source]
Bases:
DensShapeProfsBase
Class for density profile and shape profile calculations for Gadget-style HDF5 data
Its public methods are
getShapeCatVelLocal()
,getShapeCatVelGlobal()
,dumpShapeVelCatLocal()
,dumpShapeVelCatGlobal()
,getXYZMasses()
,_getXYZMasses()
,getVelXYZ()
,_getVelXYZ()
,getObjInfoGadget()
,getHeader()``and those of ``DensShapeProfsBase
:getShapeCatLocal()
,getShapeCatGlobal()
,vizLocalShapes()
,vizGlobalShapes()
,plotGlobalEpsHist()
,plotLocalEpsHist()
,plotGlobalTHist()
,plotLocalTHist()
,dumpShapeCatLocal()
,dumpShapeCatGlobal()
,getR200()
,getIdxCat()
,getXYZMasses()
,getMassesCenters()
,_getMassesCenters()
,estDensProfs()
,fitDensProfs()
,estConcentrations()
,plotDensProfs()
,getObjInfo()
.- Parameters
SNAP_DEST (string) – where we can find the snapshot
GROUP_DEST (string) – where we can find the group files
OBJ_TYPE (str) – which simulation particles to consider, ‘dm’, ‘gas’ or ‘stars’
SNAP (string) – snapshot identifier, e.g. ‘024’
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
RVIR_OR_R200 (str) – ‘Rvir’ if we want quantities (e.g. r_over_r200) to be expressed with respect to the virial radius R_vir, ‘R200’ for the overdensity radius R_200
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
- __init__()[source]
- Parameters
SNAP_DEST (string) – where we can find the snapshot
GROUP_DEST (string) – where we can find the group files
OBJ_TYPE (str) – which simulation particles to consider, ‘dm’, ‘gas’ or ‘stars’
SNAP (string) – snapshot identifier, e.g. ‘024’
VIZ_DEST (string) – visualization folder
CAT_DEST (string) – catalogue destination
RVIR_OR_R200 (str) – ‘Rvir’ if we want quantities (e.g. r_over_r200) to be expressed with respect to the virial radius R_vir, ‘R200’ for the overdensity radius R_200
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
- dumpShapeVelCatGlobal()[source]
Dumps all relevant global velocity shape data into
CAT_DEST
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- dumpShapeVelCatLocal()[source]
Dumps all relevant local velocity shape data into
CAT_DEST
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- getIdxCat()[source]
Fetch catalogue
- Return idx_cat
contains indices of particles belonging to an object, obj_size: number of particles in each object
- Return type
(N3) integers and (N1,) integers
- getR200()[source]
Fetch R200 values
- Return obj_r200
R200 value of parent halos in config.OutUnitLength_in_cm
- Return type
(N1,) floats
- getShapeCatVelGlobal()[source]
Get all relevant global velocity shape data
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- Returns
d in units of config.OutUnitLength_in_cm, q, s, minor, inter, major, obj_centers in units of config.OutUnitLength_in_cm, obj_masses in units of config.OutUnitMass_in_g
- Return type
structured array, containing 3 x (number_of_objs,) double arrays, 3 x (number_of_objs, 3) double arrays
- getShapeCatVelLocal()[source]
Get all relevant local velocity shape data
- Parameters
obj_numbers (list of int) – list of object indices of interest
katz_config (dictionary) – dictionary with parameters to the Katz algorithm, with fields ‘ROverR200’, ‘IT_TOL’, ‘IT_WALL’, ‘IT_MIN’, ‘REDUCED’, ‘SHELL_BASED’
- Returns
d in units of config.OutUnitLength_in_cm, q, s, minor, inter, major, obj_centers in units of config.OutUnitLength_in_cm, obj_masses in units of config.OutUnitMass_in_g
- Return type
structured array, containing 3 x (number_of_objs, r_res) double arrays, 3 x (number_of_objs, r_res, 3) double arrays
Shape profile estimation algorithms
The shape_profs_algos
module contains the enclosed ellipsoid-based and the ellipsoidal shell-based shape estimation iteration algorithms.
- shape_profs.shape_profs_algos.calcMorphGlobal(double[:, :] xyz, double[:] masses, double[:] r200, int[:] idx_cat, int[:] obj_size, double L_BOX, double IT_TOL, int IT_WALL, int IT_MIN, unicode CENTER, double SAFE, bool reduced)[source]
Calculates the overall shape catalogue
Calls
calcObjMorphGlobal()
in a parallelized manner.Calculates the overall axis ratios and eigenframe for each object.
- Parameters
xyz ((N2 x 3) floats) – positions of all (DM or star) particles in simulation box
masses ((N2 x 1) floats) – masses of the particles expressed in unit mass
r200 ((N1,) floats) – R_200 radii of the parent halos
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
IT_TOL (float) – convergence tolerance, eigenvalue fractions must differ by less than
IT_TOL
for iteration to stopIT_WALL (float) – maximum permissible number of iterations
IT_MIN (int) – minimum number of particles (DM or star particle) in any iteration; if undercut, shape is unclassified
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
SAFE (float) – ellipsoidal radius will be maxdist(COM,point)+SAFE where point is any point in the point cloud. The larger the better.
reduced (boolean) – whether or not reduced shape tensor (1/r^2 factor)
- Returns
d, q, s, eigframe, centers, masses
- Return type
(N3,) floats (for d, q, s, eigframe (x3)), (N3, 3) floats (for centers), (N3,) floats (for masses)
- shape_profs.shape_profs_algos.calcMorphGlobalVelDisp(double[:, :] xyz, double[:, :] vxyz, double[:] masses, double[:] r200, int[:] idx_cat, int[:] obj_size, double L_BOX, double IT_TOL, int IT_WALL, int IT_MIN, unicode CENTER, double SAFE, bool reduced)[source]
Calculates the global velocity dipsersion shape catalogue
Calls
calcObjMorphGlobalVelDisp()
in a parallelized manner.Calculates the overall axis ratios and eigenframe for each object.
- Parameters
xyz ((N2 x 3) floats) – positions of all (DM or star) particles in simulation box
vxyz ((N2 x 3) floats) – velocities of all (DM or star) particles in simulation box
masses ((N2 x 1) floats) – masses of the particles expressed in unit mass
r200 ((N1,) floats) – R_200 radii of the parent halos
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
IT_TOL (float) – convergence tolerance, eigenvalue fractions must differ by less than
IT_TOL
for iteration to stopIT_WALL (float) – maximum permissible number of iterations
IT_MIN (int) – minimum number of particles (DM or star particle) in any iteration; if undercut, shape is unclassified
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
SAFE (float) – ellipsoidal radius will be maxdist(COM,point)+SAFE where point is any point in the point cloud. The larger the better.
reduced (boolean) – whether or not reduced shape tensor (1/r^2 factor)
- Returns
d, q, s, eigframe, centers, masses
- Return type
(N3,
D_BINS
+ 1) floats (for d, q, s, eigframe (x3)), (N3, 3) floats (for centers), (N3,) floats (for masses)
- shape_profs.shape_profs_algos.calcMorphLocal(double[:, :] xyz, double[:] masses, double[:] r200, int[:] idx_cat, int[:] obj_size, double L_BOX, double[:] r_over_r200, double IT_TOL, int IT_WALL, int IT_MIN, unicode CENTER, bool reduced, bool shell_based)[source]
Calculates the local shape catalogue
Calls
calcObjMorphLocal()
in a parallelized manner.Calculates the axis ratios for the range [
r200
x r_over_r200[0],r200
x r_over_r200[-1]] from the centers, for each object.- Parameters
xyz ((N2 x 3) floats) – positions of all (DM or star) particles in simulation box
masses ((N2 x 1) floats) – masses of the particles expressed in unit mass
r200 ((N1,) floats) – R_200 radii of the parent halos
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
r_over_r200 ((r_res,) floats) – normalized radii at which shape profiles should be estimated
IT_TOL (float) – convergence tolerance, eigenvalue fractions must differ by less than
IT_TOL
for iteration to stopIT_WALL (float) – maximum permissible number of iterations
IT_MIN (int) – minimum number of particles (DM or star particle) in any iteration; if undercut, shape is unclassified
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
reduced (boolean) – whether or not reduced shape tensor (1/r^2 factor)
shell_based (boolean) – whether shell-based or ellipsoid-based algorithm should be run
- Returns
d, q, s, eigframe, centers, masses, l_succeed: list of object indices for which morphology could be determined at R200 (length: N3)
- Return type
(N3,
D_BINS
+ 1) floats (for d, q, s, eigframe (x3)), (N3, 3) floats (for centers), (N3,) floats (for masses), N3-list of ints for l_succeed
- shape_profs.shape_profs_algos.calcMorphLocalVelDisp(double[:, :] xyz, double[:, :] vxyz, double[:] masses, double[:] r200, int[:] idx_cat, int[:] obj_size, double L_BOX, double[:] r_over_r200, double IT_TOL, int IT_WALL, int IT_MIN, unicode CENTER, bool reduced, bool shell_based)[source]
Calculates the local velocity dispersion shape catalogue
Calls
calcObjMorphLocalVelDisp()
in a parallelized manner.Calculates the overall axis ratios and eigenframe for each object.
- Parameters
xyz ((N2 x 3) floats) – positions of all (DM or star) particles in simulation box
vxyz ((N2 x 3) floats) – velocities of all (DM or star) particles in simulation box
masses ((N2 x 1) floats) – masses of the particles expressed in unit mass
r200 ((N1,) floats) – R_200 radii of the parent halos
idx_cat ((N3,) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
MIN_NUMBER_PTCS (int) – minimum number of particles for object to qualify for morphology calculation
r_over_r200 ((r_res,) floats) – normalized radii at which shape profiles should be estimated
IT_TOL (float) – convergence tolerance, eigenvalue fractions must differ by less than
IT_TOL
for iteration to stopIT_WALL (float) – maximum permissible number of iterations
IT_MIN (int) – minimum number of particles (DM or star particle) in any iteration; if undercut, shape is unclassified
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
reduced (boolean) – whether or not reduced shape tensor (1/r^2 factor)
shell_based (boolean) – whether shell-based or ellipsoid-based algorithm should be run
- Returns
d, q, s, eigframe, centers, masses, l_succeed: list of object indices for which morphology could be determined at R200 (length: N3)
- Return type
(N3,
D_BINS
+ 1) floats (for d, q, s, eigframe (x3)), (N3, 3) floats (for centers), (N3,) floats (for masses), N3-list of ints for l_succeed
Shape profiling tools
The shape_profs_tools
module provides shape-related tools e.g. how to calculate the complex ellipticity for a particle cloud given a line-of-sight.
- shape_profs.shape_profs_tools.getEpsilon(idx_cat, obj_size, xyz, masses, L_BOX, CENTER, angle=0.0)[source]
Calculate the complex ellipticity (z-projected)
It is obtained from the shape tensor = centred (wrt mode) second mass moment tensor
- Parameters
idx_cat ((N3) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
xyz ((N^3x3) floats) – coordinates of particles of type 1 or type 4
masses ((N^3x1) floats) – masses of particles of type 1 or type 4
L_BOX (float, units: Mpc/h) – simulation box side length
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
angle (float) – rotation of objects around z-axis before ellipticity is calculated (z-projected)
- Returns
complex ellipticity
- Return type
complex scalar
- shape_profs.shape_profs_tools.getGlobalEpsHist(xyz, masses, idx_cat, obj_size, L_BOX, CENTER, VIZ_DEST, SNAP, suffix='_', HIST_NB_BINS=11)[source]
Plot ellipticity histogram
- Parameters
xyz ((N^3x3) floats) – coordinates of particles of type 1 or type 4, in Mpc/h
masses ((N^3x1) floats) – masses of particles of type 1 or type 4, in 10^10*M_sun/h
idx_cat ((N3) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
VIZ_DEST (string) – visualisation folder destination
SNAP (string) – e.g. ‘024’
suffix (string) – either ‘_dm_’ or ‘_gx_’ or ‘’ (latter for DensShapeProfs)
HIST_NB_BINS (int) – Number of histogram bins
- shape_profs.shape_profs_tools.getGlobalTHist(VIZ_DEST, SNAP, start_time, obj_masses, obj_centers, d, q, s, major_full, HIST_NB_BINS, MASS_UNIT, suffix='_')[source]
Plot triaxiality T histogram
- Parameters
VIZ_DEST (string) – visualisation folder destination
SNAP (string) – e.g. ‘024’
start_time (float) – time of start of shape analysis
obj_masses ((N,) floats) – masses of objects in 10^10*M_sun/h
obj_centers ((N,3) floats) – centers of objects, each coordinate in Mpc/h
d ((N, D_BINS+1) floats) – ellipsoidal radii at which shape profiles have been calculated
q ((N, D_BINS+1) floats) – q-values
s ((N, D_BINS+1) floats) – s-values
major_full ((N, D_BINS+1, 3) floats) – major axes at each radii
HIST_NB_BINS (int) – Number of histogram bins
MASS_UNIT (float) – conversion factor from previous mass unit to M_sun/h
suffix (string) – either ‘_dm_’ or ‘_gx_’ or ‘’ (latter for DensShapeProfs)
- shape_profs.shape_profs_tools.getLocalEpsHist(xyz, masses, r200, idx_cat, obj_size, L_BOX, CENTER, VIZ_DEST, SNAP, frac_r200, suffix='_', HIST_NB_BINS=11)[source]
Plot ellipticity histogram
- Parameters
xyz ((N^3x3) floats) – coordinates of particles of type 1 or type 4, in Mpc/h
masses ((N^3x1) floats) – masses of particles of type 1 or type 4, in 10^10*M_sun/h
r200 ((N1,) floats) – R_200 radii of the parent halos
idx_cat ((N3) integers) – contains indices of particles belonging to an object
obj_size ((N1,) integers) – indicates how many particles are in each object
L_BOX (float, units: Mpc/h) – simulation box side length
CENTER (str) – shape quantities will be calculated with respect to CENTER = ‘mode’ (point of highest density) or ‘com’ (center of mass) of each halo
VIZ_DEST (string) – visualisation folder destination
SNAP (string) – e.g. ‘024’
frac_r200 (float) – depth of objects to plot triaxiality, in units of R200
suffix (string) – either ‘_dm_’ or ‘_gx_’ or ‘’ (latter for DensShapeProfs)
HIST_NB_BINS (int) – Number of histogram bins
- shape_profs.shape_profs_tools.getLocalTHist(VIZ_DEST, SNAP, r_over_r200, r200, start_time, obj_masses, obj_centers, d, q, s, major_full, HIST_NB_BINS, frac_r200, MASS_UNIT, suffix='_')[source]
Plot triaxiality T histogram
- Parameters
VIZ_DEST (string) – visualisation folder destination
SNAP (string) – e.g. ‘024’
r_over_r200 ((D_BINS+1,) floats) – normalized radii at which shape profiles are estimated
r200 ((N,) floats) – each entry gives the R_200 radius of the parent halo in Mpc/h (internal length units)
start_time (float) – time of start of shape analysis
obj_masses ((N,) floats) – masses of objects, in 10^10*M_sun/h
obj_centers ((N,3) floats) – centers of objects, each coordinate in Mpc/h
d ((N, D_BINS+1) floats) – ellipsoidal radii at which shape profiles have been calculated
q ((N, D_BINS+1) floats) – q-values
s ((N, D_BINS+1) floats) – s-values
major_full ((N, D_BINS+1, 3) floats) – major axes at each radii
HIST_NB_BINS (int) – Number of histogram bins
frac_r200 (float) – depth of objects to plot triaxiality, in units of R200
MASS_UNIT (float) – conversion factor from previous mass unit to M_sun/h
suffix (string) – either ‘_dm_’ or ‘_gx_’ or ‘’ (latter for DensShapeProfs)
- shape_profs.shape_profs_tools.getShape(d, param_interest, ERROR_METHOD, r_over_r200, r200)[source]
Get average profile for param_interest (which is defined at all values of d) at all ellipsoidal radii Rs
- Parameters
d ((N1,N2) floats) – param_interest is defined at all ellipsoidal radii d
param_interest ((N1,N2) floats) – the quantity of interest defined at all ellipsoidal radii d
ERROR_METHOD (string) – mean (if ERROR_METHOD == “bootstrap” or “SEM”) or median (if ERROR_METHOD == “median_quantile”) and the +- 1 sigma error attached
r_over_r200 ((N2,) floats) – normalized radii at which shape profiles are estimated
r200 ((N1,) floats) – each entry gives the R_200 radius of the parent halo in Mpc/h (internal length units)
- Returns
mean/median, err_low, err_high
- Return type
float, float, float
- shape_profs.shape_profs_tools.getShapeMs(d, idx_groups, group, param_interest, ERROR_METHOD, r_over_r200, r200)[source]
Similar to getShape, but with mass-splitting
- shape_profs.shape_profs_tools.getShapeProfs(VIZ_DEST, SNAP, r_over_r200, r200, start_time, obj_masses, obj_centers, d, q, s, major_full, nb_bins, MASS_UNIT=10000000000.0, suffix='_')[source]
Create a series of plots to analyze object shapes
Plot intertial tensor axis ratios, triaxialities and ellipticity histograms.
- Parameters
VIZ_DEST (string) – visualisation folder destination
SNAP (string) – e.g. ‘024’
r_over_r200 ((D_BINS+1,) floats) – normalized radii at which shape profiles are estimated
r200 ((N,) floats) – each entry gives the R_200 radius of the parent halo in Mpc/h (internal length units)
start_time (float) – time of start of shape analysis
obj_masses ((N,) floats) – total mass of objects, in 10^10*M_sun/h
obj_centers ((N,3) floats) – positions of centers of objects, in Mpc/h
d ((N, D_BINS+1) floats) – param_interest is defined at all ellipsoidal radii d
q ((N, D_BINS+1) floats) – intermediate-to-major axis ratios
s ((N, D_BINS+1) floats) – minor-to-major axis ratios
major_full ((N,D_BINS+1,3) floats) – major axis vectors
nb_bins (int) – Number of mass bins to plot density profiles for
MASS_UNIT (float) – conversion factor from previous mass unit to M_sun/h
suffix (string) – either ‘_dm_’ or ‘_gx_’ or ‘’ (latter for DensShapeProfs)