Halo radius and mass definitions¶
This unit handles definitions of halo extent, boundary, and mass. Most importantly, it converts a uniquely defined string-based format for definitions to a machine-readable format, and vice versa. Halo definitions are encapsulated by an object with the following main properties:
quantity
: Indicates the actual quantity described, e.g., radius, mass, peak height, of circular velocity. Perhaps counter-intuitively, this field can be unknown, in which case a general type of definition is described.type
: The main type of definition, e.g. friends-of-friends, overdensity, or splashback.subtype
: A refinement of type. For example, there are SO defintions wrt critical or mean density, and many types of splashback definitions.
The string format is then generated as <quantity><type><subtype>_<other-properties>
. The user
can generate a HaloDefinition
object from a string using strToDef()
and convert
the object back using HaloDefinition.toStr()
.
There are also a number of less important, optional descriptors for which a default is set so that they do not need to be explicitly spelled out in the string format. This unit determines which definitions can be requested in SPARTA or MORIA configuration files, as long as they can be computed by the code.
The implementation exactly shadows the C implementation contained in SPARTA, so that the numerical values of all settings are the same in both languages:
Property |
Value |
String |
Explanation |
---|---|---|---|
Quantity |
|
Default |
Could describe any, general type |
|
R |
Halo radius |
|
|
M |
Halo mass |
|
|
nu |
Peak height |
|
|
V |
Cirular velocity |
|
Type |
|
m/c/vir |
Spherical overdensity |
|
sp |
Splashback |
|
|
fof |
Friends-of-friends |
|
|
max |
Maximum circular velocity |
|
|
orb |
Orbiting particles |
|
Subtype |
|
<int>m |
Matter-based SO (e.g., 200m) |
|
<int>c |
Critical-based SO (e.g., 200c) |
|
|
vir |
Virial-based SO (varying overdensity) |
|
|
slp-prf |
Radius where slope is steepest |
|
|
slp-med |
Steepest slope radius in median of angular bins |
|
|
slp-shl |
Non-isotropic steepest slope (e.g. SHELLFISH) |
|
|
apr-mn |
Mean of first apocenter radii of halo particles |
|
|
apr-p<int> |
Percentile of first apocenter radii of ptl. |
|
|
aps-mn |
Non-isotropic apocenter mean |
|
|
aps-p<int> |
Non-isotropic apocenter percentile |
|
|
all |
All orbiting particles that ever entered the halo |
|
|
p<int> |
Percentile of orbiting ptl (within some radius) |
|
Time |
|
Default |
Current state of halo |
|
acc |
State of subhalo at last accretion |
|
|
peak |
State of halo at peak of this property |
|
Particle selection |
|
Default |
Not specified |
|
all |
Definition includes all halo particles |
|
|
bnd |
Definition includes only grav. bound particles |
|
|
tcr |
Definition includes only traced ptl (for subhalos) |
|
|
orb |
Definition includes only orbiting particles |
|
Source |
|
Default |
Unknown source, unspecified |
|
cat |
Taken from halo catalog |
|
|
spa |
Computed by SPARTA |
|
|
sfish |
Computed by SHELLFISH |
|
Value or error |
|
Default |
This is the indicated quantity |
|
err |
This is the 1-sigma uncertainty on the quantity |
|
|
err2s |
This is the 2-sigma uncertainty on the quantity |
|
Other flags |
|
internal |
Flag for internally used values |
Depending on the choices, a number of numerical values can become active, in particular:
overdensity
: if type isHDEF_TYPE_SO
and subtype isHDEF_SUBTYPE_SO_MATTER
orHDEF_SUBTYPE_SO_CRITICAL
.linking_length
: if type isHDEF_TYPE_FOF
.percentile
: if type isHDEF_TYPE_SPLASHBACK
and subtype isHDEF_SUBTYPE_SP_APOCENTER_RADIUS_PERCENTILE
orHDEF_SUBTYPE_SP_APOCENTER_SHELL_PERCENTILE
.
Examples¶
Valid examples of mass definitions would include:
200m
,vir
R200m
,M200m
,nu200m
Vmax
Mfof-b0.2
,Rfof-b0.15
Rsp-slp-prf
,Msp-slp-prf
Rsp-apr-p75
Not strictly correct, but also accepted when converting from a string are different capitalizations of the quantity (but only the quantity), e.g.:
r200m
,m200m
,mfof-b0.2
NU200m
,Nu200m
vmax
While those strings will be converted into a halo definition without an error, converting the
definition back to a string will result in the standard capitalization. Thus, it is recommended to
stick with R
, M
and so on whenever possible.
All additional properties are separated by underscores and can be ordered at will. Defaults are used if no value is specified. Valid definitions thus include:
R200m
R200m_peak
,R200m_acc
R200m_all
,R200m_bnd
R200m_cat
,R200m_spa
R200m_err
,R200m_err2s
The best way to test whether a definition is valid is to try converting it with strToDef()
,
which will throw an error if the string is not a correct definition.
Module reference¶
- class sparta_tools.halodef.HaloDefinition¶
Object that encapsulates a halo definition.
Methods
Convert an SO halo definition to a short overdensity identifier, such as "200m" or "500c".
toLabel
([add_dollars, add_units, ...])Convert halo definition to a latex label.
toStr
()Convert halo definition to string.
- toStr()¶
Convert halo definition to string.
- Returns
- defstr: str
A string that uniquely describes the halo definition, and that can be converted back into the same definition.
- toLabel(add_dollars=True, add_units=False, suppress_source=False, suppress_time=False, suppress_bound=False, suppress_flags=False)¶
Convert halo definition to a latex label.
- Parameters
- add_dollars: bool
Whether or not to add $ signs at the beginning and end of the string.
- add_units: bool
Add units in brackets behind the label.
- suppress_source: bool
Do not output source identifiers (e.g.,
_cat
).- suppress_time: bool
Do not output time identifiers (e.g.,
_peak
or_acc
).- suppress_bound: bool
Do not output all-particle and bound-only identifiers (e.g.,
_all
and_bnd
).- suppress_flags: bool
Do not output additional flag info (e.g.,
_internal
).
- Returns
- label: str
A string that can be fed to latex, e.g. for figure labels.
- overdensityStr()¶
Convert an SO halo definition to a short overdensity identifier, such as “200m” or “500c”.
This function fails if the definition is not an SO definition, and ignores any additional properties of the definition.
- Returns
- so_str: str
A string that identifies the overdensity of an SO definition.
- sparta_tools.halodef.strToDef(defstr)¶
Convert a halo definition string to a halo definition object.
- Parameters
- defstr: str
A string that uniquely describes the halo definition in the correct format.
- Returns
- hdef: HaloDefinition
A halo definition object that can be converted back into the same string.