Groups¶
Collection¶
-
class
arepy.files.groups.
collection
(names=None, options=None, **opt)¶ Collection of groups
- Parameters
names (list[str]) – List of group names
options (list[dict]) – List of group settings
Groups¶
-
class
arepy.files.groups.
group
(sim=None, snaps=None, **opt)¶ Snapshot group
- Parameters
sim (int) – Simulation ID
snaps (list[int]) – Snapshot number or list of numbers
This class inherits both a general group class
arepy.data.group
and extra group methods fromarepy.files.groups.groupsMethods
.-
addSnapshot
(sim, snaps, opt=None)¶ Add snapshots to thegroup
- Parameters
sim (
arepy.files.simulation
) – simulation or list of simulationssnaps (int) – snapshot number or list of numbers
opt (dict) – item options
Group methods¶
-
class
arepy.files.groups.
groupsMethods
¶ Group methods class
-
setTransf
(**opt)¶ Set coordinate transformations for every item
Example:
center = [0.15,0.15,0.15] region = apy.coord.regionBox(center,0.2) grp.setTransf(region=region, origin=center)
-
getTransf
(args, **opt)¶ Get transformation parameters from a particle
- Parameters
args – Settings of a transformation
opt – Settings of the
arepy.data.group.foreach()
Transformations are calculated in
arepy.files.groups.groupsTransf
.
-
useTransf
(transf, use=True, add={})¶ Use transformation values
-
getPropertyRange
(prop, scale='lin')¶ Calculate a range of properties
-
getSinkProps
(props, select=None, cache=None, update=True)¶ Create a list of sink particles with their properties in each snapshot
-
setImage
(sp, prop, imgType, norm=None, normType=None, cmap=None, multiply=None, clip=None)¶ Set Arepo image
-
setProjection
(sp, prop, **opt)¶ Create a projection image of a snapshot property
- Parameters
sp (
arepy.plot.subplot
) – Subplot of a figureprop (str) – A snapshot property
bins (int) – Number of pixels (bins) per dimension
cache (bool) – Name of the results cache
nproc (int) – Number of processors per projection
n_jobs (int) – Number of processors per KDTree
Parameter ‘imgopt’ is a dictionary of options that are passed to
arepy.plot.subplot.setImage()
, together with the image ‘data’ and ‘extent’.
-
setSlice
(sp, prop, **opt)¶ Create a slice image of a snapshot property
- Parameters
sp (
arepy.plot.subplot
) – Subplot of a figureprop (str) – A snapshot property
bins (int) – Number of pixels (bins) per dimension
cache (bool) – Name of the results cache
nproc (int) – Number of processors per projection
n_jobs (int) – Number of processors per KDTree
Parameter ‘imgopt’ is a dictionary of options that are passed to
arepy.plot.subplot.setImage()
, together with the image ‘data’ and ‘extent’.
-
setField
(sp, prop, **opt)¶ Set a quiver field map on the image
This function is used to display a vector field on the top of an image.
-
setSnapStamp
(sp, *args, **kwargs)¶ Show snapshot number in plots
-
addTimes
(sp, **opt)¶ Show snapshot time in plots
-
addRedshifts
(sp, **opt)¶ Show snapshot redshifts in plots
-
addSnapNums
(sp, **opt)¶ Show snapshot numbers in plots
-
addParticles
(sp, ptype, **opt)¶ Show particle location on the image
-
addCoordSystem
(sp, info=False, vector=None)¶ Show coordinate system on the plot
-
addHist2D
(sp, xprop, yprop, bins, norm=None, normType='lin', xscale='lin', yscale='lin', cmap=None, aspect='auto')¶ Create a 2D property histogram
-
Group transformations¶
-
class
arepy.files.groups.
groupsTransf
(item)¶ Group transformation class
-
transf_SinkFormationOrder
(lrad, forder, size=None, radius=None)¶ Get trasformation from a sink particle ID
- Parameters
forder – string = item option key, int = formation order, list[int] = formation orders for each item
-
transf_SinkID
(lrad, ids, size=None, radius=None)¶ Get trasformation from a sink particle ID
-
transf_ParticleID
(lrad, ids, size=None, radius=None, ptype=0)¶ Get trasformation from a particle ID
-
transf_MainSink
(lrad, size=None, radius=None)¶ Get transformation from the position of the main sink particle
-
transf_BoxSize
()¶ Get transformation from the BoxSize value
-
transf_ArepoImage
()¶ Get transformation from the Arepo image settings in parameter file
-
Item¶
-
class
arepy.files.groups.
item
(index, groupName, opt, sim, snap)¶ Snapshot item
- Variables
sim (
arepy.files.simulation
) – Simulationunits (
arepy.files.units
) – Unitssnap (int) – Default snapshot number
transf (
arepy.coord.transf
) – Transformations
This class holds all information about a particular snapshot that should be analyzed
-
setTransf
(**opt)¶ Set transformations
-
getSnapshot
(snap=None, **opt)¶ Get a snapshot object
- Parameters
snap (int) – If not specified the default snapshot number of this item is used
-
getSink
(snap=None, **opt)¶ Get a sink particle snapshot object
- Parameters
snap (int) – If not specified the default snapshot number of this item is used
-
getImage
(imProp, imType, snap=None, **opt)¶ Get an image object
- Parameters
imProp (str) – Image property
imType (str) – Image type (slice/proj)
snap (int) – If not specified the default snapshot number of this item is used
-
getParameters
()¶ Get a parameter file object of the simulation