amoeba.Classes package

Submodules

amoeba.Classes.accretion_disk module

class amoeba.Classes.accretion_disk.AccretionDisk(smbh_mass_exp=None, redshift_source=None, inclination_angle=None, corona_height=None, temp_array=None, phi_array=None, g_array=None, radii_array=None, height_array=None, albedo_array=None, spin=0, OmM=0.3, H0=70, r_out_in_gravitational_radii=None, name='', **kwargs)[source]

Bases: object

calculate_db_dt_array(observer_frame_wavelength_in_nm)[source]

Calculate the rate of change of surface flux density with respect to a fluctuation in temperature.

Parameters:

observer_frame_wavelength_in_nm – Wavelength in nanometers in the observer frame

Returns:

2d array representing the partial derivative of the Planck function with respect to a small change in temperature at each pixel

calculate_dt_dlx_array(corona_height=None, axis_offset_in_gravitational_radii=0, angle_offset_in_degrees=0)[source]

Calculate the change in temperature with respect to a change in the X-ray luminosity.

Parameters:
  • corona_height – None or int / float. If None, the initialized corona height will be used. Otherwise, represents the height of the flare in units R_g = GM/c^2.

  • axis_offset_in_gravitational_radii – Axis offset of the flaring event in units R_g.

  • angle_offset_in_gravitational_radii – Degree rotation around the axis of symmetry of the flaring event. Zero degrees represents the flare nearer to the observer for inclined disks, while 180 degrees represnts the far side of the accretion disk.

Returns:

a 2d array of values representing the partial derivative of accretion disk’s temperature with respect to irradiating luminosity.

calculate_surface_intensity_map(observer_frame_wavelength_in_nm, return_wavelengths=False)[source]

Method to calculate the surface flux distribution at some wavelength.

Parameters:
  • observer_frame_wavelength_in_nm – Wavelength in nanometers used to determine black body flux

  • return_wavelengths – Bool used to return the map of wavelengths used at each pixel

Returns:

A 2d array representing the surface flux density at desired wavelength. If returnwavelength is True, returns a tuple of 2d arrays.

calculate_time_lag_array(corona_height=None, axis_offset_in_gravitational_radii=0, angle_offset_in_degrees=0)[source]

Calculate the time delay between a point source and the accretion disk.

Parameters:
  • corona_height – None or int / float. If None, use the corona height in the accretion disk. Otherwise, value represents height of the flare in units R_g = GM/c^2

  • axis_offset_in_gravitational_radii – Radial offset of the flare with repsect to the axis of symmetry in units R_g = GM/c^2

  • angle_offset_in_degrees – Angular rotation of the offset flare in degrees. Zero degrees represents a flare on the nearer side of the accretion disk, while 180 degrees represents the far side.

Returns:

A 2d array of time delays representing the extra path length from the corona to the midplane of the accretion disk in units R_g / c.

construct_accretion_disk_transfer_function(observer_frame_wavelength_in_nm, corona_height=None, axis_offset_in_gravitational_radii=0, angle_offset_in_degrees=0, return_response_array_and_lags=False)[source]

Calculate the transfer function of the accretion disk within the lamppost model.

Parameters:
  • observer_frame_wavelength_in_nm – Wavelength in nm with respect to the observer to calculate the transfer function at

  • corona_height – None or int / float. If None, the initialized corona height will be used. Otherwise, represents the height of the flare in units R_g = GM/c^2

  • axis_offset_in_gravitational_radii – Axis offset of the flaring event in units R_g = GM/c^2

  • angle_offset_in_gravitational_radii – Degree rotation around the axis of symmetry of the flaring event. Zero degrees represents the flare nearer to the observer for inclined disks, while 180 degrees represnts the far side of the accretion disk

  • return_response_array_and_lags – Boolean flag to return the accretion disk response and time delay arrays instead of the computed transfer function

Returns:

1d array representing the transfer function of the accretion disk with respect to some change in flux at a particular wavelength

generate_snapshots(observer_frame_wavelength_in_nm, time_stamps, driving_signal, driving_signal_fractional_strength, corona_height=None, axis_offset_in_gravitational_radii=0, angle_offset_in_degrees=0)[source]

Method to generate snapshots of the accretion disk’s surface brightness under the assumption that a driving signal is actively being reprocessed.

Parameters:
  • observer_frame_wavelength_in_nm – Wavelength in nm in the observer’s frame which we are observing the source at

  • time_stamps – 1d array or list of times to pull the snapshots at

  • driving_signal – 1d array or list representing the driving light curve

  • driving_signal_fractional_strength – float representing how strong the reprocessed signal is with respect to the continuum emission

  • corona_height – None or int/float. If None, the initialized corona height will be used. Otherwise, represents the height of the flare in units R_g = GM/c^2

  • axis_offset_in_gravitational_radii – Axis offset of the flaring event in units R_g = GM/c^2

  • angle_offset_in_gravitational_radii – Degree rotation around the axis of symmetry of the flaring event. Zero degrees represents the flare nearer to the observer for inclined disks, while 180 degrees represnts the far side of the accretion disk

Returns:

a list of snapshots of the accretion disk at each time step. Note that this is an experimental method.

get_plotting_axes()[source]

Method to get plotting axes for the accretion disk. Useful for plotting any of the generated arrays i.e. from calculate_time_lag_array, construct_accretion_disk_transfer_function( …,

return_response_array_and_lags=True ), self.temp_array, etc.

Returns:

X, Y arrays to be used with plt.contourf()

amoeba.Classes.agn module

class amoeba.Classes.agn.Agn(agn_name='', **kwargs)[source]

Bases: object

add_blr(blr_index=0, **kwargs)[source]

Add an initialization of a BroadLineRegion object which is defined with index blr_index. Expects a dictionary of BLR parameters in kwargs input.

Parameters:
  • blr_index – int or float to specify which BLR we are using

  • line_strength – int or float representing how strong the emission line is with respect to the accretion disk.

Returns:

True if successful

add_default_accretion_disk(**kwargs)[source]

Store a basic accretion disk object which is generatable with the create_maps function in Util. Expected input is a dictionary of accretion disk parameters.

Returns:

True if successful

add_diffuse_continuum(**kwargs)[source]

Add a diffuse continuum to the AGN. Expects a dictionary of diffuse continuum parameters in the kwargs argument.

Returns:

True if successful

add_generic_accretion_disk(**kwargs)[source]

Create an accretion disk from an AGN parameter dictionary. This may be used to generate more specialized accretion disk objects. Expected input is a dictionary of accretion disk parameters.

Returns:

True if successful

add_intrinsic_signal_parameters(**kwargs)[source]

Define the parameters which will be used to generate the intrinsic signal. Expects a dictionary of intrinsic signal parameters to be passed into the kwargs argument.

These may be: :param power_spectrum: list or array representing the power spectral density (PSD)

of the intrinsic signal

Parameters:
  • frequencies – list or array representing the frequencies associated with the PSD. Must be identical in size to power_spectrum.

  • random_seed – optional int to set a random seed.

Returns:

True if successful

add_streamline_bounded_region_to_blr(blr_index=0, **kwargs)[source]

Add a region of particles using the add_streamline_bounded_region method of the BroadLineRegion object with index blr_index. Expects two streamlines in a dictionary for the kwargs argument.

Parameters:

blr_index – int or float representing which BLR to add to

Returns:

True if successful

add_streamline_bounded_region_to_torus(**kwargs)[source]

Define the torus with a Streamline object. Expects a streamline in a dictionary for the kwargs argument.

Returns:

True if successful

add_torus(**kwargs)[source]

Initialize an obscuring torus in the AGN model. Note this is still an experimental feature. After initialization, the torus must be defined by the add_streamline_bounded_region_to_torus() method. Expects a dictionary of torus parameters in the kwargs argument.

Returns:

True if successful

calculate_accretion_disk_transfer_function(observed_wavelength_in_nm, **kwargs)[source]

Calculate the transfer function of the accretion disk in units R_g / c.

Parameters:

observed_wavelength_in_nm – observer frame wavelength in nm.

Returns:

a list represneting the accretion disk’s transfer function in time lag units R_g / c

calculate_blr_transfer_function(observed_wavelengths_in_nm, **kwargs)[source]

Calculate the transfer function of all BroadLineRegion components within the AGN in units R_g / c.

Parameters:

observed_wavelengths_in_nm – observer frame wavelength in nm

Returns:

list of BroadLineRegion transfer functions, which are lists of responses in units of R_g / c.

calculate_diffuse_continuum_mean_time_lag(observed_wavelength_in_nm, **kwargs)[source]

Calculate the diffuse continuum’s mean time lag contribution to the time lags in the continuum.

Parameters:

observed_wavelength_in_nm – observer frame wavelength in nm

Returns:

increase in mean time lag due to diffue continuum in units R_g / c

generate_intrinsic_signal(max_time_in_days, **kwargs)[source]

Generate a driving signal based on stored variability parameters. This stores the signal in the AGN, and also returns the driving light curve. If variability parameters are not stored, they must be passed into kwargs.

Parameters:
  • max_time_in_days – duration of the light curve to produce in days.

  • power_spectrum – list or array representing the power spectral density to use. Note that this may be predefined in the AGN with the self.add_intrinsic_signal_parmeters() method.

  • frequencies – list or array representing the frequencies associated with the PSD to use. Note that this may be predefined in the AGN with the self.add_intrinsic_signal_parmeters() method.

  • random_seed – optional int to use as a random seed.

Returns:

time axis and light curve associated with the generated driving signal

generate_kwarg_dictionaries_for_individual_components()[source]

Generates keyword dictionaries for each component based on the AGN dictionary given.

Helper method for init, not designed to be called manually.

get_blr_density_axes(blr_index=None)[source]

Get the meshgrid representations of the R-Z coordinates of the BroadLineRegion object(s).

Parameters:

blr_index – None or specific index / list of indicies to return the axis(axes) of. If None, a list of axes will be returned. If specified, only the requrested axes will be returned.

Returns:

list of lists containing the R, Z meshgrid coordinates of each BLR object.

intrinsic_signal_propagation_pipeline(intrinsic_light_curve=None, time_axis=None, observer_frame_wavelengths_in_nm=None, speclite_filter=None, blr_weightings=None, return_components=False, **kwargs)[source]

Runs the intrinsic signal propagation pipeline by generating a light curve based on intrinsic signal parameters if stored, propagating this through the accretion disk, then increasing these transfer functions’ tau axis by the increase due to the diffuse continuum, using these light curves as the driving signal for all broad line region components, and joining the light curves together.

Parameters:
  • intrinsic_light_curve – None or list/array representing the driving light curve to propagate through the system.

  • time_axis – None or list/array representing the time stamps of the driving light curve if provided. If None, the intrinsic_light_curve will be assumed to have daily cadence.

  • observer_frame_wavelengths_in_nm – list or int of observer frame wavelength(s) in nm to propagate the driving signal to. Cannot be used with speclite_filter.

  • speclite_filter – (list of) speclite filter(s) to propagate the driving signal to. Cannot be used with observer_frame_wavelengths_in_nm.

  • blr_weightings – list of BroadLineRegion weightings to use with the local optimally emitting cloud model. Each weighting must be a 2 dimensional array of shape (R, Z).

  • return_components – boolean toggle to return individual light curves in addition to the fully joined light curves.

Returns:

list of light curves in each wavelength/filter

set_blr_efficiency_array(efficiency_array=None, blr_index=None)[source]

Set the emission efficiency array of the BroadLineRegion object with index blr_index. If no arguments are passed, this will check which BroadLineRegion components do not have efficiency arrays associated with them.

Parameters:
  • efficiency_array – Array representing the weighted emission efficiency at each position in R, Z coordinates.

  • blr_index – index representing which BLR to update

Returns:

True if successful

update_h0(new_H0)[source]

Update H0 in all components. Gives you the power to change cosmology.

Parameters:

new_H0 – updated Hubble constant in units km/s/Mpc

Returns:

True if successful

update_inclination(new_inclination)[source]

Update inclination in all components. Note that the accretion disk may not be updatable if a specialized disk was created, and a new AGN object must be constructed.

Parameters:

new_inclination – Updated inclination in degrees

Returns:

True if successful

update_line_strength(blr_index, new_line_strength)[source]

Update line strength of a BLR emission line.

Parameters:
  • blr_index – index associated with a particular BroadLineRegion object in the AGN model

  • new_line_strength – int or float representing the new (relative) strength of the emission line

Returns:

True if successful

update_omega_m(new_omega_m)[source]

Update OmM in all components. Gives you the power to change cosmology.

Parameters:

new_omega_m – new mass component of the energy budget of the universe

Returns:

True if successful

update_redshift(new_redshift)[source]

Update redshift in all components.

Parameters:

new_redshift – new redshift of the AGN

Returns:

True if successful

update_smbh_mass_exponent(new_smbh_mass_exponent)[source]

Update the black hole mass in all components. Note that the accretion disk may not be updatable if a specialized disk was created, and a new AGN object must be constructed.

Parameters:

new_smbh_mass_exponent – Updated solution to log10(m_smbh / m_sun)

Returns:

True if successful

visualize_agn_pipeline(inclination_angle=None, observer_frame_wavelengths_in_nm=None, speclite_filter=None, blr_weightings=None, return_components=False, **kwargs)[source]

Runs the pipeline to generate FluxProjection objects of all components in the AGN model.

Parameters:
  • inclination_angle – None or int/float, defines the inclination of the AGN to project with respect to, in degrees. If None, uses the AGN’s stored inclination angle. If int/float, the accretion disk must be defined as a basic accretion disk.

  • observer_frame_wavelengths_in_nm – (list of) int(s)/float(s) of observer frame wavelengths to project the AGN at. Cannot be used with speclite_filter.

  • speclite_filter – (list of) speclite filter(s) to calculate the projected components to.

  • blr_weightings – list of efficiency arrays to be used with each BroadLineRegion component to simulate the local optimally emitting cloud model. Each weighting must be a 2 dimensional array of shape (R, Z).

  • return_components – boolean toggle to return a list of all FluxProjection objects

Returns:

FluxProjection representing the sum of all projectable components

visualize_static_accretion_disk(observed_wavelength_in_nm, **kwargs)[source]

Create FluxProjection of the accretion disk component.

Parameters:

observed_wavelength_in_nm – observer frame wavelength in nm

Returns:

FluxProjection object of the accretion disk component

visualize_static_blr(blr_index=0, **kwargs)[source]

Create FluxProjection of BLR with index blr_index.

Parameters:
  • blr_index – index of the BroadLineRegion to project.

  • velocity_range – array or list representing the velocity range to project in units v/c. If not given, will project all velocities. Note positive is towards the observer.

  • speclite_filters – (list of) speclite filters to project the BLR into. Cannot be used with velocity_range.

Returns:

FluxProjection object of the BLR in the AGN with index blr_index.

visualize_static_diffuse_continuum(observed_wavelength_in_nm, **kwargs)[source]

Create FluxProjection of diffuse continuum.

Parameters:

observed_wavelength_in_nm – observer frame wavelength in nm

Returns:

FluxProjection object representing the emission of the diffuse continuum. Note that the diffuse continuum object is not assumed to be inclination dependent, so this will always project into an annulus.

visualize_torus_obscuration(observed_wavelength_in_nm, **kwargs)[source]

Create FluxProjection in magnitudes to use as extinction. Note this is in the experimental phase.

Parameters:

observed_wavelength_in_nm – observer frame wavelength in nm

Returns:

FluxProjection object representing the column density projected to the source plane. Can be used as a proxy for the attenuation by the dusty torus.

amoeba.Classes.blr module

class amoeba.Classes.blr.BroadLineRegion(smbh_mass_exp, max_height, rest_frame_wavelength_in_nm, redshift_source, radial_step=10, height_step=10, max_radius=0, OmM=0.3, H0=70, line_strength=1, **kwargs)[source]

Bases: object

add_streamline_bounded_region(InnerStreamline, OuterStreamline, density_initial_weighting=1)[source]

Add a region to the BLR which represents the line emitting region.

Parameters:
  • InnerStreamline – Streamline object representative of the inner boundary conditions.

  • OuterStreamline – Streamline object representative of the outer boundary conditions.

  • density_initial_weighting – weighting factor for the density grid. Useful when defining multiple regions in the same BLR object. All weighting is relative.

Returns:

True if successful

calculate_blr_emission_line_transfer_function(inclination_angle, velocity_range=None, observed_wavelength_range_in_nm=None, speclite_filter=None, emission_efficiency_array=None)[source]

Calculate the transfer function of the BLR under the assumption that the emission is related to the density * emission_efficiency_array. Unlike calculate_blr_scattering_transfer_function, this has wavelength dependence. Assumes the major time delay is related to the light travel time and the relaxation time of an excited particle is negligable.

Parameters:
  • inclination_angle – angle of orientation of the source with respect to the observer in degrees.

  • velocity_range – a list representing the min and max velocities to choose. Cannot be used with observed_wavelength_range_in_nm or speclite_filter. Note that positive velocity is toward the observer.

  • observed_wavelength_range_in_nm – a list representing the min and max wavelengths in nanometers which are observed. Cannot be used with velocity:range or speclite_filter.

  • speclite_filter – Speclite filter object or string representing a loadable Speclite filter. Cannot be used with velocity_range or observed_wavelength_range_in_nm.

  • emission_efficiency_array – a 2d grid of weighting factors in the R-Z plane. Primarily used to selectively weight regions in the local optimally emitting cloud model.

Returns:

list representing the BLR’s transfer function under only a subset of the BLR particles can scatter photons in time units of R_g / c

calculate_blr_scattering_transfer_function(inclination_angle)[source]

Calculate the transfer function of the BLR under the assumption of basic scattering by the particles. Essentially a density-weighted scattering with no wavelength dependence.

Parameters:

inclination_angle – inclination of the source with respect to the observer in degrees

Returns:

list representing the BLR’s transfer function under the assumption that all particles can scatter photons of any wavelength with time units R_g / c

estimate_doppler_broadening(inclination_angle)[source]

Estimate the maximum and minimum velocities of the BLR using the maximum values stored in velocity arrays. This is a helper method which determines when it’s worth integrating through the BLR and when the integration will return 0.

Parameters:

inclination_angle – inclination of the source w.r.t the observer in degrees.

Returns:

array containing the estimated maximum receeding and approaching velocities in units v / c

get_density_axis()[source]

Get a meshgrid representation of the R-Z coordinates to get an array to apply local optimally emitting cloud region weighting. The spherical distance may be computed as:

r_spherical = np.sqrt(R**2 * Z**2)

Returns:

R and Z coordinates in a numpy meshgrid

project_blr_density_to_source_plane(inclination_angle)[source]

Project the total density of the BLR into the source plane. Creates a FluxProjection object where the flux_array is representative of the density.

Parameters:

inclination_angle – inclination of the source in degrees

Returns:

FluxProjection containing metadata from the BLR and the emission array

project_blr_intensity_over_velocity_range(inclination_angle, velocity_range=None, observed_wavelength_range_in_nm=None, speclite_filter=None, emission_efficiency_array=None)[source]

Project a portion of the BLR to the source plane by determining the Doppler shifting at each coordinate in R-Z-phi space.

Parameters:
  • inclination_angle – orientation of the source with respect to the observer in degrees

  • velocity_range – a list representing the min and max velocities to choose. Cannot be used with observed_wavelength_range_in_nm or speclite_filter. Note that positive velocity is toward the observer.

  • observed_wavelength_range_in_nm – a list representing the min and max wavelengths in nanometers which are observed. Cannot be used with velocity:range or speclite_filter.

  • speclite_filter – Speclite filter object or string representing a loadable Speclite filter. Cannot be used with velocity_range or observed_wavelength_range_in_nm.

  • emission_efficiency_array – a 2d grid of weighting factors in the R-Z plane

Returns:

FluxProjection containing metadata from the BLR and the velocity selected emission array

project_blr_total_intensity(inclination_angle, emission_efficiency_array=None)[source]

Project the BLR into the source plane. Similar to project_blr_density_to_source_plane, but can be weighted by the emission efficiency which is an array of equal size to the BLR’s density array.

Parameters:
  • inclination_angle – inclination which we view the source at, in degrees

  • emission_efficiency_array – a 2d grid of weighting factors in the R-Z plane.

Returns:

FluxProjection containing metadata from the BLR and the emission array

set_emission_efficiency_array(emission_efficiency_array=None)[source]

Set the weighting of each (R, Z) coordinate. This is used to compute the emission and response of the BLR for spatially distinct regions.

Parameters:

emission_efficiency_array – Array of int/float values representing how efficient the BLR responds at coordinate (R, Z)

Returns:

True if successful

update_line_strength(line_strength)[source]

Update the emission line strength stored in the BLR

Parameters:

line_strength – updated strength of the emisison line w.r.t. the continuum emission

Returns:

True if successful

amoeba.Classes.blr_streamline module

class amoeba.Classes.blr_streamline.Streamline(launch_radius, launch_theta, max_height, characteristic_distance, asymptotic_poloidal_velocity, height_step=10, launch_height=1, poloidal_launch_velocity=0.001, alpha_acceleration_value=1, velocity_vector=None, radial_vector=None)[source]

Bases: object

amoeba.Classes.diffuse_continuum module

class amoeba.Classes.diffuse_continuum.DiffuseContinuum(smbh_mass_exp=None, redshift_source=None, inclination_angle=None, radii_array=None, phi_array=None, cloud_density_radial_dependence=0, cloud_density_array=None, OmM=0.3, H0=70, r_in_in_gravitational_radii=None, r_out_in_gravitational_radii=None, name='', **kwargs)[source]

Bases: object

get_diffuse_continuum_emission(observer_frame_wavelength_in_nm, incident_continuum_weighting=1)[source]

Produce a FluxProjection object of the diffuse continuum under the assumption that there is no inclination dependence. Primarily used for the AGN projection pipeline. Note that there is a geometric weighting of r^{-2} from the incident light.

Parameters:
  • observer_frame_wavelength_in_nm – wavelength the diffuse continuum is observed at in nanometers

  • incident_continuum_weighting – optional weighting factor to scale the flux array by

Returns:

FluxProjection object containing metadata of the diffuse continuum and the emission array

get_diffuse_continuum_lag_contribution(observer_frame_wavelength_in_nm)[source]

Estimate the mean increase in time lag for an accretion disk due to the diffuse continuum, which must be added by the mean lag of the continuum. Solves the equation from Korista+Goad 2019 in the init function.

Parameters:

observer_frame_wavelength_in_nm – observer frame wavelength in nanometers

Returns:

increase in mean time lag at an observer frame wavelength in R_g / c

get_diffuse_continuum_mean_lag(observer_frame_wavelength_in_nm)[source]

Calculate the diffuse continuum’s mean time lag at a given wavelength in the observer’s frame. The integration constant is assumed to enforce tau_min = R_in / c.

Parameters:

observer_frame_wavelength_in_nm – observer frame wavelength in nanometers

Returns:

float representing the mean increase in time delay in units R_g / c

interpolate_spectrum_to_wavelength(observer_frame_wavelength_in_nm)[source]

Interpolates known spectra to a particular wavelength via linear interpolation.

Parameters:

observer_frame_wavelength_in_nm – observer frame wavelength in nm

Returns:

emissivity at observer frame wavenegth

set_emissivity(rest_frame_wavelengths=None, emissivity_etas=None)[source]

Define the diffuse continuum’s emission spectrum according to a rest frame wavelength spectrum. Required for estimating the increase in time lags. Determines the value of “x” in the equation in the init function.

Parameters:
  • rest_frame_wavelengths – list representing the rest frame wavelengths in nanometers. Should cover the range of wavelengths expected to be observed.

  • emissivity_etas – list representing the emissivities of the diffuse continuum clouds at each wavelength in rest_frame_wavelengths. Must be the same length as rest_frame_wavelengths.

Returns:

True if successful

set_responsivity_constant(responsivity_constant=1)[source]

Define the responsivity constant of the BLR according to Korista+Goad 2019. Sets the value of “A” in the equation in the init function.

Parameters:

responsivity_constant – define A, the percentage of flux that comes from the diffuse continuum w.r.t. the total flux. Must be between 0 and 1.

Returns:

True if successful

amoeba.Classes.flux_projection module

class amoeba.Classes.flux_projection.FluxProjection(flux_array, observer_frame_wavelength_in_nm, smbh_mass_exp, redshift_source, r_out_in_gravitational_radii, inclination_angle, OmM=0.3, H0=70, **kwargs)[source]

Bases: object

add_flux_projection(SecondProjection)[source]

Join this FluxProjection with another FluxProjection via simple addition. The resulting FluxProjection will have pixels the size of the larger FluxProjection and a maximum radius of the larger FluxProjection. Note that these are not necessarily the same (a smaller and coursely spaced projection joined with a large and finely spaced projection will result in a large and coursely spaced projection).

Parameters:

SecondProjection – FluxProjection object to add to the first projection

Returns:

True if successful. Note that this method modifies the parent FluxProjection.

get_plotting_axes()[source]

Convenience method to get the X and Y axes to plot the flux_projection in physical units.

Returns:

X and Y arrays in units of R_g used to create contour plots via plt.contourf(X, Y, self.flux_array).

amoeba.Classes.magnification_map module

class amoeba.Classes.magnification_map.ConvolvedMap(magnification_map, projected_flux_distribution, relative_orientation=False, random_seed=None)[source]

Bases: MagnificationMap

This child class represents the convoultion of a magnification map with a surface flux density.

Has all of the same methods as MagnificationMap

class amoeba.Classes.magnification_map.MagnificationMap(redshift_source, redshift_lens, magnification_array, convergence, shear, mean_microlens_mass_in_kg=<Quantity 1.98840987e+30 kg>, total_microlens_einstein_radii=25, OmM=0.3, H0=70, name='', **kwargs)[source]

Bases: object

calculate_microlensed_transfer_function(AccretionDisk, observer_frame_wavelength_in_nm, corona_height=None, relative_orientation=0, x_position=None, y_position=None, axis_offset_in_gravitational_radii=0, angle_offset_in_degrees=0, OmM=0.3, H0=70, return_response_array_and_lags=False, return_descaled_response_array_and_lags=False, return_magnification_map_crop=False, random_seed=None)[source]

Calculate the transfer function of an accretion disk when the response map is microlensed at a particular location.

Parameters:
  • AccretionDisk – AccretionDisk object

  • observer_frame_wavelength_in_nm – observer frame wavelength in nanometers to calculate the response at

  • corona_height – None or int/float. If none, will take the value stored in the AccretionDisk object. Otherwise will override the coronaheight in units R_g = GM/c^2

  • relative_orientation – Degree rotation of the AccretionDisk with respect to the magnification map

  • x_position – None or pixel position of the disk. If None, a random position is used

  • y_position – None or pixel position of the disk. If None, a random position is used

  • axis_offset_in_gravitational_radii – Off axis position to calculate the response map from

  • angle_offset_in_degrees – Degree rotation of the axis offset

  • OmM – mass component of the energy budget of the universe

  • H0 – Hubble constant in units km/s/Mpc

  • return_response_array_and_lags – Boolean used to return the spatially resolved maps associated with the response function.

  • return_descaled_response_array_and_lags – Similar to above, but returns the projections at the resolution of the magnification map. Useful for debugging.

  • return_magnification_map_crop – Boolean used to return the region of the magnification map used to amplify the response function.

  • random_seed – allows the user to set a random seed for reproducibility

Returns:

The microlensed transfer function represented by a list.

convolve_with_flux_projection(FluxProjection, relative_orientation=0, random_seed=None)[source]

Prepare the convolution between this magnification map and a FluxProjection. Note that once the convolution is performed, all orientations are defined. In particular, this solidifies the orientation of the source w.r.t. the direction of shear of the magnification map.

Parameters:
  • FluxProjection – FluxProjection object representing the source plane flux density.

  • relative_orientation – Angle to rotate the projection with respect to the magnification map in degrees.

  • random_seed – A random seed to set random parameters consistently

Returns:

Child magnification map object representing all magnifications of the flux projection. Normalization of coordinates w.r.t. the smbh is considered, and you will probably use this primarily for its “pull_light_curve” method.

pull_light_curve(effective_transverse_velocity, light_curve_duration_in_years, x_start_position=None, y_start_position=None, phi_travel_direction=None, weight_by_macromag=False, return_track_coords=False, random_seed=None)[source]

Calculate the values of a light curve. By default, the light curve will be randomly generated from the region of the magnification map not affected by convolutional artifacts.

Parameters:
  • effective_transverse_velocity – effective transverse velocity in km/s. This is typically on the order of ~10^2 - 10^3 km/s. However, exceptional cases may exceeed 10^4 km/s.

  • light_curve_duration_in_years – duration of light curve in years

  • x_start_position – x coordinate to start at in pixels

  • y_start_position – y coordinate to start at in pixels

  • phi_travel_direction – direction to travel in, in degrees

  • weight_by_macromag – boolean toggle to weight the values by the magnification map’s macro magnification. This macro magnification is determined by the convergence and shear.

  • return_track_coords – Bool to return the pixel locations as well as the light curve

  • random_seed – Set a random seed so random values are determined consistently

Returns:

Either a list representing the light curve or (for return_track_coords) a tuple representing a list for the light curve, and two lists for the x, y positions

pull_value_from_grid(x_val, y_val, weight_by_macromag=False)[source]

Read off the magnification at some position.

Parameters:
  • x_val – X value on the magnification map in pixels

  • y_val – Y value on the magnification map in pixels

  • weight_by_macromag – boolean toggle to weight the values by the magnification map’s macro magnification. This macro magnification is determined by the convergence and shear.

Returns:

Magnification at location (x_val, y_val).

amoeba.Classes.torus module

class amoeba.Classes.torus.Torus(smbh_mass_exp, max_height, redshift_source, radial_step=10, height_step=10, power_law_density_dependence=0, OmM=0.3, H0=70, **kwargs)[source]

Bases: object

add_streamline_bounded_region(Streamline)[source]

Add a streamline representing the boundary of the dust to the torus.

Parameters:

Streamline – Streamline object to use as the inner boundary condition

Returns:

True if successful

define_extinction_coefficients(rest_frame_wavelengths=None, extinction_coefficients=None)[source]

Define the extinction coefficients for a list of wavelengths.

Parameters:
  • rest_frame_wavelengths – list/array of wavelengths with representative extinction coefficients.

  • extinction_coefficients – list/array of extinction coefficients. Must be the same shape as rest_frame_wavelengths.

Returns:

True if successful

interpolate_to_extinction_at_wavelength(observer_frame_wavelength)[source]

Use linear interpolation of the extinction curve to determine the extinction at a particular wavelength.

Parameters:

observer_frame_wavelength – observer frame wavelength in nm

Returns:

int representing the extinction coefficient at the given wavelength

project_density_to_source_plane(inclination_angle)[source]

Project the torus’ density into a FluxProjection object.

Parameters:

inclination_angle – inclination of the torus w.r.t. the observer in degrees

Returns:

a 2 dimensional array representing the projected column density of the torus. Note that this is not representative of an emission or absorption, so a FluxProjection object is not returned.

project_extinction_to_source_plane(inclination_angle, observer_frame_wavelength)[source]

Project the torus’ modelled extinction to the source plane.

Parameters:
  • inclination_angle – inclination of the torus w.r.t. the observer in degrees

  • observer_frame_wavelength – observer frame wavelength in nm

Returns:

FluxProjection object representing the extinction due to the torus

Module contents