mcfacts.objects.agnobject

Classes

AGNBinaryBlackHole([mass_1, mass_2, ...])

An array of binary black holes.

AGNBinaryStar([star_mass1, star_mass2, ...])

An array of binary stars. Should include all objects of this type. No other objects should include objects of this type. Properties of this class: * scalar properties of each star: masses, radius, Y,Z (star_mass1,star_mass2, star_radius1, star_radius2, ...) * vector properties of each star: individual angular momentum vectors (spin1,spin_angle_1) relative to the z axis of the binary orbit, not SMBH * orbit properties: use a reduced mass hamiltonian, you have 'r = r2 - r1' (vector) for which we get bin_a, bin_e, bin_inc (relative to SMBH).

AGNBlackHole([mass, gw_freq, gw_strain, bh_num])

A subclass of AGNObject for single black holes.

AGNDisruptedStar([id_num_star, id_num_bh, ...])

Array of disrupted stars with BH parameters.

AGNFilingCabinet(id_num, category, orb_a, ...)

Master catalog of all objects in the disk.

AGNImmortalStar([mass, mass_initial, ...])

A subclass of AGNObject for immortal stars.

AGNMergedBlackHole([id_num, galaxy, ...])

Array of merged black holes.

AGNMergedStar([id_num, galaxy, orb_a_final, ...])

Array of merged stars.

AGNObject([mass, spin, spin_angle, orb_a, ...])

A superclass that holds parameters that apply to all objects in McFacts.

AGNStar([mass, log_radius, log_luminosity, ...])

A subclass of AGNObject for single stars.

class mcfacts.objects.agnobject.AGNBinaryBlackHole(mass_1=array([], dtype=float64), mass_2=array([], dtype=float64), orb_a_1=array([], dtype=float64), orb_a_2=array([], dtype=float64), spin_1=array([], dtype=float64), spin_2=array([], dtype=float64), spin_angle_1=array([], dtype=float64), spin_angle_2=array([], dtype=float64), bin_sep=array([], dtype=float64), bin_orb_a=array([], dtype=float64), time_to_merger_gw=array([], dtype=float64), flag_merging=array([], dtype=float64), time_merged=array([], dtype=float64), bin_ecc=array([], dtype=float64), gen_1=array([], dtype=float64), gen_2=array([], dtype=float64), bin_orb_ang_mom=array([], dtype=float64), bin_orb_inc=array([], dtype=float64), bin_orb_ecc=array([], dtype=float64), gw_freq=array([], dtype=float64), gw_strain=array([], dtype=float64), galaxy=array([], dtype=float64), bin_bh_num=0, id_num=array([], dtype=float64))

An array of binary black holes. Should include all objects of this type. No other objects should contain objects of this type.

Create an instance of AGNBinaryBlackHole

Parameters:
  • mass_1 (numpy array) – mass of object 1 in Msun

  • mass_2 (numpy array) – mass of object 2 in Msun

  • orb_a_1 (numpy array) – orbital semi-major axis of object 1 wrt SMBH in R_g

  • orb_a_2 (numpy array) – orbital semi-major axis of object 2 wrt SMBH in R_g

  • spin_1 (numpy array) – dimensionless spin magnitude of object 1

  • spin_2 (numpy array) – dimensionless spin magnitude of object 2

  • spin_angle_1 (numpy array) – spin angle of object 1 wrt disk gas in radians

  • spin_angle_2 (numpy array) – spin angle of object 2 wrt disk gas in radians

  • bin_sep (numpy array) – separation of binary in R_g (semi-major axis around center of mass)

  • bin_orb_a (numpy array) – semi-major axis of the binary’s center of mass wrt SMBH in R_g (location in disk)

  • time_to_merger_gw (numpy array) – time until binary will merge through GW alone

  • flag_merging (numpy array of ints) – flag for if binary is merging this timestep (-2 if merging, 0 else)

  • time_merged (numpy array) – time the binary merged (for things that already merged)

  • bin_ecc (numpy array) – eccentricity of the binary around the center of mass

  • gen_1 (numpy array of ints) – generation of object 1 (1 = natal black hole, no prior mergers)

  • gen_2 (numpy array of ints) – generation of object 2 (1 = natal black hole, no prior mergers)

  • bin_orb_ang_mom (numpy array) – angular momentum of the binary wrt SMBH (+1 prograde / -1 retrograde)

  • bin_orb_inc (numpy array) – orbital inclination of the binary wrt SMBH

  • bin_orb_ecc (numpy array) – orbital eccentricity of the binary wrt SMBH

  • gw_freq (numpy array) – GW frequency of binary nu_gw = 1./pi * sqrt(G * M_bin / bin_sep^3)

  • gw_strain (numpy array) – GW strain of binary h = (4/d_obs) *(GM_chirp/c^2)*(pi*nu_gw*GM_chirp/c^3)^(2/3) where m_chirp =(M_1 M_2)^(3/5) /(M_bin)^(1/5) For local distances, approx d=cz/H0 = 3e8m/s(z)/70km/s/Mpc =3.e8 (z)/7e4 Mpc =428 Mpc assume 1Mpc = 3.1e22m. From Ned Wright’s calculator (https://www.astro.ucla.edu/~wright/CosmoCalc.html) (z=0.1)=421Mpc. (z=0.5)=1909 Mpc

  • id_num (numpy array) – unique ID numbers

  • bin_bh_num (int) – number of binaries

add_binaries(new_mass_1=array([], dtype=float64), new_mass_2=array([], dtype=float64), new_orb_a_1=array([], dtype=float64), new_orb_a_2=array([], dtype=float64), new_spin_1=array([], dtype=float64), new_spin_2=array([], dtype=float64), new_spin_angle_1=array([], dtype=float64), new_spin_angle_2=array([], dtype=float64), new_bin_sep=array([], dtype=float64), new_bin_orb_a=array([], dtype=float64), new_time_to_merger_gw=array([], dtype=float64), new_flag_merging=array([], dtype=float64), new_time_merged=array([], dtype=float64), new_bin_ecc=array([], dtype=float64), new_gen_1=array([], dtype=float64), new_gen_2=array([], dtype=float64), new_bin_orb_ang_mom=array([], dtype=float64), new_bin_orb_inc=array([], dtype=float64), new_bin_orb_ecc=array([], dtype=float64), new_gw_freq=array([], dtype=float64), new_gw_strain=array([], dtype=float64), new_id_num=array([], dtype=float64), new_galaxy=array([], dtype=float64), new_bin_bh_num=0)

Creates an instance of the AGNBinaryBlackHole class.

Parameters:
  • new_mass_1 (numpy array) – mass of object 1 in Msun

  • new_mass_2 (numpy array) – mass of object 2 in Msun

  • new_orb_a_1 (numpy array) – orbital semi-major axis of object 1 wrt SMBH in R_g

  • new_orb_a_2 (numpy array) – orbital semi-major axis of object 2 wrt SMBH in R_g

  • new_spin_1 (numpy array) – dimensionless spin magnitude of object 1

  • new_spin_2 (numpy array) – dimensionless spin magnitude of object 2

  • new_spin_angle_1 (numpy array) – spin angle of object 1 wrt disk gas in radians

  • new_spin_angle_2 (numpy array) – spin angle of object 2 wrt disk gas in radians

  • new_bin_sep (numpy array) – separation of binary in R_g (semi-major axis around center of mass)

  • new_bin_orb_a (numpy array) – semi-major axis of the binary’s center of mass wrt SMBH in R_g (location in disk)

  • new_time_to_merger_gw (numpy array) – time until binary will merge through GW alone

  • new_flag_merging (numpy array of ints) – flag for if binary is merging this timestep (-2 if merging, 0 else)

  • new_time_merged (numpy array) – time the binary merged (for things that already merged)

  • new_bin_ecc (numpy array) – eccentricity of the binary around the center of mass

  • new_gen_1 (numpy array of ints) – generation of object 1 (1 = natal black hole, no prior mergers)

  • new_gen_2 (numpy array of ints) – generation of object 2 (1 = natal black hole, no prior mergers)

  • new_bin_orb_ang_mom (numpy array) – angular momentum of the binary wrt SMBH (+1 prograde / -1 retrograde)

  • new_bin_orb_inc (numpy array) – orbital inclination of the binary wrt SMBH

  • new_bin_orb_ecc (numpy array) – orbital eccentricity of the binary wrt SMBH

  • new_gw_freq (numpy array) – GW frequency of binary

  • new_gw_strain (numpy array) – GW strain of binary

  • new_id_num (numpy array) – unique ID numbers

  • new_bin_bh_num (int) – number of binaries to add

property mass_total

Return the total mass

Returns:

id – The maximum id created up until now

Return type:

int

class mcfacts.objects.agnobject.AGNBinaryStar(star_mass1=None, star_mass2=None, star_log_radius1=None, star_log_radius2=None, star_Y1=None, star_Y2=None, star_Z1=None, star_Z2=None, bin_e=None, bin_a=None, bin_inc=None, cm_orb_a=None, cm_orb_inc=None, cm_orb_ecc=None, obj_num=None, **kwargs)

An array of binary stars. Should include all objects of this type. No other objects should include objects of this type. Properties of this class:

  • scalar properties of each star: masses, radius, Y,Z (star_mass1,star_mass2, star_radius1, star_radius2, …)

  • vector properties of each star: individual angular momentum vectors (spin1,spin_angle_1) relative to the z axis of the binary orbit, not SMBH

  • orbit properties: use a reduced mass hamiltonian, you have ‘r = r2 - r1’ (vector) for which we get bin_a, bin_e, bin_inc (relative to SMBH)

Creates an instance of the AGNObject class.

Parameters:
  • mass (numpy array) – masses in Msun

  • spin (numpy array) – spins

  • spin_angle (numpy array) – spin angles in radians

  • orb_a (numpy array) – orbital semi-major axis with respect to the SMBH in R_g

  • orb_inc (numpy array) – orbital inclination with respect to the SMBH

  • orb_ang_mom (numpy array) – orbital angular momentum with respect to the SMBH

  • orb_ecc (numpy array) – orbital eccentricity with respect to the SMBH

  • orb_arg_periapse (numpy array) – argument of the orbital periapse with respect to the SMBH set to -1 if not otherwise set. currently used only for retros

  • galaxy (numpy array) – galaxy iteration

  • time_passed (numpy array) – time passed

  • obj_num (int, optional) – number of objects, by default 0

  • id_start_val (numpy array) – ID numbers for the objects, by default 0

class mcfacts.objects.agnobject.AGNBlackHole(mass=array([], dtype=float64), gw_freq=array([], dtype=float64), gw_strain=array([], dtype=float64), bh_num=0, **kwargs)

A subclass of AGNObject for single black holes. It extends AGNObject and adds attributes for GW frequency and strain. This is only relevant for EMRIs and BBH, so if a value is not passed these attributes are set to -1.5. AGNBlackHole also calculates orbital angular momentum for black holes.

Creates an instance of AGNBlackHole object.

Parameters:
__repr__()

Creates a string representation of AGNBlackHole. Prints out the number of black holes present in this instance of AGNBlackHole.

Returns:

totals – number of black holes in AGNBlackHole

Return type:

str

add_blackholes(new_mass=array([], dtype=float64), new_gw_freq=array([], dtype=float64), new_gw_strain=array([], dtype=float64), bh_num=0, **kwargs)

Append black holes to the AGNBlackHole object.

Parameters:

obj_num (int, optional) – number of black holes to be added, by default None

class mcfacts.objects.agnobject.AGNDisruptedStar(id_num_star=array([], dtype=float64), id_num_bh=array([], dtype=float64), galaxy=array([], dtype=float64), orb_a_star=array([], dtype=float64), orb_a_bh=array([], dtype=float64), mass_star=array([], dtype=float64), mass_bh=array([], dtype=float64), gen_star=array([], dtype=float64), gen_bh=array([], dtype=float64), orb_inc_star=array([], dtype=float64), orb_inc_bh=array([], dtype=float64), orb_ecc_star=array([], dtype=float64), orb_ecc_bh=array([], dtype=float64), star_log_radius=array([], dtype=float64), time_sn=array([], dtype=float64), num_obj_disrupt=0)

Array of disrupted stars with BH parameters.

Creates an instance of AGNDisruptedStar.

Parameters:
  • id_num_star (numpy array) – ID number of disrupted star

  • id_num_bh (numpy array) – ID number of BH that interacted with star

  • galaxy (numpy array) – galaxy (iteration)

  • orb_a_star (numpy array) – orbital semi-major axis of star wrt SMBH in R_g

  • orb_a_bh (numpy array) – orbital semi-major axis of BH wrt SMBH in R_g

  • mass_star (numpy array) – mass of star in Msun

  • mass_bh (numpy array) – mass of BH in Msun

  • gen_star (numpy array) – generation of star

  • gen_bh (numpy array) – generation of BH

  • orb_inc_star (numpy array) – orbital inclination of star

  • orb_inc_bh (numpy array) – orbital inclination of BH

  • orb_ecc_star (numpy array) – orbital eccentricity of star wrt SMBH

  • orb_ecc_bh (numpy array) – orbital eccentricity of BH wrt SMBH

  • star_log_radius (numpy array) – Log radius of star in Rsun

  • time_sn (numpy array) – the timestep of explosion

  • num_obj_disrupt (int) – number of objects

add_stars(new_id_num_star=array([], dtype=float64), new_id_num_bh=array([], dtype=float64), new_galaxy=array([], dtype=float64), new_orb_a_star=array([], dtype=float64), new_orb_a_bh=array([], dtype=float64), new_mass_star=array([], dtype=float64), new_mass_bh=array([], dtype=float64), new_gen_star=array([], dtype=float64), new_gen_bh=array([], dtype=float64), new_orb_inc_star=array([], dtype=float64), new_orb_inc_bh=array([], dtype=float64), new_orb_ecc_star=array([], dtype=float64), new_orb_ecc_bh=array([], dtype=float64), new_star_log_radius=array([], dtype=float64), new_time_sn=array([], dtype=float64), num_obj_disrupt=0)

Add stars to the AGNMergedStar object

Parameters:
  • new_galaxy (numpy array) – galaxy (iteration)

  • new_id_num_star (numpy array) – ID number of disrupted star

  • new_id_num_bh (numpy array) – ID number of BH that interacted with star

  • new_orb_a_star (numpy array) – Semi-major axis of disrupted star wrt SMBH in R_g

  • new_orb_a_bh (numpy array) – Semi-major axis of BH wrt SMBH in R_g

  • new_mass_star (numpy array) – Mass [M_sun] of disrupted star

  • new_mass_bh (numpy array) – Mass [M_sun] of BH

  • new_gen_star (numpy array) – Generation of disrupted star

  • new_gen_bh (numpy array) – Generation of BH

  • new_orb_inc_star (numpy array) – Orbital inclination of star wrt SMBH

  • new_orb_inc_bh (numpy array) – Orbital inclination of BH wrt SMBH

  • new_orb_ecc_star (numpy array) – Orbital eccentricity of star wrt SMBH

  • new_orb_ecc_bh (numpy array) – Orbital eccentricity of BH wrt SMBH

  • new_star_log_radius (numpy array) – Log radius [R_sun] of star

  • new_time_sn (numpy array) – Time of explosion

  • num_obj_disrupt (int) – Number of objects

class mcfacts.objects.agnobject.AGNFilingCabinet(id_num, category, orb_a, mass, orb_ecc, size, direction=None, disk_inner_outer=None, fc_num=0)

Master catalog of all objects in the disk. Each object has a unique ID number, type, and orbital direction. Currently it also takes in all parameters present in AGNObject, but these are not updated when the instances of AGNBlackHole and AGNStar are updated.

Creates an instance of AGNFilingCabinet. It extends AGNObject by recording ID numbers for each object and their category, so that they can be easily found in their respective AGNObjects.

Parameters:
  • id_num (numpy array) – ID numbers of the objects

  • category (numpy array of ints) – category (black hole, star, etc.) of the objects

  • orb_a (numpy array) – orbital semi-major axis [r_{g,SMBH}] with respect to the SMBH

  • mass (numpy array) – masses [Msun] of the objects (for binaries this is total mass)

  • orb_ecc (numpy.ndarray) – Orbital eccentricity with respect to the SMBH

  • size (numpy array) – for BH this is set to -1.5, for stars this is set to the stellar radius in R_g, for binaries this is the binary’s semi-major axis (aka separation) in R_g in R_g

  • direction (numpy array) – direction of the orbit of the objects, optional

  • disk_inner_outer (numpy array) – if the object is in the inner or outer disk

__repr__()

Creates a string representation of AGNFilingCabinet. Prints out the number and types of objects present in AGNFilingCabinet and their direction (prograde, retrograde, or undetermined). Not currently working.

Returns:

totals – number and types of objects in AGNFilingCabinet

Return type:

str

add_objects(new_id_num, new_category, new_orb_a, new_mass, new_orb_ecc, new_size, new_direction, new_disk_inner_outer, fc_num=0)

Append objects to the AGNFilingCabinet.

Parameters:
  • new_id_num (numpy array) – ID numbers to be added

  • new_category (numpy array) – categories to be added

  • new_orb_a (numpy array) – orbital semi-major axes to be added

  • new_mass (numpy array) – masses to be added

  • new_orb_ecc (numpy array) – new orbital eccentricities to be added

  • new_size (numpy array) – sizes to be added (BH: -1, stars: radii in Rsun, binaries: separation in R_g)

  • new_direction (numpy array) – orbital directions of objects to be added

  • new_disk_inner_outer (numpy array) – new inner/outer disk locations to be added

  • fc_num (int) – number of objects to be added

property id_max

Return the maximum id which has been created up to this point

Returns:

id – The maximum id created up until now

Return type:

int

update(id_num, attr, new_info)

Update a given attribute in AGNFilingCabinet for the given ID numbers

Parameters:
  • id_num (numpy array) – ID numbers of the objects to be changed

  • attr (str) – the attribute to be changed

  • new_info (numpy array) – the new data for the attribute

class mcfacts.objects.agnobject.AGNImmortalStar(mass=array([], dtype=float64), mass_initial=array([], dtype=float64), orb_a_initial=array([], dtype=float64), log_radius=array([], dtype=float64), log_luminosity=array([], dtype=float64), log_teff=array([], dtype=float64), star_X=array([], dtype=float64), star_Y=array([], dtype=float64), star_Z=array([], dtype=float64), source=array([], dtype=float64), star_num=0, **kwargs)

A subclass of AGNObject for immortal stars. It extends AGNObject by adding attributes for mass, radius, chemical composition, and initial mass.

Creates an instance of the AGNStar class. This is a subclass

of the AGNObject class. AGNStar adds additional star-specific parameters to the AGNObject. It calculates orbital angular momentum for stars.

Parameters:
  • mass (numpy array) – star mass

  • mass_initial (numpy array) – initial star mass

  • orb_a (numpy array) – star orbital semi-major axis with respect to the SMBH

  • orb_a_initial (numpy array) – initial star orbital semi-major axis with respect to the SMBH

  • radius (numpy array) – log of star radius in Rsun

  • orb_inc (numpy array) – star orbital inclination with respect to the SMBH

  • star_Y (numpy array) – helium fraction of stars

  • star_Z (numpy array) – metals fraction of stars

  • source (numpy array) – how the star becomes immortal 0: accretion. 1: merger.

  • star_num (int, optional) – number of stars, by default 0

  • smbh_mass (float) – mass of the SMBH

__repr__()

Creates a string representation of AGNStar. Prints out the number of stars present in this instance of AGNStar.

Returns:

totals – number of stars in AGNStar

Return type:

str

add_stars(new_mass_initial=array([], dtype=float64), new_orb_a_initial=array([], dtype=float64), new_log_radius=array([], dtype=float64), new_log_luminosity=array([], dtype=float64), new_log_teff=array([], dtype=float64), new_X=array([], dtype=float64), new_Y=array([], dtype=float64), new_Z=array([], dtype=float64), new_source=array([], dtype=float64), star_num=0, **kwargs)

Append new stars to the end of AGNStar. This method updates the star specific parameters and then sends the rest to the AGNObject add_objects() method.

Parameters:
  • new_mass_initial (numpy array) – initial masses of new stars

  • new_log_radius (numpy array) – log radii of new stars

  • new_Y (numpy array) – helium mass fraction of new stars

  • new_Z (numpy array) – metals mass fraction of new stars

  • new_source (numpy array) – how the new stars become immortal 0: accretion. 1: merger.

  • obj_num (int, optional) – number of objects to be added, by default None

class mcfacts.objects.agnobject.AGNMergedBlackHole(id_num=array([], dtype=float64), galaxy=array([], dtype=float64), bin_orb_a=array([], dtype=float64), mass_final=array([], dtype=float64), spin_final=array([], dtype=float64), spin_angle_final=array([], dtype=float64), mass_1=array([], dtype=float64), mass_2=array([], dtype=float64), spin_1=array([], dtype=float64), spin_2=array([], dtype=float64), spin_angle_1=array([], dtype=float64), spin_angle_2=array([], dtype=float64), gen_1=array([], dtype=float64), gen_2=array([], dtype=float64), chi_eff=array([], dtype=float64), chi_p=array([], dtype=float64), v_kick=array([], dtype=float64), mass_1_20Hz=array([], dtype=float64), mass_2_20Hz=array([], dtype=float64), spin_1_20Hz=array([], dtype=float64), spin_2_20Hz=array([], dtype=float64), lum_shock=array([], dtype=float64), lum_jet=array([], dtype=float64), time_merged=array([], dtype=float64), num_obj_merge=0)

Array of merged black holes.

Creates an instance of AGNMergedBlackHole.

Parameters:
  • galaxy (numpy array) – galaxy (iteration)

  • bin_orb_a (numpy array) – orbital semi-major axis of binary wrt SMBH prior to merger in R_g

  • mass_final (numpy array) – mass post-merger in Msun

  • spin_final (numpy array) – spin post-merger

  • spin_angle_final (numpy array) – spin angle post-merger in radians

  • mass_1 (numpy array) – mass of the first component prior to merger in Msun

  • mass_2 (numpy array) – mass of the second component prior to merger in Msun

  • spin_1 (numpy array) – spin of the first component prior to merger

  • spin_2 (numpy array) – spin of the second component prior to merger

  • spin_angle_1 (numpy array) – spin angle of the first component prior to merger in radians

  • spin_angle_2 (numpy array) – spin angle of the second component prior to merger in radians

  • gen_1 (numpy array) – merger generation of the first component

  • gen_2 (numpy array) – merger generation of the second component

  • chi_eff (numpy array) – effective spin prior to merger

  • chi_p (numpy array) – precessing spin component of the binary prior to merger

  • v_kick (numpy array) – kick velocity [km/s] of the remnant BH

  • mass_1_20Hz (numpy array) – mass of the first component prior to merger in Msun taken once the binary inspiral reaches 20Hz

  • mass_2_20Hz (numpy array) – mass of the second component prior to merger in Msun taken once the binary inspiral reaches 20Hz

  • spin_1_20Hz (numpy array) – spin of the first component prior to merger taken once the binary inspiral reaches 20Hz

  • spin_2_20Hz (numpy array) – spin of the second component prior to merger taken once the binary inspiral reaches 20Hz

  • lum_shock (numpy array) – estimated shock luminosity generated post-merger in erg/s

  • lum_jet (: numy array) – estimated jet (Bondi-Hoyle) luminosity post-merger in erg/s

  • time_merged (numpy array) – the timestep of merger

  • num_obj_merge (int) – number of objects

add_blackholes(new_id_num=array([], dtype=float64), new_galaxy=array([], dtype=float64), new_bin_orb_a=array([], dtype=float64), new_mass_final=array([], dtype=float64), new_spin_final=array([], dtype=float64), new_spin_angle_final=array([], dtype=float64), new_mass_1=array([], dtype=float64), new_mass_2=array([], dtype=float64), new_spin_1=array([], dtype=float64), new_spin_2=array([], dtype=float64), new_spin_angle_1=array([], dtype=float64), new_spin_angle_2=array([], dtype=float64), new_gen_1=array([], dtype=float64), new_gen_2=array([], dtype=float64), new_chi_eff=array([], dtype=float64), new_chi_p=array([], dtype=float64), new_v_kick=array([], dtype=float64), new_mass_1_20Hz=array([], dtype=float64), new_mass_2_20Hz=array([], dtype=float64), new_spin_1_20Hz=array([], dtype=float64), new_spin_2_20Hz=array([], dtype=float64), new_lum_shock=array([], dtype=float64), new_lum_jet=array([], dtype=float64), new_time_merged=array([], dtype=float64), num_obj_merge=0)

Add blackholes to the AGNMergedBlackHoles object

Parameters:
  • new_galaxy (numpy array) – galaxy (iteration)

  • new_bin_orb_a (numpy array) – orbital semi-major axis of binary wrt SMBH prior to merger in R_g

  • new_mass_final (numpy array) – mass post-merger in Msun

  • new_spin_final (numpy array) – spin post-merger

  • new_spin_angle_final (numpy array) – spin angle post-merger in radians

  • new_mass_1 (numpy array) – mass of the first component prior to merger in Msun

  • new_mass_2 (numpy array) – mass of the second component prior to merger in Msun

  • new_spin_1 (numpy array) – spin of the first component prior to merger

  • new_spin_2 (numpy array) – spin of the second component prior to merger

  • new_spin_angle_1 (numpy array) – spin angle of the first component prior to merger in radians

  • new_spin_angle_2 (numpy array) – spin angle of the second component prior to merger in radians

  • new_gen_1 (numpy array) – merger generation of the first component

  • new_gen_2 (numpy array) – merger generation of the second component

  • new_chi_eff (numpy array) – effective spin prior to merger

  • new_chi_p (numpy array) – precessing spin component of the binary prior to merger

  • new_v_kick (numpy array) – kick velocity [km/s] of the remnant BH

  • new_mass_1_20Hz (numpy array) – mass of the first component prior to merger in Msun taken once the binary inspiral reaches 20Hz

  • new_mass_2_20Hz (numpy array) – mass of the second component prior to merger in Msun taken once the binary inspiral reaches 20Hz

  • new_spin_1_20Hz (numpy array) – spin of the first component prior to merger taken once the binary inspiral reaches 20Hz

  • new_spin_2_20Hz (numpy array) – spin of the second component prior to merger taken once the binary inspiral reaches 20Hz

  • lum_shock (numpy array) – estimated shock luminosity generated post-merger in erg/s

  • new_lum_jet (numpy array) – estimated jet (Bondi-Hoyle) luminosity generated post-merger in erg/s

  • new_time_merged (numpy array) – the timestep of merger

  • num_obj_merge (int) – number of objects to be added

class mcfacts.objects.agnobject.AGNMergedStar(id_num=array([], dtype=float64), galaxy=array([], dtype=float64), orb_a_final=array([], dtype=float64), mass_final=array([], dtype=float64), gen_final=array([], dtype=float64), mass_1=array([], dtype=float64), mass_2=array([], dtype=float64), gen_1=array([], dtype=float64), gen_2=array([], dtype=float64), log_radius_final=array([], dtype=float64), orb_ecc=array([], dtype=float64), time_merged=array([], dtype=float64), num_obj_merge=0)

Array of merged stars.

Creates an instance of AGNMergedBlackHole.

Parameters:
  • galaxy (numpy array) – galaxy (iteration)

  • orb_a_final (numpy array) – orbital semi-major axis of merged star post-merger wrt SMBH in R_g

  • mass_final (numpy array) – mass post-merger in Msun

  • gen_final (numpy array) – final generation of merged star

  • mass_1 (numpy array) – mass of the first component prior to merger in Msun

  • mass_2 (numpy array) – mass of the second component prior to merger in Msun

  • gen_1 (numpy array) – merger generation of the first component

  • gen_2 (numpy array) – merger generation of the second component

  • log_radius_final (numpy array) – log radius [Rsun] of the star post-merger

  • orb_ecc (numpy array) – orbital eccentricity of the star post-merger wrt SMBH

  • time_merged (numpy array) – the timestep of merger

  • num_obj_merge (int) – number of objects

add_stars(new_id_num=array([], dtype=float64), new_galaxy=array([], dtype=float64), new_orb_a_final=array([], dtype=float64), new_gen_final=array([], dtype=float64), new_mass_final=array([], dtype=float64), new_mass_1=array([], dtype=float64), new_mass_2=array([], dtype=float64), new_gen_1=array([], dtype=float64), new_gen_2=array([], dtype=float64), new_log_radius_final=array([], dtype=float64), new_orb_ecc=array([], dtype=float64), new_time_merged=array([], dtype=float64), num_obj_merge=0)

Add stars to the AGNMergedStar object

Parameters:
  • new_galaxy (numpy array) – galaxy (iteration)

  • new_orb_a_final (numpy array) – orbital semi-major axis of merged star wrt SMBH post-merger in R_g

  • new_mass_final (numpy array) – mass post-merger in Msun

  • new_gen_final (numpy array) – final generation of merged star

  • new_mass_1 (numpy array) – mass of the first component prior to merger in Msun

  • new_mass_2 (numpy array) – mass of the second component prior to merger in Msun

  • new_gen_1 (numpy array) – merger generation of the first component

  • new_gen_2 (numpy array) – merger generation of the second component

  • new_log_radius_final (numpy array) – log radius [Rsun] of the star post-merger

  • new_orb_ecc (numpy array) – orbital eccentricity of the star post-merger wrt SMBH

  • new_time_merged (numpy array) – the timestep of merger

  • num_obj_merge (int) – number of objects to be added

class mcfacts.objects.agnobject.AGNObject(mass=array([], dtype=float64), spin=array([], dtype=float64), spin_angle=array([], dtype=float64), orb_a=array([], dtype=float64), orb_inc=array([], dtype=float64), orb_ang_mom=array([], dtype=float64), orb_ecc=array([], dtype=float64), orb_arg_periapse=array([], dtype=float64), galaxy=array([], dtype=float64), time_passed=array([], dtype=float64), obj_num=0, id_start_val=0)

A superclass that holds parameters that apply to all objects in McFacts. It is formatted as an object full of arrays. Dimensions of arrays must match the number of objects in the class. No instances of the AGNObject class should be created, it is a superclass to the AGNStar, AGNBlackHole, etc. classes. All orbital attributes to this class are with respect to the central SMBH. if the subclass is a Binary object, then attributes are for the total quantities (total mass, etc.), not the binary components.

Creates an instance of the AGNObject class.

Parameters:
  • mass (numpy array) – masses in Msun

  • spin (numpy array) – spins

  • spin_angle (numpy array) – spin angles in radians

  • orb_a (numpy array) – orbital semi-major axis with respect to the SMBH in R_g

  • orb_inc (numpy array) – orbital inclination with respect to the SMBH

  • orb_ang_mom (numpy array) – orbital angular momentum with respect to the SMBH

  • orb_ecc (numpy array) – orbital eccentricity with respect to the SMBH

  • orb_arg_periapse (numpy array) – argument of the orbital periapse with respect to the SMBH set to -1 if not otherwise set. currently used only for retros

  • galaxy (numpy array) – galaxy iteration

  • time_passed (numpy array) – time passed

  • obj_num (int, optional) – number of objects, by default 0

  • id_start_val (numpy array) – ID numbers for the objects, by default 0

add_objects(new_mass=array([], dtype=float64), new_spin=array([], dtype=float64), new_spin_angle=array([], dtype=float64), new_orb_a=array([], dtype=float64), new_orb_inc=array([], dtype=float64), new_orb_ang_mom=array([], dtype=float64), new_orb_ecc=array([], dtype=float64), new_orb_arg_periapse=array([], dtype=float64), new_gen=array([], dtype=float64), new_galaxy=array([], dtype=float64), new_time_passed=array([], dtype=float64), new_id_num=array([], dtype=float64), obj_num=0)

Append new objects to the AGNObject. This method is not called directly, it is only called by the subclasses’ add methods.

Parameters:
  • new_mass (numpy array) – masses to be added

  • new_spin (numpy array) – spins to be added

  • new_spin_angle (numpy array) – spin angles to be added

  • new_orb_a (numpy array) – semi-major axes to be added

  • new_orb_inc (numpy array) – orbital inclinations to be added

  • new_orb_ang_mom (numpy array) – orbital angular momentum to be added

  • new_orb_ecc (numpy array) – orbital eccentricities to be added

  • new_orb_arg_periapse (numpy array) – orbital arguments of the periapse to be added

  • new_gen (numpy array) – generations to be added

  • new_galaxy (numpy array) – galaxy iteration to be added, set to -1 if not passed

  • new_time_passed (numpy array) – time passed to be added, set to -1 if not passed

  • new_id_num (numpy array,optional) – ID numbers to be added

  • obj_num (int, optional) – Number of objects to be added.

at_id_num(id_num, attr=None)

Returns the attribute at the specified ID numbers

Parameters:
  • id_num (numpy array or float) – ID numbers of objects to return

  • attr (str) – attribute to return

Returns:

val – specified attribute at specified ID numbers

Return type:

numpy array

check_consistency()

Prints the size of each attribute to check that everything is consistent. Raises an AttributeError if all arrays do not have the same length.

copy()

Creates a deep copy of the AGNObject

Parameters:

None

Returns:

copied_object – new copy of AGNObject with no references to original AGNObject

Return type:

AGNObject

init_from_file(fname=None)
Reads in file from previous AGNObject.

Not fully implemented. Would need to init AGNObject and then read from file?

Parameters:

fname (str) – file to read in

keep_id_num(id_num_keep)

Filters AGNObject to only keep the objects at the specified ID numbers

Parameters:

id_num_keep (numpy array) – ID numbers to keep, others are removed

keep_index(idx_keep)

Filters AGNObject to only keep the objects at the specified indices.

Parameters:

idx_keep (numpy array) – indices to keep, others are removed.

remove_id_num(id_num_remove=None)

Filters AGNObject to remove the objects at the specified ID numbers

Parameters:

id_num_keep (numpy array) – ID numbers to keep, others are removed

remove_index(idx_remove=None)

Removes objects at specified indices.

Parameters:

idx_remove (numpy array) – indices to remove

return_params()

Gets list of parameters present in object.

Parameters:

None

Returns:

parameters in object

Return type:

list

return_record_array()

Returns a numpy dictionary of all attributes in the AGNObject

Parameters:

None

Returns:

dat_out – dictionary array of all attributes in the AGNObject. Everything is written as a float.

Return type:

numpy dictionary

sort(sort_attr=None)

Sorts all attributes of the AGNObject by the passed attribute

Parameters:

sort_attr (AGNObject attribute array) – array to sort the AGNObject by

to_txt(fname=None, cols=None, extra_header=None)

Loads AGNObject into temporary multi-dim numpy array and then uses np.savetxt to save to file. Avoids the issue of pandas writing non-values as blanks instead of NaNs.

Parameters:
  • fname (str) – filename including path

  • cols (array of str) – array of header names to re-order or cut out columns, optional

  • extra_header (str) – extra information to go a line above the column names, optional

unique_id_nums()

Checks that ID numbers are unique.

class mcfacts.objects.agnobject.AGNStar(mass=array([], dtype=float64), log_radius=array([], dtype=float64), log_luminosity=array([], dtype=float64), log_teff=array([], dtype=float64), star_X=array([], dtype=float64), star_Y=array([], dtype=float64), star_Z=array([], dtype=float64), star_num=0, **kwargs)

A subclass of AGNObject for single stars. It extends AGNObject by adding attributes for mass, radius, and chemical composition.

Creates an instance of the AGNStar class. This is a subclass

of the AGNObject class. AGNStar adds additional star-specific parameters to the AGNObject. It calculates orbital angular momentum for stars.

Parameters:
  • mass (numpy array) – star mass

  • orb_a (numpy array) – star orbital semi-major axis with respect to the SMBH

  • radius (numpy array) – log of star radius in Rsun

  • orb_inc (numpy array) – star orbital inclination with respect to the SMBH

  • star_Y (numpy array) – helium fraction of stars

  • star_Z (numpy array) – metals fraction of stars

  • star_num (int, optional) – number of stars, by default 0

  • smbh_mass (float) – mass of the SMBH

__repr__()

Creates a string representation of AGNStar. Prints out the number of stars present in this instance of AGNStar.

Returns:

totals – number of stars in AGNStar

Return type:

str

add_stars(new_log_radius=array([], dtype=float64), new_log_luminosity=array([], dtype=float64), new_log_teff=array([], dtype=float64), new_X=array([], dtype=float64), new_Y=array([], dtype=float64), new_Z=array([], dtype=float64), star_num=0, **kwargs)

Append new stars to the end of AGNStar. This method updates the star specific parameters and then sends the rest to the AGNObject add_objects() method.

Parameters:
  • new_log_radius (numpy array) – log radii of new stars

  • new_Y (numpy array) – helium mass fraction of new stars

  • new_Z (numpy array) – metals mass fraction of new stars

  • obj_num (int, optional) – number of objects to be added, by default None

mcfacts.objects.agnobject.get_attr_list(obj)

Returns list of array attributes for each type of AGNObject

Parameters:

obj (AGNObject subclass) – Instance of one of the AGNObject subclasses

Returns:

attr_$TYPE – array of names of attributes for each object in obj

Return type:

array of str

mcfacts.objects.agnobject.obj_to_binary_bh_array(obj)

Function to rewrite the AGNBinaryBlackHole object in the same format as the existing binary_bh_array so that the functions still work.

Parameters:

obj (AGNBinaryBlackHole) – binary black hole object

Returns:

binary_bh_array – the same data formatted in the binary_bh_array style

Return type:

numpy array with shape (22, $SIZE)