Package ivs :: Package sed :: Module builder :: Class BinarySED
[hide private]
[frames] | no frames]

Class BinarySED

source code


Instance Methods [hide private]
 
__init__(self, ID=None, photfile=None, plx=None, load_fits=True, load_hdf5=True, label='', **kwargs)
Setup the Binary sed in the same way as a normal SED.
source code
 
set_constraints(self, **kwargs)
Add constraints that are used when fitting the Binary SED.
source code
 
constraints2str(self)
Summarizes all constraints in a string.
source code

Inherited from SED: __repr__, __str__, generate_ranges

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

    Handling photometric data

Inherited from SED: add_photometry_fromarrays, exclude, exclude_abs, exclude_colors, get_photometry, get_spectrophotometry, include, include_abs, include_colors, set_photometry_scheme

    Additional information

Inherited from SED: compute_distance, get_angular_diameter, get_distance_from_plx, get_interstellar_reddening, has_photfile, is_target

    Fitting routines
 
igrid_search(self, points=100000, teffrange=None, loggrange=None, ebvrange=None, zrange=None, rvrange=((3.1,3.1),(3.1,3.1)), vradrange=((0,0),(0,0)), radrange=(None,None), compare=True, df=None, CI_limit=None, set_model=True, distance=None, **kwargs)
Fit fundamental parameters using a (pre-integrated) grid search.
source code
 
generate_fit_param(self, start_from='igrid_search', **pars)
generates a dictionary with parameter information that can be handled by fit.iminimize
source code
 
iminimize(self, teff=(None,None), logg=(None,None), ebv=(None,None), z=(None,None), rv=(None,None), vrad=(0,0), teffrange=(None,None), loggrange=(None,None), ebvrange=(None,None), zrange=(None,None), rvrange=(None,None), vradrange=(None,None), radrange=(None,None), compare=True, df=None, distance=None, start_from='igrid_search', points=None, CI_limit=None, calc_ci=True, set_model=True, **kwargs)
Binary minimizer
source code
 
calculate_iminimize_CI(self, mtype='iminimize', CI_limit=0.66, **kwargs)
Calculate the confidence intervals for each parameter using the lmfit calculate confidence interval method.
source code
 
calculate_iminimize_CI2D(self, xpar, ypar, mtype='iminimize', limits=None, res=10, **kwargs)
Calculated 2 dimentional confidence intervals for the given parameters, using lmfit methods.
source code

Inherited from SED: calculateDF, calculate_confidence_intervals, calculate_statistics, clip_grid, collect_results, imc, store_confidence_intervals

Inherited from SED (private): _get_imin_ci

    Interfaces
 
set_best_model(self, mtype='igrid_search', law='fitzpatrick2004', **kwargs)
Get reddenend and unreddened model
source code

Inherited from SED: chi2, clear, get_model, sample_gridsearch, set_model

    Add constraints

Inherited from SED: add_constraint_angular_diameter, add_constraint_distance, add_constraint_evolution_models, add_constraint_mass, add_constraint_reddening, add_constraint_slo

    Plotting routines

Inherited from SED: make_plots, plot_CI2D, plot_MW_side, plot_MW_top, plot_chi2, plot_data, plot_distance, plot_finderchart, plot_grid, plot_grid_model, plot_sed

Inherited from SED (private): _label_dict

    Input and output

Inherited from SED: load_fits, load_hdf5, load_photometry, save_bibtex, save_fits, save_hdf5, save_important_info, save_photometry, save_summary

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ID=None, photfile=None, plx=None, load_fits=True, load_hdf5=True, label='', **kwargs)
(Constructor)

source code 

Setup the Binary sed in the same way as a normal SED. The masses of both components can be provided, and will then be used in igrid_search, iminimize, and while calculating CI and CI2D confidence intervalls

Parameters:
  • plx - parallax (and error) of the object
Overrides: object.__init__

set_constraints(self, **kwargs)

source code 

Add constraints that are used when fitting the Binary SED. Up till now the following contraints are supported:

  • masses (in Msol)
  • distance (in Rsol)

TODO: This function should in the future accept Units.

igrid_search(self, points=100000, teffrange=None, loggrange=None, ebvrange=None, zrange=None, rvrange=((3.1,3.1),(3.1,3.1)), vradrange=((0,0),(0,0)), radrange=(None,None), compare=True, df=None, CI_limit=None, set_model=True, distance=None, **kwargs)

source code 

Fit fundamental parameters using a (pre-integrated) grid search.

If called consecutively, the ranges will be set to the CI_limit of previous estimations, unless set explicitly.

If called for the first time, the ranges will be +/- np.inf by defaults, unless set explicitly.

Overrides: SED.igrid_search

generate_fit_param(self, start_from='igrid_search', **pars)

source code 

generates a dictionary with parameter information that can be handled by fit.iminimize

Overrides: SED.generate_fit_param

iminimize(self, teff=(None,None), logg=(None,None), ebv=(None,None), z=(None,None), rv=(None,None), vrad=(0,0), teffrange=(None,None), loggrange=(None,None), ebvrange=(None,None), zrange=(None,None), rvrange=(None,None), vradrange=(None,None), radrange=(None,None), compare=True, df=None, distance=None, start_from='igrid_search', points=None, CI_limit=None, calc_ci=True, set_model=True, **kwargs)

source code 

Binary minimizer

Overrides: SED.iminimize

calculate_iminimize_CI(self, mtype='iminimize', CI_limit=0.66, **kwargs)

source code 

Calculate the confidence intervals for each parameter using the lmfit calculate confidence interval method.

The calculated confidence intervals are stored in the results['CI'] dictionary. If the method fails, or if the asked CI is outside the provided ranges, those ranges will be set as CI.

This method works in the same way as for a single SED, but it adds the mass as an extra constraint if the mass of both components is stored.

Overrides: SED.calculate_iminimize_CI

calculate_iminimize_CI2D(self, xpar, ypar, mtype='iminimize', limits=None, res=10, **kwargs)

source code 

Calculated 2 dimentional confidence intervals for the given parameters, using lmfit methods.

The calculated confidence intervals are stored in the results['CI2D'] dictionary.

This method works in the same way as for a single SED, but it adds the mass as an extra constraint if the mass of both components is stored.

Overrides: SED.calculate_iminimize_CI2D

set_best_model(self, mtype='igrid_search', law='fitzpatrick2004', **kwargs)

source code 

Get reddenend and unreddened model

Overrides: SED.set_best_model