sub_cluster¶
- clustertools.cluster.cluster.sub_cluster(cluster, rmin=None, rmax=None, mmin=None, mmax=None, vmin=None, vmax=None, emin=None, emax=None, kwmin=0, kwmax=15, npop=None, indx=[None], projected=False, sortstars=True, reset_centre=False, reset_nbody=False, reset_nbody_mass=False, reset_nbody_radii=False, reset_rvirial=False, reset_projected=False, **kwargs)[source]¶
Extract a sub population of stars from a StarCluster
automatically moves cluster to centre of mass, so all constraints are in clustercentric coordinates and current StarCluster.units
- Parameters:
- rmin/rmaxfloat
minimum and maximum stellar radii
- mmin/mmaxfloat
minimum and maximum stellar mass
- vmin/vmaxfloat
minimum and maximum stellar velocity
- emin/emaxfloat
minimum and maximum stellar energy
- kwmin/kwmaxint
minimum and maximum stellar type (kw)
- npopint
population number
- indxbool
user defined boolean array from which to extract the subset
- projectedbool
use projected values and constraints (default:False)
- sortstars: bool
order stars by radius (default: True)
- reset_centrebool
re-calculate cluster centre after extraction (default:False)
- reset_nbodybool
reset nbody scaling factors (default:False)
- reset_nbody_massbool
find new nbody scaling mass (default:False)
- reset_nbody_radiibool
find new nbody scaling radius (default:False)
- reset_rvirialbool
use virial radius to find nbody scaling radius (default: True)
- reset_projectedbool
use projected radii to find nbody scaling radius (default: False)
- Returns:
- StarCluster