Model

class src.binary_sed_fitting.Model(name, limits, filter_list=None, star=None)

Class to work with synthetic photometry models.

  • The models are saved as xarray DataArrays.

  • Also includes simple tools to access and plot isochrones and WD cooling curves

constrain_fitting_parameters()

Crop the model DataArray according to specified limits for each parameter dimension.

Raises:

ValueError – If the provided limits do not match all and only the model parameter dimensions, or if any of the provided limits exceed the range of the corresponding model parameter.

Notes

Updates: Model.da

create_star_dataarrays(star)

Create observed flux and flux error DataArrays matching the dimensions of self.da.

Parameters:

star (Star) – Star object containing observed flux and error data.

Notes

Updates: Model.da_obs, Model.da_obs_error, Model.da_obs_error_2percent, Model.da_obs_error_10percent

crop_based_on_filter_list()

Crop the model to only include specified filters.

Notes

Updates: Model.da

Updates self.da.attrs[‘Wavelengths’] to reflect the wavelengths corresponding to the selected filters in self.filter_list.

static load_isochrone()

Load Parsec ([M/H] = 0) isochrone data from a CSV file and extract subsets based on logAge values.

Returns:

  • iso (pandas.DataFrame) – Complete isochrone data.

  • iso_8 (pandas.DataFrame) – Subset of isochrone data for logAge = 8.

  • iso_9 (pandas.DataFrame) – Subset of isochrone data for logAge = 9.

  • iso_10 (pandas.DataFrame) – Subset of isochrone data for logAge = 10.

static load_wd_cooling_curves()

Load Bergeron white dwarf cooling curves from a CSV file.

Returns:

  • WD_02 (pandas.DataFrame) – White dwarf cooling curve for mass = 0.2 and spectral type = ‘DA’.

  • WD_05 (pandas.DataFrame) – White dwarf cooling curve for mass = 0.5 and spectral type = ‘DA’.

  • WD_13 (pandas.DataFrame) – White dwarf cooling curve for mass = 1.3 and spectral type = ‘DA’.

static plot_isochrone_and_wd(ax=None)

Plot isochrone and white dwarf cooling curves.

Parameters:

ax (matplotlib.axes.Axes, optional) – Matplotlib axes to plot on. If None, a new subplot is created.

Notes

  • Parsec Isochrones for log(age) of 8, 9, and 10 and [M/H] = 0.

  • Bergeron model white dwarf cooling curves for mass of 0.2, 0.5, 1.3 and spectral type DA.

read_model_file()

Reads model file from the ‘DIR_MODELS’ folder as a DataArray.

Notes

Updates: Model.da

  • Updates Model.da with the contents of the model file specified by Model.model_file_name.

  • Calls Model.crop_based_on_filter_list() to adjust Model.da based on the provided filter list.

  • If DIR_MODELS is different from the current path of Model.model_file_name, updates it accordingly.