cmd¶
This module implements the CMD infrastructure
-
class
hoki.cmd.
CMD
(file, col_lim=[-3, 7], mag_lim=[-14, 10], res_el=0.1)¶ Colour Magnitude Diagram Object
- Parameters
file (str) – Location of the file containing the model inputs
col_lim (list of 2 integers (positive or negative), optional) – Limits on the colour range of the CMD grid, Default is [-3,7].
mag_lim (list of 2 integers (positive or negative), optional) – Limits on the magnitude range of the CMD grid. Default is [-14,10].
res_el (float or int, optional) – Resolution element of the CMD grid. The resolution element is the same for colour and magnitude. Default is 0.1.
-
self.
bpass_input
¶ Input file given by the file parameter
- Type
str
-
self.
col_range
¶ Colour range spanned by the grid (with res_el-sized intervals)
- Type
numpy.ndarray (1D)
-
self.
mag_range
¶ Magnitude range spanned by the grid (with res_el-sized intervals)
- Type
numpy.ndarray (1D)
-
self.
grid
¶ Colour-Magnitude grid.
- Type
numpy.ndarray (2D)
-
self.
path
¶ The absolute path to the stellar models. It is set to hoki.cconstants.MODELS_PATH which you can set to the right path by using hoki.load.set_models.path().
- Type
str
-
self.
t
¶ Class attribute - The time bins in BPASS - note they are in LOG SPACE
- Type
np.ndarray 1D
-
self.
dt
¶ Class attribute - Time intervals between bins NOT in log space
- Type
np.ndarray 1D
-
make
(filter1, filter2)¶ Make the CMD - a.k.a fill the grid
Notes
This may take a few seconds to a minute to run.
The colour will be filter1 - filter2
If you later call CMD.plot() you will obtain a contour plot of filter1 against filter1-filter2
- Parameters
filter1 (str) – First filter
filter2 (str) – Seconds filter
- Returns
- Return type
None
-
plot
(log_age=6.8, loc=111, cmap='Greys', **kwargs)¶ Plots the CMD grid at a particular age
- Parameters
log_age (float) – Must be a valid BPASS time bin
loc (3 integers, optional) – Location of the subplot. Default is 111.
cmap (str, optional) – Colour map for the contours. Default is ‘Greys’ **kwargs : matplotlib keyword arguments, optional
- Returns
The plot created is returned, so you can add stuff to it, like text or extra data.
- Return type
matplotlib.axes._subplots.AxesSubplot