Group Class

class group.Cloud(obj)[source]

Bases: group.Group

Cloud class which has the central boolean.

class group.Galaxy(obj)[source]

Bases: group.Group

Galaxy class which has the central boolean.

class group.Group(obj)[source]

Bases: object

Parent class for halo and galaxy and halo objects.

_assign_local_data()[source]

Assign glist/slist/dmlist/bhlist/dlist for this group. Also sets the ngas/nstar/ndm/nbh/ndust attributes.

_calculate_angular_quantities()[source]

Calculate angular momentum, spin, max_vphi and max_vr.

_calculate_center_of_mass_quantities()[source]

Calculate center-of-mass position and velocity. From caesar_mika

_calculate_gas_quantities()[source]

Calculate gas quantities: SFR/Metallicity/Temperature.

_calculate_masses()[source]

Calculate various total masses.

_calculate_radial_quantities()[source]

Calculate various component radii and half radii

_calculate_star_quantities()[source]

Calculate star quantities: Metallicity, …

_calculate_total_mass()[source]

Calculate the total mass of the object.

_calculate_velocity_dispersions()[source]

Calculate velocity dispersions for the various components.

_calculate_virial_quantities()[source]

Calculates virial quantities such as r200, circular velocity, and virial temperature.

_cleanup()[source]

cleanup function to delete attributes no longer needed

_delete_attribute(a)[source]

Helper method to delete an attribute if present.

_delete_key(d, k)[source]

Helper method to delete a dict key.

_process_group()[source]

Process each group after creation. This entails calculating the total mass, iteratively unbinding (if enabled), then calculating more masses, radial quants, virial quants, velocity dispersions, angular quants, and final gas quants.

_remove_dm_references()[source]

Galaxies/clouds do not have DM, so remove references.

_unbind()[source]

Iterative procedure to unbind objects.

property _valid

Check against the minimum number of particles to see if this object is ‘valid’.

contamination_check(lowres=[2, 3, 5], search_factor=1.0, printer=True)[source]

Check for low resolution particle contamination.

This method checks for low-resolution particles within search_factor of the maximum halo radius. When this method is called on a galaxy, it refers to the parent halo.

Parameters
  • lowres (list, optional) –

    Particle types to be considered low-res. Defaults to [2,3,5]; if your simulation contains blackholes you will want to pass in [2,3]; if your simulation contains active

    dust particles you will not include 3.

  • search_factor (float, optional) – Factor to expand the maximum halo radius search distance by. Default is 2.5

  • printer (boolean, optional) – Print results?

Notes

This method currently ONLY works on GADGET/GIZMO HDF5 files.

info()[source]

Method to quickly print out object attributes.

vtk_vis(rotate=False)[source]

Method to render this group’s points via VTK.

Parameters

rotate (boolean) – Align angular momentum vector with the z-axis before rendering?

Notes

Opens up a pyVTK window; you must have VTK installed to use this method. It is easiest to install via conda install vtk.

write_IC_mask(ic_ds, filename, search_factor=2.5, radius_type='total')[source]

Write MUSIC initial condition mask to disk. If called on a galaxy it will look for the parent halo in the IC.

Parameters
  • ic_ds (yt dataset) – The initial condition dataset via yt.load().

  • filename (str) – The filename of which to write the mask to. If a full path is not supplied then it will be written in the current directory.

  • search_factor (float, optional) – How far from the center to select DM particles. Default is 2.5

  • print_extents (bool, optional) – Print MUSIC extents for cuboid after mask creation

Examples

>>> import yt
>>> import caesar
>>>
>>> snap = 'my_snapshot.hdf5'
>>> ic   = 'IC.dat'
>>>
>>> ds    = yt.load(snap)
>>> ic_ds = yt.load(ic)
>>>
>>> obj = caesar.load('caesar_my_snapshot.hdf5', ds)
>>> obj.galaxies[0].write_IC_mask(ic_ds, 'mymask.txt')
class group.GroupList(name)[source]

Bases: object

Class to hold particle/field index lists.

class group.GroupProperty(source_dict, name)[source]

Bases: object

Class to return default values for the quantities held in the category_mapper dictionaries.

class group.Halo(obj)[source]

Bases: group.Group

Halo class which has the dmlist attribute, and child boolean.

group.create_new_group(obj, group_type)[source]

Simple function to create a new instance of a specified group.Group.

Parameters
  • obj (main.CAESAR) – Main caesar object.

  • group_type ({'halo', 'galaxy','cloud'}) – Which type of group? Options are: halo and galaxy.

Returns

group – Subclass group.Halo or group.Galaxy.

Return type

group.Group