Complex properties¶
Contents
Property functions¶
Complex properties can make use of all properties and combine them to more complex functions and data reduction.
Every property called <NAME> is defined as:
-
prop_<NAME>(ids, ptype, **prop)
- Parameters
ids (list[bool]) – Particle IDs selectors
ptype (int) – Particle type
prop (dict) – Dictionary with additional properties
In the class descriptions below we will list only additional parameters included in the prop dictionary.
Various¶
-
class
arepy.files.prop.
complex
¶ Complex properties
-
prop_MassCenter
(ids, ptype, **prop)¶ Get mass center of a gas
- Parameters
transf (arepy.coord.transf) – Coordinate transformation
- Returns
Mass center of the gas
- Return type
[float]*3
-
prop_AngularMomentum
(ids, ptype, **prop)¶ Get angular momentum around some point
- Parameters
center ([float]*3) – Center of a sphere
radius (float) – Radius of a sphere
- Returns
Angular momentum vector
- Return type
[float]*3
Example:
>>> snap.getProperty({'name':'AngularMomentum','center':[0.5,0.5,0.5],'radius':0.5}) [2.4, 3.6, 1.]
-
prop_SelectionRadius
(ids, ptype, **prop)¶ Calculate the smallest selection radius
- Parameters
center ([float]*3) – Center of a spherical region
radius (float) – Radius of a spherical region
The selection radius is a distance of the furthers cell from the center whose spherical radius could possibly intersect the volume of the region.
-
prop_HistSphere
(ids, ptype, **prop)¶ Mass weighted radial histogram of a property within a spherical region
- Parameters
center ([float]*3) – Center of the sphere
bins (list[float]) – Radial bins
p (properties) – List of properties
- Returns
Mass weighted radial distribution of a property
Example:
>>> snap.getProperty({ >>> 'name':'HistSphere','center':[0.5,0.5,0.5],'bins':np.linspace(0,0.5,50), >>> 'p':['X_HP','Temperature'] >>> }) {'X_HP': [0.234, 0.64, 0.3,...], 'Temperature': [1234.3, 3435.23, 9454.23,...]}
-
prop_HistBox
(ids, ptype, **prop)¶ Two dimensional histogram of a property within a selected box region
-
prop_FractionVolume
(ids, ptype, **prop)¶ Get a volume fraction of a property in some region
- Parameters
p (properties) – List of properties
lt (float) – Select cells with properties larger than this value
st (float) – Select cells with properties smaller than this value
- Returns
Volume fraction within the selected region
- Return type
float or list[float]
-
prop_FractionMass
(ids, ptype, **prop)¶ Get mass fraction of some element
- Parameters
p (prop) – A property or list of properties
- Returns
Mass fraction within the selected region
- Return type
float or list[float]
-
Regions¶
-
class
arepy.files.prop.
complexRegion
¶ Select particle values within a given region
-
prop_RegionSphere
(ids, ptype, **prop)¶ Select properties within a sphere region
- Parameters
transf (
arepy.coord.transf
) – Coordinate transformationp (
arepy.files.properties
) – List of propertiescenter ([float]*3) – Center of the sphere
radius (float) – Radius of the sphere
- Returns
Particle properties within the region
-
prop_RegionBox
(ids, ptype, **prop)¶ Select properties within a box region
- Parameters
transf (
arepy.coord.transf
) – Coordinate transformationp (
arepy.files.properties
) – List of propertiescenter ([float]*6) – Box limits
- Returns
Particle properties within the region
-
prop_RegionIDs
(ids, ptype, **prop)¶ Select properties of particles with IDs
- Parameters
pids (list[int]) – One or more particle IDs
p (
arepy.files.properties
) – List of properties
- Returns
Particle properties within the region
-
prop_RegionFormationOrder
(ids, ptype, **prop)¶ Select properties of sink particles with formation order IDs
- Parameters
forder (list[int]) – One or more particle IDs
p (
arepy.files.properties
) – List of properties
- Returns
Particle properties within the region
-
prop_RegionPoints
(ids, ptype, **prop)¶ Select property values at some coordinates
- Parameters
coord (list[[float]*3]) – List of coordinates
p (
arepy.files.properties
) – List of properties
- Returns
Properties of the closest particles to the points
-
prop_RegionCone
(ids, ptype, **prop)¶ Select property values within a given cone region
- Parameters
transf (
arepy.coord.transf
) – Coordinate transformationp (
arepy.files.properties
) – List of properties
- Returns
Particle properties within the region
-
Slices¶
-
class
arepy.files.prop.
complexSlice
¶ Box slices
-
prop_BoxPoints
(ids, ptype, **prop)¶ Find property values for given points
-
prop_BoxLine
(ids, ptype, **prop)¶ Find property values for a given line
-
prop_BoxSquareXY
(ids, ptype, **prop)¶ Find property values for a given XY sphere
-
prop_BoxFieldXY
(ids, ptype, **prop)¶ Find property values for a given field
-
prop_BoxLineRZ
(ids, ptype, **prop)¶ Find property values for a RZ lines
-
prop_BoxLineXYZ
(ids, ptype, **prop)¶ Find property values for a given XYZ line
-
prop_BoxHealpix
(ids, ptype, **prop)¶ Find property values for a Healpix gird
-
prop_BoxRays
(ids, ptype, **prop)¶ Find property values for a Healpix ray gird
-