mcfacts.objects.agnobject.AGNMergedBlackHole

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)

Bases: AGNObject

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

__init__(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)

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

Methods

__init__([id_num, galaxy, bin_orb_a, ...])

Creates an instance of AGNMergedBlackHole.

add_blackholes([new_id_num, new_galaxy, ...])

Add blackholes to the AGNMergedBlackHoles object

add_objects([new_mass, new_spin, ...])

Append new objects to the AGNObject.

at_id_num(id_num[, attr])

Returns the attribute at the specified ID numbers

check_consistency()

Prints the size of each attribute to check that everything is consistent.

copy()

Creates a deep copy of the AGNObject

init_from_file([fname])

Reads in file from previous AGNObject.

keep_id_num(id_num_keep)

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

keep_index(idx_keep)

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

remove_id_num([id_num_remove])

Filters AGNObject to remove the objects at the specified ID numbers

remove_index([idx_remove])

Removes objects at specified indices.

return_params()

Gets list of parameters present in object.

return_record_array()

Returns a numpy dictionary of all attributes in the AGNObject

sort([sort_attr])

Sorts all attributes of the AGNObject by the passed attribute

to_txt([fname, cols, extra_header])

Loads AGNObject into temporary multi-dim numpy array and then uses np.savetxt to save to file.

unique_id_nums()

Checks that ID numbers are unique.

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

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.