widget_BH

A module for handling the black hole widgets found in 10_Bonus_Black_Holes_as_DM.ipynb.

ToC: Functions

minnumberBH(galaxy)

A function that returns the minimum number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

maxnumberBH(galaxy)

A function that returns the maximum number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

defaultnumber(galaxy)

A function that returns the default number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

maxrcutBH(galaxy)

A function that returns the maximum cutoff radius for black holes (\(kpc\)), appropriate for the supplied galaxy.

defaultrcutBH(galaxy)

A function that returns the default cutoff radius for black holes (\(kpc\)), appropriate for the supplied galaxy.

f5533(arraysize, massMiniBH, rcut)

Generate a plot of the NGC5533 data and components alongside an image of a galaxy with dots representing black holes.

f7814(arraysize, massMiniBH, rcut)

Generate a plot of the NGC7814 data and components alongside an image of a galaxy with dots representing black holes.

interactive_plot_5533(widgetfunction)

Generate an interactive plot widget, allowing the user to interact with the NGC5533 data and the galaxy's components.

interactive_plot_7814(widgetfunction)

Generate an interactive plot widget, allowing the user to interact with the NGC7814 data and the galaxy's components.

on_button_clicked_5533(_)

A function to reset values when the 'Best Fit' button for NGC5533 is clicked.

on_button_clicked_7814(_)

A function to reset values when the 'Best Fit' button for NGC7814 is clicked.

ToC: Attributes

img

An array of RGB data for a galaxy image (images/A_spiral_snowflake.jpg), imported using matplotlib.pyplot.imread.

center

Coordinate pair indicating the pixel location of the center of the galaxy in img.

minkpc

The minimum value (\(kpc\)), allowed for the radial position of black holes on the plot.

maxkpc

The maximum value (\(kpc\)), allowed for the radial position of black holes on the plot.

kpctopixels

Number of pixels per kpc for plotting black holes over black hole image.

minmassBH

The minimum value, in solar masses, allowed for the (average) black hole mass.

maxmassBH

The maximum value, in solar masses, allowed for the (average) black hole mass.

defaultmass

The default value, in solar masses, for the (average) black hole mass.

scale

The number of black holes represented by each dot in the galaxy plot.

stepN

The step size of the slider controlling the number of black holes. In terms of number of black holes represented, this step size is multiplied by the scale.

minrcutBH

The minimum cutoff radius for black holes (\(kpc\)).

style

A dictionary for slider styling common to all sliders in this library.

layout

A dictionary for slider layout commont to all sliders in this library.

arraysize_5533

Slider for controlling the number of black holes for NGC5533.

massMiniBH_5533

Slider for controlling the black hole mass for NGC5533.

rcut_5533

Slider for controlling the cutoff radius for black hole placement for NGC5533.

arraysize_7814

Slider for controlling the number of black holes for NGC7814.

massMiniBH_7814

Slider for controlling the black hole mass for NGC7814.

rcut_7814

Slider for controlling the cutoff radius for black hole placement for NGC7814.

button_5533

A button that returns all settings for NGC5533 to the best fit.

out_5533

A handler for widget output NGC5533.

button_7814

A button that returns all settings for NGC7814 to the best fit.

out_7814

A handler for widget output for NGC7814.

Members

widget_BH.img

An array of RGB data for a galaxy image (images/A_spiral_snowflake.jpg), imported using matplotlib.pyplot.imread.

Type:

array

widget_BH.center = [1960, 1800]

Coordinate pair indicating the pixel location of the center of the galaxy in img.

Type:

array

widget_BH.minkpc = 0

The minimum value (\(kpc\)), allowed for the radial position of black holes on the plot.

Type:

int

widget_BH.maxkpc = 100

The maximum value (\(kpc\)), allowed for the radial position of black holes on the plot.

Type:

int

widget_BH.kpctopixels = 20

Number of pixels per kpc for plotting black holes over black hole image.

Type:

int

widget_BH.minmassBH = 0.1

The minimum value, in solar masses, allowed for the (average) black hole mass.

Type:

float

widget_BH.maxmassBH = 3.8

The maximum value, in solar masses, allowed for the (average) black hole mass.

Type:

float

widget_BH.defaultmass = 1.5

The default value, in solar masses, for the (average) black hole mass.

Type:

float

widget_BH.scale = 1000000.0

The number of black holes represented by each dot in the galaxy plot.

Type:

int

widget_BH.stepN = 5

The step size of the slider controlling the number of black holes. In terms of number of black holes represented, this step size is multiplied by the scale.

Int:

widget_BH.minnumberBH(galaxy)

A function that returns the minimum number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

Parameters:
galaxy[string | int]

The name or number (for NGC) of the selected galaxy. Names are not case-sensitive and ignore spaces. Allowed inputs: “NGC5533” or “NGC7814”.

Returns:

[int] The minimum number of black holes, prior to multiplying by the scale.

See also

For an example usecase of this function, see arraysize_5533.

widget_BH.maxnumberBH(galaxy)

A function that returns the maximum number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

Parameters:
galaxy[string | int]

The name or number (for NGC) of the selected galaxy. Names are not case-sensitive and ignore spaces. Allowed inputs: “NGC5533” or “NGC7814”.

Returns:

[int] The maximum number of black holes, prior to multiplying by the scale.

See also

For an example usecase of this function, see arraysize_5533.

widget_BH.defaultnumber(galaxy)

A function that returns the default number of black holes (prior to multiplying by the scale) appropriate for the supplied galaxy.

Parameters:
galaxy[string | int]

The name or number (for NGC) of the selected galaxy. Names are not case-sensitive and ignore spaces. Allowed inputs: “NGC5533” or “NGC7814”.

Returns:

[int] The default number of black holes, prior to multiplying by the scale.

See also

For an example usecase of this function, see arraysize_5533.

widget_BH.minrcutBH = 0.1

The minimum cutoff radius for black holes (\(kpc\)).

Type:

float

widget_BH.maxrcutBH(galaxy)

A function that returns the maximum cutoff radius for black holes (\(kpc\)), appropriate for the supplied galaxy.

Parameters:
galaxy[string | int]

The name or number (for NGC) of the selected galaxy. Names are not case-sensitive and ignore spaces. Allowed inputs: “NGC5533” or “NGC7814”.

Returns:

[float] The maximum cutoff radius for black holes.

See also

For an example usecase of this function, see arraysize_5533.

widget_BH.defaultrcutBH(galaxy)

A function that returns the default cutoff radius for black holes (\(kpc\)), appropriate for the supplied galaxy.

Parameters:
galaxy[string | int]

The name or number (for NGC) of the selected galaxy. Names are not case-sensitive and ignore spaces. Allowed inputs: “NGC5533” or “NGC7814”.

Returns:

[float] The default cutoff radius for black holes.

See also

For an example usecase of this function, see arraysize_5533.

widget_BH.style

A dictionary for slider styling common to all sliders in this library.

Type:

dict

widget_BH.layout

A dictionary for slider layout commont to all sliders in this library.

Type:

dict

widget_BH.f5533(arraysize, massMiniBH, rcut)

Generate a plot of the NGC5533 data and components alongside an image of a galaxy with dots representing black holes.

This function is intended for use as part of a widget.

Parameters:
arraysize: [int]

Size intended for the radius and angle arrays.

massMiniBH: [int]

Mass of the tiny black holes, in solar masses.

rcut: [float]

Cutoff radius for black hole placement (\(kpc\)).

Returns:

None

See also

For an example usage of this function, see the notebook 10_Bonus_Black_Holes_as_DM.ipynb on Binder.

widget_BH.f7814(arraysize, massMiniBH, rcut)

Generate a plot of the NGC7814 data and components alongside an image of a galaxy with dots representing black holes.

This function is intended for use as part of a widget.

Parameters:
arraysize: [int]

Size intended for the radius and angle arrays.

massMiniBH: [int]

Mass of the tiny black holes, in solar masses.

rcut: [float]

Cutoff radius for black hole placement (\(kpc\)).

Returns:

None

See also

For an example usage of this function, see the notebook 10_Bonus_Black_Holes_as_DM.ipynb on Binder.

widget_BH.arraysize_5533

Slider for controlling the number of black holes for NGC5533.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.massMiniBH_5533

Slider for controlling the black hole mass for NGC5533.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.rcut_5533

Slider for controlling the cutoff radius for black hole placement for NGC5533.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.arraysize_7814

Slider for controlling the number of black holes for NGC7814.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.massMiniBH_7814

Slider for controlling the black hole mass for NGC7814.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.rcut_7814

Slider for controlling the cutoff radius for black hole placement for NGC7814.

Type:

ipywidgets.widgets.widget_float.FloatSlider

widget_BH.interactive_plot_5533(widgetfunction)

Generate an interactive plot widget, allowing the user to interact with the NGC5533 data and the galaxy’s components.

Parameters:
widgetfunction: [function]

A function that generates the base plot for the widget to alter. This should, in all likelihood, be f5533.

Returns:

[ipywidgets.widgets.interaction.interactive] – creates sliders to make the plot interactive.

See also

For an example usage of this function, see the notebook 10_Bonus_Black_Holes_as_DM.ipynb on Binder.

widget_BH.interactive_plot_7814(widgetfunction)

Generate an interactive plot widget, allowing the user to interact with the NGC7814 data and the galaxy’s components.

Parameters:
widgetfunction: [function]

A function that generates the base plot for the widget to alter. This should, in all likelihood, be f7814.

Returns:

[ipywidgets.widgets.interaction.interactive] – creates sliders to make the plot interactive.

See also

For an example usage of this function, see the notebook 10_Bonus_Black_Holes_as_DM.ipynb on Binder.

widget_BH.button_5533

A button that returns all settings for NGC5533 to the best fit.

Type:

ipywidgets.widgets.widget_button.Button

widget_BH.out_5533

A handler for widget output NGC5533.

Type:

ipywidgets.widgets.widget_output.Output

widget_BH.on_button_clicked_5533(_)

A function to reset values when the ‘Best Fit’ button for NGC5533 is clicked.

Parameters:

None.

Returns:

None

Example:
>>> button_5533.on_click(on_button_clicked_5533)

This renders the button click behavior seen in 10_Bonus_Black_Holes_as_DM.ipynb on Binder.

widget_BH.button_7814

A button that returns all settings for NGC7814 to the best fit.

Type:

ipywidgets.widgets.widget_button.Button

widget_BH.out_7814

A handler for widget output for NGC7814.

Type:

ipywidgets.widgets.widget_output.Output

widget_BH.on_button_clicked_7814(_)

A function to reset values when the ‘Best Fit’ button for NGC7814 is clicked.

Parameters:

None.

Returns:

None

Example:
>>> button_7814.on_click(on_button_clicked_7814)

This renders the button click behavior seen in 10_Bonus_Black_Holes_as_DM.ipynb on Binder.