pynbody.analysis.profile.InclinedProfile#

class pynbody.analysis.profile.InclinedProfile(sim, angle, load_from_file=False, ndim=2, type='lin', **kwargs)[source]#

Bases: Profile

Creates a profile object to be used with a snapshot inclined by some known angle to the xy plane.

In addition to the SimSnap object, it also requires the angle to initialize.

Example:

>>> s = pynbody.load('sim')
>>> pynbody.analysis.angmom.faceon(s)
>>> s.rotate_x(60)
>>> p = pynbody.profile.InclinedProfile(s, 60)

Methods

create_particle_array(profile_name[, ...])

Create a particle array with the results of the profile calculation.

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.

profile_property

__init__(sim, angle, load_from_file=False, ndim=2, type='lin', **kwargs)[source]#
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.