InitialCMCTable¶
- class cosmic.sample.initialcmctable.InitialCMCTable(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]¶
Bases:
DataFrameAttributes Summary
Methods Summary
InitialCMCBinaries(index, id1, k1, m1, ...)Create A Table of CMC Binaries
InitialCMCSingles(id_idx, k, m, Reff, r, vr, ...)Create A Table of CMC Singles
ScaleCentralBHMass(Mtotal)Rescale the central BH mass; needed since this is a class attribute Parameters ----------
ScaleToNBodyUnits(Singles, Binaries[, ...])Rescale the single masses, radii, and velocities into N-body units
read(filename)Read Singles and Binaries to HDF5 or FITS file
sampler(format_, *args, **kwargs)Fetch a method to generate an initial binary sample
write(Singles, Binaries[, filename])Save Singles and Binaries to HDF5 or FITS file
Attributes Documentation
Methods Documentation
- classmethod InitialCMCBinaries(index, id1, k1, m1, Reff1, id2, k2, m2, Reff2, a, e)[source]¶
Create A Table of CMC Binaries
- Parameters:
- m1float
Primary mass [Msun]
- m2float
Secondary mass [Msun]
- porbfloat
Orbital period [days]
- eccfloat
Eccentricity
- kstar1array
0-14 Initial stellar type of the larger object; main sequence stars are 0 if m < 0.7 Msun and 1 otherwise
- kstar2array
0-14 Initial stellar type of the smaller object; main sequence stars are 0 if m < 0.7 Msun and 1 otherwise
- metallicityfloat
Metallicity of the binaries; Z_sun = 0.02
- **kwargs
- binfracfloat
System-specific probability of the primary star being in a binary
- Returns:
- InitialBinariesDataFrame
Single binary initial conditions
- classmethod InitialCMCSingles(id_idx, k, m, Reff, r, vr, vt, binind)[source]¶
Create A Table of CMC Singles
- Parameters:
- m1float
Primary mass [Msun]
- m2float
Secondary mass [Msun]
- porbfloat
Orbital period [days]
- eccfloat
Eccentricity
- kstar1array
0-14 Initial stellar type of the larger object; main sequence stars are 0 if m < 0.7 Msun and 1 otherwise
- kstar2array
0-14 Initial stellar type of the smaller object; main sequence stars are 0 if m < 0.7 Msun and 1 otherwise
- metallicityfloat
Metallicity of the binaries; Z_sun = 0.02
- **kwargs
- binfracfloat
System-specific probability of the primary star being in a binary
- Returns:
- InitialBinariesDataFrame
Single binary initial conditions
- ScaleCentralBHMass(Mtotal)[source]¶
Rescale the central BH mass; needed since this is a class attribute Parameters ———-
- Mtotalfloat
total mass of the cluster
- classmethod ScaleToNBodyUnits(Singles, Binaries, virial_radius=1, central_bh=0, scale_with_central_bh=False)[source]¶
- Rescale the single masses, radii, and velocities into N-body units
- i.e. sum m = M = 1
Kinetic Energy = 0.25 Potential Energy = -0.5
Note that this is already done for r, vr, and vt from the profile generators. However, after the stellar masses are assigned we need to redo it, and the stellar radii and seperations need to be converted from RSUN to code units
- Parameters:
- SinglesDataFrame
Pandas DataFrame from the InitialCMCSingles function
- BinariesDataFrame
Pandas DataFrame from the InitialCMCSingles function
- virial_radiusfloat
Virial radius of the cluster in parsec (default 1pc)
- Returns:
- None: Pandas dataframes are modified in place
- classmethod read(filename)[source]¶
Read Singles and Binaries to HDF5 or FITS file
- Parameters:
- filename(str)
Must end in “.fits” or “.hdf5/h5”
- Returns:
- SinglesDataFrame
Pandas DataFrame from the InitialCMCSingles function
- BinariesDataFrame
Pandas DataFrame from the InitialCMCBinaries function
- classmethod sampler(format_, *args, **kwargs)[source]¶
Fetch a method to generate an initial binary sample
- Parameters:
- formatstr
the method name; Choose from ‘independent’ or ‘multidim’
- *args
the arguments necessary for the registered sample method; see help(InitialCMCTable.sampler(‘independent’) to see the arguments necessary for the independent sample
- The available named formats are:
- ============== …
Format …
- ============== …
cmc …
- cmc_point_mass …
- ============== …
- classmethod write(Singles, Binaries, filename='input.hdf5', **kwargs)[source]¶
Save Singles and Binaries to HDF5 or FITS file
- Parameters:
- SinglesDataFrame
Pandas DataFrame from the InitialCMCSingles function
- BinariesDataFrame
Pandas DataFrame from the InitialCMCBinaries function
- filename(str)
Must end in “.fits” or “.hdf5/h5”
- Returns:
- None: