desk.fitting package

Submodules

desk.fitting.dusty_fit module

desk.fitting.dusty_fit.fit_single_source(source_number: int, fit_params)[source]

Fits a single source with the data and models included in class fit_params.

Parameters:
  • source_number (int) – Index of source in list of targets.

  • fit_params (Class) – Fit parameters generated by desk.set_up.get_inputs.fitting_parameters().

Returns:

  • Results from the best-fit model are appended to “fitting_results.csv”,

  • and results are printed.

desk.fitting.fitting_tools module

class desk.fitting.fitting_tools.fit[source]

Bases: object

Fitting tools for least square fit.

find_closest(model_wave: list, model_flux: list)[source]

Find model fluxes closest in wavelength to data.

Parameters:
  • data_wave (list) – wavelengths of data in microns.

  • model_wave (list) – wavelengths of model in microns.

  • model_flux (list) – scaled flux of model in W M-2

Returns:

closest_model_flux – Subset of model fluxes closest to each wavelength in data.

Return type:

array

fit_data(model: ndarray) float[source]

Trims the data, finds the closest match, and returns chi square value.

Parameters:
  • data (2D array) – Data with wavelength in microns and flux in W M-2

  • model (2D array) – model with wavelength in microns and scaled flux in W M-2

Returns:

stats – chi square value.

Return type:

float

least2_liklihood(_model: ndarray) float[source]

Finds the least-squares fit of the data and model.

Parameters:
  • _data (array) – Source data in W*M^-2.

  • _model (array) – Model fluxes in W*M^-2.

Returns:

prob – The probability given the fit.

Return type:

float

desk.fitting.fitting_tools.trim_grid(data: ndarray, fit_params)[source]

Trims model grid wavelengths and fluxes. USED BEFORE FITTING.

Parameters:
  • data (2-D array) – input data in 2-D array of wavelength and flux.

  • fit_params (Class) – fit parameters.

Returns:

  • trimmed_model_wavelength (array) – Trimmed model wavelengths in microns

  • trimmed_model_fluxes (astropy Table (1 column, array in each row)) – Trimmed model fluxes in W*M^-2

Module contents