pynbody.analysis.profile.VerticalProfile#
- class pynbody.analysis.profile.VerticalProfile(sim, rmin, rmax, zmax, load_from_file=False, ndim=3, type='lin', **kwargs)[source]#
Bases:
Profile
Creates a profile object that uses the absolute value of the z-coordinate for binning.
Input:
sim: snapshot to make a profile from
rmin: minimum radius for particle selection in kpc
rmax: maximum radius for particle selection in kpc
zmax: maximum height to consider in kpc
Optional Keywords:
- ndim: if ndim=2, an edge-on projected profile is produced,
i.e. density is in units of mass/pc^2. If ndim=3 a volume profile is made, i.e. density is in units of mass/pc^3.
Methods
create_particle_array
(profile_name[, ...])Create a particle array with the results of the profile calculation.
Returns a list of possible profiles
families
()Returns the family of particles used
keys
()Returns a listing of available profile types
write
()Writes all the vital information of the profile to a file.
profile_property
- create_particle_array(profile_name, particle_name=None, out_sim=None)#
Create a particle array with the results of the profile calculation.
After calling this function, sim[particle_name][i] == profile[profile_name][bin_in_which_particle_i_sits]
If particle_name is not specified, it defaults to the same as profile_name.
- derivable_keys()#
Returns a list of possible profiles
- families()#
Returns the family of particles used
- keys()#
Returns a listing of available profile types
- write()#
Writes all the vital information of the profile to a file.
To recover the profile, initialize a profile with the load_from_file=True keyword to automatically load a previously saved profile. The filename is chosen automatically and corresponds to a hash generated from the positions of the particles used in the profile. This is to ensure that you are always looking at the same set of particles, centered in the same way. It also means you must use the same centering method if you want to reuse a saved profile.