Model Plotter API

Some plotting functions

class WDPhotTools.plotter.DummyAtm[source]

dummy class to load atmosphere reader if needed

class WDPhotTools.plotter.DummyCm[source]

dummy class to load cooling model reader if needed

WDPhotTools.plotter.list_atmosphere_parameters()[source]

Print the formatted list of parameters available from the atmophere models.

WDPhotTools.plotter.list_cooling_model()[source]

Print the formatted list of available cooling models.

WDPhotTools.plotter.list_cooling_parameters(model)[source]

Print the formatted list of parameters available for the specified cooling models.

Parameters:

model (str) – Name of the cooling model as in the model_list.

WDPhotTools.plotter.plot_atmosphere_model(x='G3_BP-G3_RP', y='G3', atmosphere='H', independent=['logg', 'Teff'], independent_values=[array([7., 7.5, 8., 8.5, 9.]), array([1531.08746168, 1603.24539069, 1678.80401812, 1757.92361396, 1840.77200147, 1927.52491319, 2018.36636368, 2113.48903984, 2213.09470961, 2317.39464997, 2426.61009508, 2540.97270555, 2660.7250598, 2786.12116863, 2917.427014, 3054.92111322, 3198.89510969, 3349.65439158, 3507.51873953, 3672.82300498, 3845.91782045, 4027.17034325, 4216.96503429, 4415.70447353, 4623.81021399, 4841.72367584, 5069.90708275, 5308.84444231, 5559.0425727, 5821.03217771, 6095.3689724, 6382.63486191, 6683.43917569, 6998.41996002, 7328.24533139, 7673.61489362, 8035.26122186, 8413.95141645, 8810.48873008, 9225.71427155, 9660.5087899, 10115.7945426, 10592.53725177, 11091.74815262, 11614.4861384, 12161.86000646, 12735.03081017, 13335.21432163, 13963.68361056, 14621.77174457, 15310.87461682, 16032.4539069, 16788.04018123, 17579.23613959, 18407.72001469, 19275.24913191, 20183.66363682, 21134.89039837, 22130.94709606, 23173.94649968, 24266.10095082, 25409.72705549, 26607.25059799, 27861.2116863, 29174.27014001, 30549.21113216, 31988.95109691, 33496.54391578, 35075.18739526, 36728.23004981, 38459.17820454, 40271.70343255, 42169.65034286, 44157.04473533, 46238.10213993, 48417.23675841, 50699.07082747, 53088.4444231, 55590.42572704, 58210.32177709, 60953.68972402, 63826.34861905, 66834.39175686, 69984.19960023, 73282.45331389, 76736.14893618, 80352.61221856, 84139.51416452, 88104.8873008, 92257.14271548, 96605.08789898, 101157.94542599, 105925.37251773, 110917.48152624, 116144.86138403, 121618.60006464, 127350.30810167, 133352.14321633, 139636.83610559, 146217.71744567])], interpolator='CT', contour=True, figsize=(8, 8), invert_xaxis=False, invert_yaxis=False, title=None, display=True, savefig=False, folder=None, filename=None, ext=['png'], fig=None, kwargs_for_plot={'marker': '+'}, kwargs_for_contour={'levels': 100}, kwargs_for_colorbar={})[source]
Parameters:
  • x (str (Default: 'G3_BP-G3_RP')) – Model parameter(s) of the abscissa. Two formats are supported: (1) single parameter (2) two parameters delimited with a ‘-’ for the colour in those filters.

  • y (str (Default: 'G3')) – Model parameter of the ordinate. Same as x.

  • atmosphere (list of str (Default: 'H')) – Choose to plot from the pure hydrogen atmosphere model or pure helium atmosphere model. Only 1 atmosphere model can be plotted at a time, if both models are to be plotted, reuse the Figure object returned and overplot on it.

  • independent (list of str (Default: ['logg', 'Teff'])) – Independent variables to be interpolated in the atmosphere model.

  • independent_values (list of list or list of arrays (Default:) – [np.linspace(7.0, 9.0, 5), np.power(10., np.linspace(3.185, 5.165, 100))]) The coordinates to be interpolated and plotted.

  • interpolator (str (Default: 'CT')) – Choice of interpolator between CT and RBF.

  • contour (bool (Default: True)) – Set to True to plot the contour levels.

  • figsize (array of size 2 (Default: (8, 8))) – Set the dimension of the figure.

  • invert_xaxis (bool (Default: False)) – Set to invert the abscissa.

  • invert_yaxis (bool (Default: False)) – Set to invert the ordinate.

  • title (str (Default: None)) – Set the title of the figure.

  • display (bool (Default: True)) – Set to display the figure.

  • savefig (bool (Default: False)) – Set to save the figure.

  • folder (str (Default: None)) – The relative or absolute path to destination, the current working directory will be used if None.

  • filename (str (Default: None)) – The filename of the figure. The Default filename will be used if None.

  • ext (str (Default: ['png'])) – Image type to be saved, multiple extensions can be provided. The supported types are those available in matplotlib.pyplot.savefig.

  • fig (matplotlib.figure.Figure (Default: None)) – Overplotting on an existing Figure.

  • kwargs_for_plot (dict (Default: {'marker': '+'})) – Keywords for matplotlib.pyplot.plot().

  • kwargs_for_contour (dict (Default: {'levels': 100})) – Keywords for matplotlib.pyplot.tricontourf().

  • kwargs_for_colorbar (dict (Default: {})) – Keywords for matplotlib.pyplot.colorbar().

WDPhotTools.plotter.plot_cooling_model(model='montreal_co_da_20', x='age', y='lum', log_x=True, log_y=True, mass='all', figsize=(8, 8), invert_xaxis=False, invert_yaxis=False, title=None, display=True, savefig=False, folder=None, filename=None, ext=['png'], fig=None, kwargs_for_plot={'marker': '+'})[source]

Set the WD cooling model.

Parameters:
  • model (str (Default: 'montreal_co_da_20')) –

    Choice of WD cooling model:

    1. ’montreal_co_da_20’ - Bedard et al. 2020 CO DA

    2. ’montreal_co_db_20’ - Bedard et al. 2020 CO DB

    3. ’lpcode_he_da_07’ - Panei et al. 2007 He DA

    4. ’lpcode_co_da_07’ - Panei et al. 2007 CO DA

    5. ’lpcode_he_da_09’ - Althaus et al. 2009 He DA

    6. ’lpcode_co_da_10_z001’ - Renedo et al. 2010 CO DA Z=0.01

    7. ’lpcode_co_da_10_z0001’ - Renedo et al. 2010 CO DA Z=0.001

    8. ’lpcode_co_da_15_z00003’ - Althaus et al. 2015 DA Z=0.00003

    9. ’lpcode_co_da_15_z0001’ - Althaus et al. 2015 DA Z=0.0001

    10. ’lpcode_co_da_15_z0005’ - Althaus et al. 2015 DA Z=0.0005

    11. ’lpcode_co_da_17_y04’ - Althaus et al. 2017 DB Y=0.4

    12. ’lpcode_co_db_17’ - Camisassa et al. 2017 DB

    13. ’basti_co_da_10’ - Salaris et al. 2010 CO DA

    14. ’basti_co_db_10’ - Salaris et al. 2010 CO DB

    15. ’basti_co_da_10_nps’ - Salaris et al. 2010 CO DA, no phase separation

    16. ’basti_co_db_10_nps’ - Salaris et al. 2010 CO DB, no phase separation

    17. ’lpcode_one_da_07’ - Althaus et al. 2007 ONe DA

    18. ’lpcode_one_da_19’ - Camisassa et al. 2019 ONe DA

    19. ’lpcode_one_db_19’ - Camisassa et al. 2019 ONe DB

    20. ’mesa_one_da_18’ - Lauffer et al. 2018 ONe DA

    21. ’mesa_one_db_18’ - Lauffer et al. 2018 ONe DB

    The naming convention follows this format: [model]_[core composition]_[atmosphere]_[publication year] where a few models continue to have extra property description terms trailing after the year, currently they are either the progenitor metallicity or the (lack of) phase separation in the evolution model.

  • x (str (Default: 'age')) – Model parameter(s) of the abscissa.

  • y (str (Default: 'lum')) – Model parameter of the ordinate.

  • log_x (bool (Default: True)) – Set to True to log the abscissa.

  • log_y (bool (Default: True)) – Set to True to log the ordinate.

  • mass (str (Default: 'all')) – A list of mass in which the cooling model should return. Default is ‘all’, this is the only accept str.

  • figsize (array of size 2 (Default: (8, 8))) – Set the dimension of the figure.

  • invert_xaxis (bool (Default: False)) – Set to invert the abscissa.

  • invert_yaxis (bool (Default: False)) – Set to invert the ordinate.

  • title (str (Default: None)) – Set the title of the figure.

  • display (bool (Default: True)) – Set to display the figure.

  • savefig (bool (Default: False)) – Set to save the figure.

  • folder (str (Default: None)) – The relative or absolute path to destination, the current working directory will be used if None.

  • filename (str (Default: None)) – The filename of the figure. The Default filename will be used if None.

  • ext (str (Default: ['png'])) – Image type to be saved, multiple extensions can be provided. The supported types are those available in matplotlib.pyplot.savefig.

  • fig (matplotlib.figure.Figure (Default: None)) – Overplotting on an existing Figure.

  • kwargs_for_plot={'marker' ('+'}):) – Keywords for matplotlib.pyplot.plot().