Simple properties

Property functions

Simple properties are directly taken or derived from the snapshot properties.

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.

Basic properties

class arepy.files.prop.simple

Simple properties

Properties in this class can be extracted directly from the Arepo snapshot.

prop_ParticleIDs(ids, ptype, **prop)

Get cell IDs

Returns

Array with particle IDs

Return type

list[int]

prop_Masses(ids, ptype, **prop)

Get cell masses

Returns

Array of particle masses

Return type

list[float]

prop_Density(ids, ptype, **prop)

Get cell densities

Returns

Array of particle densities

Return type

list[float]

prop_InternalEnergy(ids, ptype, **prop)

Get cell internal energies

Returns

Array of particle internal energies

Return type

list[float]

prop_Coordinates(ids, ptype, **prop)

Get cell coordinates

Returns

Array of particle coordinates

Return type

list[[float]*3]

prop_PosX(ids, ptype, **prop)

Get cell x coordinates

Returns

Array of particle x coordinates

Return type

list[float]

prop_PosY(ids, ptype, **prop)

Get cell y coordinates

Returns

Array of particle y coordinates

Return type

list[float]

prop_PosZ(ids, ptype, **prop)

Get cell z coordinates

Returns

Array of particle z coordinates

Return type

list[float]

prop_Velocities(ids, ptype, **prop)

Get cell velocities

Returns

Array of particle velocities

Return type

list[[float]*3]

prop_VelX(ids, ptype, **prop)

Get cell x velocities

Returns

Array of particle x velocities

Return type

list[float]

prop_VelY(ids, ptype, **prop)

Get cell y velocities

Returns

Array of particle y velocities

Return type

list[float]

prop_VelZ(ids, ptype, **prop)

Get cell z velocities

Returns

Array of particle z velocities

Return type

list[float]

prop_FileIndex(ids, ptype, **prop)

Index of a file where the particle is saved

prop_ParticleIndex(ids, ptype, **prop)

Index of a particle within the dataset

prop_Radius(ids, ptype, **prop)

Get radius distances from a given center point

Parameters

center ([int,int,int]) – Center point coordinates

Returns

Cell distances from the center

Return type

list[int]

prop_Radius2(ids, ptype, **prop)

Square of a particle radius from a given center

Parameters

center ([int,int,int]) – Center point coordinates

Returns

Square of a radius from the center

Return type

list[int]

prop_VelocityRadial(ids, ptype, **prop)

Radial component of the velocities

Parameters

center ([float]*3) – Point from which the velocity component is calculated

Return [float]*3

Radial velocity component size

Calculation of the component is taken from Wikipedia.

\[v_\perp = v . \hat{n}\]
prop_VelocitySphere(ids, ptype, **prop)

Cell velocitie vectors in spherical coordinates with respect to a center

Parameters

center ([float]*3) – Point from which the velocity components are calculated

Return [float]*2

Radial and tangential velocity components

Calculation of the components is take from Wikipedia.

prop_CellVolume(ids, ptype, **prop)

Particle cell Volume

Return float

Cell volume

Volume of the cell is calculated from its mass and density:

\[V = \frac{M}{\rho}\]
prop_CellRadius(ids, ptype, **prop)

Particle cell mean radius

Return float

Mean cell radius

Cell radius is only approximated from the cell volume:

\[r = \left( \frac{3V}{4\pi} \right)^{1/3}\]

Basic selectors

class arepy.files.prop.simpleSelect

Simple selections

These function return selection indexes according to different selection criteria.

Examples:

  1. Return selection together with other properties:

    >>> particleIDs = [20234939, 42394849, 2384784,...]
    >>> snap.getProperty([
    >>>      'ParticleIDs',
    >>>      {'name':'SelectIds', 'pids': particleIDs}
    >>> ])
    
    {'ParticleIDs': [20234939, 5234234, 94588239,...],
     'SelectIds': [True, False, False, ...]}
    
  2. Return selection only:

    >>> particleIDs = [20234939, 42394849, 2384784,...]
    >>> snap.getProperty({'name':'SelectIds', 'pids': particleIDs})
    
    [True, False, False, ...]
    
prop_SelectIds(ids, ptype, **prop)

Select cells with particular IDs

Parameters

pids (list[int]) – Particle IDs

Returns

Selection indexes of the selected particles

Return type

list[int]

Note

For large numbers of IDs this can get quite slow, because it uses numpy.in1d() function.

prop_SelectSphere(ids, ptype, **prop)

Select cells from a spherical region

Parameters
  • radius (float) – Sphere radius

  • center ([float]*3) – Sphere center

Returns

Selection indexes of the selected particles

Return type

list[int]

prop_SelectBox(ids, ptype, **prop)

Select cells from a box

Parameters

center ([float]*6) – Box limits (xmin,xmax,ymin,ymax,zmin,zmax)

Returns

Selection indexes of the selected particles

Return type

list[int]

prop_SelectPoints(ids, ptype, **prop)

Select cells closest to the given points

Parameters

coord (list[[float]*3]) – List of coordinates

Returns

Selection indexes of the selected particles

Return type

list[int]

prop_Indexes(ids, ptype, **prop)

Get current selector indexes

Returns

Array with selector indexes

Return type

list[bool]

Basic mathematical functions

class arepy.files.prop.simpleMath

Simple mathematical operation

The properties in this class perform simple mathematical operations with the snapshot data

prop_MathPlus(ids, ptype, **prop)

Addition of two datasets

prop_MathMinus(ids, ptype, **prop)

Substraction of two datasets

prop_MathMultiply(ids, ptype, **prop)

Multiplication of two datasets

prop_MathDivide(ids, ptype, **prop)

Division of two datasets

prop_MathModulo(ids, ptype, **prop)

Modulo of two datasets

Basic statistical functions

class arepy.files.prop.simpleStat

Simple statistics

The properties in this class perform simple statistical operations on the snapshot data.

prop_StatMinimum(ids, ptype, **prop)

Minimum value of a property

prop_StatMinPos(ids, ptype, **prop)

Minimum positive value of a property

prop_StatMaximum(ids, ptype, **prop)

Maximum value of a property

prop_StatMean(ids, ptype, **prop)

Mean value of a property

prop_StatSum(ids, ptype, **prop)

Sum of values of a property

prop_Hist1D(ids, ptype, **prop)

Histogram of a single property

prop_Hist2D(ids, ptype, **prop)

Histogram of two properties

SGChem properties

class arepy.files.prop.sgchem1

SGChem properties

Chemistry specific properties that can be used only with the primordial chemistry module SGChem.

prop_ChemicalAbundances(ids, ptype, **prop)

Chemical abundances

Returns

List of chemical abundances

Return type

list[float]*9

prop_x_H2(ids, ptype, **prop)

Abundance of a molecular Hydrogen

Returns

List of H2 abundances

Return type

list[float]

prop_x_HP(ids, ptype, **prop)

Abundance of a ionized Hydrogen

Returns

List of H+ abundances

Return type

list[float]

prop_x_DP(ids, ptype, **prop)

Abundance of a ionized Deuterium

Returns

List of D+ abundances

Return type

list[float]

prop_Gamma(ids, ptype, **prop)

Polytropic index

Returns

If value of Gamma is not present in a snapshot this returns a standard value of Gamma=5/3

Sink particle properties

class arepy.files.prop.sink

Properties of the sink particle file

Propertis in this class are extracted from the sink particle snapshot files. Therefore, they are accessible only if the sink particle snapshot are available. It is possible to call sink snapshot properties when particle type is set to ptype=5.

prop_SinkFormationOrder(ids, ptype, **prop)

Returns value of the sink formation order

Returns

Formation order of sink particles

Return type

list[int]

prop_SinkFormationTime(ids, ptype, **prop)

Returns value of the sink formation time

Returns

Formation time of sink particles

Return type

list[float]

prop_SinkID(ids, ptype, **prop)

Returns value of the sink IDs

Returns

Particle IDs of sink particles

Return type

list[int]

prop_SinkMass(ids, ptype, **prop)

Returns value of the sink masses

Returns

Masses of sink particles

Return type

list[float]

prop_SinkAccretionRate(ids, ptype, **prop)

Returns value of the sink accretion rate

Returns

Accretion rate of sink particles

Return type

list[float]

Sink particle selectors

class arepy.files.prop.sinkSelect

Sink particle selectors

Selector function specific for the sink particle properties only accessible in the sink particle snapshot.

prop_SelectFormationOrder(ids, ptype, **prop)

Selecting particles with a given formation order values

Parameters

forder (list[int]) – List of formation order values

Returns

Particle selection indexes

Return type

list[bool]