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

Class SED

source code


Class that facilitates the use of the ivs.sed module.

This class is meant to be an easy interface to many of the ivs.sed module's functionality.

The most important attributes of SED are:

  1. sed.ID: star's identification (str)
  2. sed.photfile: name of the file containing all photometry (str)
  3. sed.info: star's information from Simbad (dict)
  4. sed.master: photometry data (record array)
  5. sed.results: results and summary of the fitting process (dict)

After fitting, e.g. via calling igrid_search, you can call get_model to retrieve the full SED matching the best fitting parameters (or, rather, closely matching them, see the documentation).

Instance Methods [hide private]
 
__init__(self, ID=None, photfile=None, plx=None, load_fits=True, load_hdf5=True, label='')
Initialize SED class.
source code
 
__repr__(self)
Machine readable string representation of an SED object.
source code
 
__str__(self)
Human readable string representation of an SED object.
source code
 
generate_ranges(self, start_from='igrid_search', distribution='uniform', **kwargs)
Generate sensible search range for each parameter.
source code

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

    Handling photometric data
 
get_photometry(self, radius=None, ra=None, dec=None, include=None, exclude=None, force=False, units='erg/s/cm2/AA')
Search photometry on the net or from the phot file if it exists.
source code
 
get_spectrophotometry(self, directory=None, force_download=False)
Retrieve and combine spectra.
source code
 
exclude(self, names=None, wrange=None, sources=None, indices=None)
Exclude (any) photometry from fitting process.
source code
 
exclude_colors(self, names=None, wrange=None, sources=None, indices=None)
Exclude (color) photometry from fitting process.
source code
 
exclude_abs(self, names=None, wrange=None, sources=None, indices=None)
Exclude (absolute) photometry from fitting process.
source code
 
include(self, names=None, wrange=None, sources=None, indices=None)
Include (any) photometry in fitting process.
source code
 
include_colors(self, names=None, wrange=None, sources=None, indices=None)
Include (color) photometry in fitting process.
source code
 
include_abs(self, names=None, wrange=None, sources=None, indices=None)
Include (absolute) photometry in fitting process.
source code
 
set_photometry_scheme(self, scheme, infrared=(1,'micron'))
Set a default scheme of colors/absolute values to fit the SED.
source code
 
add_photometry_fromarrays(self, meas, e_meas, units, photbands, source, flags=None, phases=None)
Add photometry from numpy arrays
source code
    Additional information
bool
is_target(self, name)
Check if this SED represents the object `name'.
source code
bool
has_photfile(self)
Check if this SED has a phot file.
source code
(float,float)
get_distance_from_plx(self, plx=None, lutz_kelker=True, unit='pc')
Get the probability density function for the distance, given a parallax.
source code
 
get_interstellar_reddening(self, distance=None, Rv=3.1)
Under construction.
source code
 
get_angular_diameter(self)
Under construction.
source code
(float,float)
compute_distance(self, mtype='igrid_search')
Compute distance from radius and angular diameter (scale factor).
source code
    Fitting routines
 
clip_grid(self, mtype='igrid_search', CI_limit=None)
Clip grid on CI limit, to save memory.
source code
 
collect_results(self, grid=None, fitresults=None, mtype='igrid_search', selfact='chisq', **kwargs)
creates record array(s) of all fit results and removes the failures
source code
 
calculateDF(self, **ranges)
Calculates the degrees of freedom from the given ranges
source code
 
calculate_statistics(self, df=None, ranges=None, mtype='igrid_search', selfact='chisq')
Calculates the Chi2 and reduced Chi2 based on nr of observations and degrees of freedom.
source code
 
calculate_confidence_intervals(self, mtype='igrid_search', chi2_type='red', CI_limit=None)
Compute confidence interval of all columns in the results grid.
source code
 
store_confidence_intervals(self, mtype='igrid_search', name=None, value=None, cilow=None, cihigh=None, **kwargs)
Saves the provided confidence intervals in the result dictionary of self.
source code
 
igrid_search(self, points=100000, teffrange=None, loggrange=None, ebvrange=None, zrange=(0,0), rvrange=(3.1,3.1), vradrange=(0,0), df=None, CI_limit=None, set_model=True, exc_interpolpar=[], **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
 
calculate_iminimize_CI(self, mtype='iminimize', CI_limit=0.66, **kwargs) source code
 
calculate_iminimize_CI2D(self, xpar, ypar, mtype='iminimize', limits=None, res=10, **kwargs) source code
 
_get_imin_ci(self, mtype='iminimize', **ranges)
returns ci information for store_confidence_intervals
source code
 
iminimize(self, teff=None, logg=None, ebv=None, z=0, rv=3.1, vrad=0, teffrange=None, loggrange=None, ebvrange=None, zrange=None, rvrange=None, vradrange=None, points=None, distance=None, start_from='igrid_search', df=None, CI_limit=None, calc_ci=False, set_model=True, **kwargs)
Basic minimizer method for SED fitting implemented using the lmfit library from sigproc.fit
source code
 
imc(self, teffrange=None, loggrange=None, ebvrange=None, zrange=None, start_from='igrid_search', distribution='uniform', points=None, fitmethod='fmin', disturb=True) source code
    Interfaces
 
clear(self)
Clear the results.
source code
 
set_best_model(self, mtype='igrid_search', law='fitzpatrick2004', **kwargs)
Get reddenend and unreddened model
source code
 
set_model(self, wave, flux, label='manual', unique_phase=None)
Manually set the best SED model.
source code
 
get_model(self, label='igrid_search')
Retrieve the best SED model.
source code
 
sample_gridsearch(self, mtype='igrid_search', NrSamples=1, df=None, selfact='chisq')
Retrieve an element from the results of a grid search according to the derived probability.
source code
 
chi2(self, select=None, reduced=False, label='igrid_search')
Calculate chi2 of best model.
source code
    Add constraints
 
add_constraint_distance(self, distance=None, mtype='igrid_search', **kwargs)
Use the distance to compute additional information.
source code
 
add_constraint_slo(self, numax, Deltanu0, mtype='igrid_search', chi2_type='red')
Use diagnostics from solar-like oscillations to put additional constraints on the parameters.
source code
 
add_constraint_reddening(self, distance=None, ebv=None, e_ebv=0.1, Rv=3.1, model=None, mtype='igrid_search', chi2_type='red', upper_limit=False)
Use reddening maps to put additional constraints on the parameters.
source code
 
add_constraint_angular_diameter(self, angdiam) source code
 
add_constraint_mass(self, mass, mtype='igrid_search', chi2_type='red')
Add constraints on the mass.
source code
 
add_constraint_evolution_models(self, models='siess2000', ylabels=['age','labs','radius'], e_y=None, function='linear', mtype='igrid_search', chi2_type='red')
Use stellar evolutionary models to put additional constraints on the parameters.
source code
    Plotting routines
 
_label_dict(self, param)
Returns the label belonging to a certain parameter
source code
 
plot_grid(self, x='teff', y='logg', ptype='ci_red', mtype='igrid_search', limit=0.95, d=None, **kwargs)
Plot grid as scatter plot
source code
 
plot_CI2D(self, xpar='teff', ypar='logg', mtype='iminimize', ptype='ci_red', **kwargs)
Plot a 2D confidence intervall calculated using the CI2D computation from calculate_iminimize_CI2D.
source code
 
plot_data(self, colors=False, plot_unselected=True, unit_wavelength='angstrom', unit_flux=None, **kwargs)
Plot only the SED data.
source code
 
plot_sed(self, colors=False, mtype='igrid_search', plot_redded=True, plot_deredded=False, plot_unselected=True, wave_units='AA', flux_units='erg/s/cm2', **kwargs)
Plot a fitted SED together with the data.
source code
 
plot_chi2(self, colors=False, mtype='igrid_search', **kwargs)
Plot chi2 statistic for every datapoint included in the fit.
source code
 
plot_distance(self, mtype='igrid_search') source code
 
plot_grid_model(self, ptype='prob')
Grid of models
source code
 
plot_MW_side(self) source code
 
plot_MW_top(self) source code
 
plot_finderchart(self, cmap_photometry=pl.cm.spectral, window_size=5.)
Size is x and y width in arcminutes
source code
 
make_plots(self)
Make all available plots
source code
    Input and output
 
save_photometry(self, photfile=None)
Save master photometry to a file.
source code
 
load_photometry(self, photfile=None)
Load the contents of the photometry file to the master record.
source code
 
save_fits(self, filename=None, overwrite=True)
Save content of SED object to a FITS file.
source code
 
load_fits(self, filename=None)
Load a previously made SED FITS file.
source code
string
save_hdf5(self, filename=None, update=True)
Save content of SED object to a HDF5 file.
source code
bool
load_hdf5(self, filename=None)
Load a previously made SED from HDF5 file.
source code
 
save_bibtex(self)
Convert the bibcodes in a phot file to a bibtex file.
source code
 
save_summary(self, filename=None, CI_limit=None, method='igrid_search', chi2type='ci_red')
Save a summary of the results to an ASCII file.
source code
 
save_important_info(self, filename=None, CI_limit=None, method='igrid_search', chi2type='ci_red')
Save a summary of the results to an ASCII file.
source code
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='')
(Constructor)

source code 

Initialize SED class.

Different ways to initialize:

1. If no previous data are saved:

>>> mysed = SED('HD129929')

2. If previous data exists:

>>> #mysed = SED(photfile='HD129929.phot') # will set ID with 'oname' field from SIMBAD
>>> #mysed = SED(ID='bla', photfile='HD129929.phot') # Sets custom ID

The ID variable is used internally to look up data, so it should be something SIMBAD understands and that designates the target.

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

__repr__(self)
(Representation operator)

source code 

Machine readable string representation of an SED object.

Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

Human readable string representation of an SED object.

Overrides: object.__str__

get_photometry(self, radius=None, ra=None, dec=None, include=None, exclude=None, force=False, units='erg/s/cm2/AA')

source code 

Search photometry on the net or from the phot file if it exists.

For bright stars, you can set radius a bit higher...

Parameters:
  • radius (float.) - search radius (arcseconds)

get_spectrophotometry(self, directory=None, force_download=False)

source code 

Retrieve and combine spectra.

WARNING: this function creates FUSE and DIR directories!

exclude(self, names=None, wrange=None, sources=None, indices=None)

source code 

Exclude (any) photometry from fitting process.

If called without arguments, all photometry will be excluded.

set_photometry_scheme(self, scheme, infrared=(1,'micron'))

source code 

Set a default scheme of colors/absolute values to fit the SED.

Possible values:

  1. scheme = 'abs': means excluding all colors, including all absolute values
  2. scheme = 'color': means including all colors, excluding all absolute values
  3. scheme = 'combo': means inculding all colors, and one absolute value per system (the one with the smallest relative error)
  4. scheme = 'irfm': means mimic infrared flux method: choose absolute values in the infrared (define with infrared), and colours in the optical
Parameters:
  • infrared (tuple (value <float>, unit <str>)) - definition of start of infrared for infrared flux method

add_photometry_fromarrays(self, meas, e_meas, units, photbands, source, flags=None, phases=None)

source code 

Add photometry from numpy arrays

By default unflagged, and at the ra and dec of the star. No color and included.

Parameters:
  • meas (array) - original measurements (fluxes, magnitudes...)
  • e_meas (array) - error on original measurements in same units as meas
  • units (array of strings) - units of original measurements
  • photbands (array of strings) - photometric passbands of original measurements
  • source (array of strings) - source of original measurements

is_target(self, name)

source code 

Check if this SED represents the object `name'.

Purpose: solve alias problems. Maybe the ID is 'HD129929', and you are checking for "V* V836 Cen", which is the same target.

Parameters:
  • name (str) - object name
Returns: bool
True if this object instance represent the target "name".

has_photfile(self)

source code 

Check if this SED has a phot file.

Returns: bool
True if this object instance has a photfile

get_distance_from_plx(self, plx=None, lutz_kelker=True, unit='pc')

source code 

Get the probability density function for the distance, given a parallax.

If no parallax is given, the catalogue value will be used. If that one is also not available, a ValueError will be raised.

Parallax must be given in mas.

If the parallax is a float without uncertainty, an uncertainty of 0 will be assumed.

If lutz_kelker=True, a probability density function will be given for the distance, otherwise the distance is computed from simply inverting the parallax.

Distance is returned in parsec (pc).

Returns: (float,float)
distance

compute_distance(self, mtype='igrid_search')

source code 

Compute distance from radius and angular diameter (scale factor).

The outcome is added to the results attribute:

   distance = r/sqrt(scale)

This particularly useful when you added constraints from solar-like oscillations (add_constraint_slo).

Returns: (float,float)
distance,uncertainty (pc)

clip_grid(self, mtype='igrid_search', CI_limit=None)

source code 

Clip grid on CI limit, to save memory.

Parameters:
  • mtype (str) - type or results to clip
  • CI_limit (float (between 0 (clips everything) and 1 (clips nothing))) - confidence limit to clip on

calculate_statistics(self, df=None, ranges=None, mtype='igrid_search', selfact='chisq')

source code 

Calculates the Chi2 and reduced Chi2 based on nr of observations and degrees of freedom. If df is not provided, tries to calculate df from the fitting ranges.

calculate_confidence_intervals(self, mtype='igrid_search', chi2_type='red', CI_limit=None)

source code 

Compute confidence interval of all columns in the results grid.

Parameters:
  • mtype (str) - type of results to compute confidence intervals of
  • chi2_type (str ('raw' or 'red')) - type of chi2 (raw or reduced)
  • CI_limit (float (between 0 (clips everything) and 1 (clips nothing))) - confidence limit to clip on

store_confidence_intervals(self, mtype='igrid_search', name=None, value=None, cilow=None, cihigh=None, **kwargs)

source code 

Saves the provided confidence intervals in the result dictionary of self. The provided confidence intervals will be saved in a dictionary: self.results[mtype]['CI'] with as key for the value the name, for cilow: name_l and for cihigh: name_u.

Parameters:
  • mtype (str) - the search type
  • name (array) - names of the parameters
  • value (array) - best fit values
  • cilow (array) - lower CI limit
  • cihigh (array) - upper CI limit

igrid_search(self, points=100000, teffrange=None, loggrange=None, ebvrange=None, zrange=(0,0), rvrange=(3.1,3.1), vradrange=(0,0), df=None, CI_limit=None, set_model=True, exc_interpolpar=[], **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.

There is an option to exclude a certain parameter from the interpolation. This is done by including it in a list attached to the keyword 'exc_interpolpar', e.g. exc_interpolpar = ['z'].

set_model(self, wave, flux, label='manual', unique_phase=None)

source code 

Manually set the best SED model.

This is particularly useful when working with calibrators for which there is an observed SED.

The label will be used to store the model in the results attribute.

Parameters:
  • wave (ndarray) - wavelength array (angstrom)
  • flux (ndarray) - flux array (erg/s/cm2/AA)
  • label (s str) - key used to store the model and synthetic photometry in results

get_model(self, label='igrid_search')

source code 

Retrieve the best SED model.

Warning: the grid search interpolation is also done with interpolation in metallicity, while this is not the case for the best full SED model. Interpolation of the full SED is only done in teff/logg, and the metallicity is chosen to be equal to the closest grid point. On the other hand, while the reddening value is interpolated in the grid search, this is not the case for the best model (the model is simply reddened according the found best value). So don't be surprised if you find differences between the values of self.results[label]['synflux'], which are the value sfor the interpolated photometric points of the best model, and the synthetic photometry obtained by manual integration of the returned full SED model. Those differences should be incredible small and mainly due to the metallicity.

sample_gridsearch(self, mtype='igrid_search', NrSamples=1, df=None, selfact='chisq')

source code 

Retrieve an element from the results of a grid search according to the derived probability.

An array of length "NrSamples" containing 'grid-indices' is returned, so the actual parameter values of the corresponding model can be retrieved from the results dictionary.

Parameters:
  • NrSamples (int) - the number of samples you wish to draw

chi2(self, select=None, reduced=False, label='igrid_search')

source code 

Calculate chi2 of best model.

TEMPORARY!!! API WILL CHANGE!!!

This function is not called anywhere in the builder.

add_constraint_distance(self, distance=None, mtype='igrid_search', **kwargs)

source code 

Use the distance to compute additional information.

Compute radii, absolute luminosities and masses, and add them to the results.

Extra kwargs go to get_distance_from_plx.

Warning: after calling this function, the labs column in the grid is actually absolutely calibrated and reflects the true absolute luminosity instead of the absolute luminosity assuming 1 solar radius.

Parameters:
  • distance (tuple (float,float)) - distance in solar units and error
  • mtype (str) - type of results to add the information to

add_constraint_slo(self, numax, Deltanu0, mtype='igrid_search', chi2_type='red')

source code 

Use diagnostics from solar-like oscillations to put additional constraints on the parameters.

If the results are constrained with the distance before add_constraint_distance, then these results are combined with the SLO constraints.

Parameters:
  • numax (3-tuple (value,error,unit)) - frequency of maximum amplitude
  • Deltanu0 (3-tuple (value,error,unit)) - large separation (l=0)
  • chi2_type (str ('raw' or 'red')) - type of chi2 (raw or reduced)

add_constraint_reddening(self, distance=None, ebv=None, e_ebv=0.1, Rv=3.1, model=None, mtype='igrid_search', chi2_type='red', upper_limit=False)

source code 

Use reddening maps to put additional constraints on the parameters.

This constraint assumes that, if upper_limit=False, given the distance to target, the reddening from the reddening maps is similar to the one derived from the SED. All models where this is not the case will be deemed improbable.

If upper_limit=True, all models with an E(B-V) value above ebv will be considered improbable.

When you don't set ebv, the value will, by default, be derived from Drimmel maps if upper_limit=False and from Schlegel if upper_limit=True. You can change this behaviour by setting model manually.

Parameters:
  • distance (tuple (float,float)) - distance and uncertainty in parsec
  • ebv (float) - E(B-V) reddening in magnitude
  • e_ebv (float) - error on the reddening in percentage
  • model (str) - model reddening maps
  • mtype (str) - type of results to add the information to
  • upper_limit (bool) - consider the E(B-V) value as an upper limit

add_constraint_mass(self, mass, mtype='igrid_search', chi2_type='red')

source code 

Add constraints on the mass.

mass must be a tuple, if the second element is smaller than the first, it is assumed to be (mu,sigma) from a normal distribution. If the second element is larger than the first, it is assumed to be (lower, upper) from a uniform distribution.

_label_dict(self, param)

source code 

Returns the label belonging to a certain parameter

If the label is not present, the function will just return param.

plot_grid(self, x='teff', y='logg', ptype='ci_red', mtype='igrid_search', limit=0.95, d=None, **kwargs)

source code 

Plot grid as scatter plot

Prameterptype sets the colors of the scattered points (e.g., 'ci_red','z','ebv').

Example usage:

First set the SED:

>>> mysed = SED('HD180642')
>>> mysed.load_fits()

Then make the plots:

>>> p = pl.figure()
>>> p = pl.subplot(221);mysed.plot_grid(limit=None)
>>> p = pl.subplot(222);mysed.plot_grid(x='ebv',y='z',limit=None)
>>> p = pl.subplot(223);mysed.plot_grid(x='teff',y='ebv',limit=None)
>>> p = pl.subplot(224);mysed.plot_grid(x='logg',y='z',limit=None)

]]include figure]]ivs_sed_builder_plot_grid_01.png]

Decorators:
  • @standalone_figure

plot_CI2D(self, xpar='teff', ypar='logg', mtype='iminimize', ptype='ci_red', **kwargs)

source code 

Plot a 2D confidence intervall calculated using the CI2D computation from calculate_iminimize_CI2D. Make sure you first calculate the grid you want using the calculate_iminimize_CI2D function.

Decorators:
  • @standalone_figure

plot_data(self, colors=False, plot_unselected=True, unit_wavelength='angstrom', unit_flux=None, **kwargs)

source code 

Plot only the SED data.

Extra kwargs are passed to plotting functions.

The decorator provides an keyword savefig. When set to True, an image name is generated automatically (very long!), and the figure is closed. When set to a string, the image is saved with that name, and the figure is closed. When savefig is not given, the image will stay open so that the user can still access all plot elements and do further enhancements.

Parameters:
  • colors (boolean) - if False, plot absolute values, otherwise plot colors (flux ratios)
  • plot_unselected - if True, all photometry is plotted, otherwise only those that are selected
Decorators:
  • @standalone_figure

plot_sed(self, colors=False, mtype='igrid_search', plot_redded=True, plot_deredded=False, plot_unselected=True, wave_units='AA', flux_units='erg/s/cm2', **kwargs)

source code 

Plot a fitted SED together with the data.

Example usage:

First set the SED:

>>> mysed = SED('HD180642')
>>> mysed.load_fits()

Then make the plots:

>>> p = pl.figure()
>>> p = pl.subplot(121)
>>> mysed.plot_sed(colors=False)
>>> p = pl.subplot(122)
>>> mysed.plot_sed(colors=True)

]]include figure]]ivs_sed_builder_plot_sed_01.png]

Decorators:
  • @standalone_figure

plot_chi2(self, colors=False, mtype='igrid_search', **kwargs)

source code 

Plot chi2 statistic for every datapoint included in the fit.

To plot the statistic from the included absolute values, set colors=False.

To plot the statistic from the included colors, set colors=True.

Example usage:

First set the SED:

>>> mysed = SED('HD180642')
>>> mysed.load_fits()

Then make the plots:

>>> p = pl.figure()
>>> p = pl.subplot(121)
>>> mysed.plot_chi2(colors=False)
>>> p = pl.subplot(122)
>>> mysed.plot_chi2(colors=True)

]]include figure]]ivs_sed_builder_plot_chi2_01.png]

Parameters:
  • colors (boolean) - flag to distinguish between colors and absolute values
Decorators:
  • @standalone_figure

plot_distance(self, mtype='igrid_search')

source code 
Decorators:
  • @standalone_figure

plot_grid_model(self, ptype='prob')

source code 

Grid of models

Decorators:
  • @standalone_figure

plot_MW_side(self)

source code 
Decorators:
  • @standalone_figure

plot_MW_top(self)

source code 
Decorators:
  • @standalone_figure

plot_finderchart(self, cmap_photometry=pl.cm.spectral, window_size=5.)

source code 

Size is x and y width in arcminutes

Decorators:
  • @standalone_figure

save_photometry(self, photfile=None)

source code 

Save master photometry to a file.

Parameters:
  • photfile (str) - name of the photfile. Defaults to starname.phot.

load_photometry(self, photfile=None)

source code 

Load the contents of the photometry file to the master record.

Parameters:
  • photfile (str) - name of the photfile. Defaults to the value of self.photfile.

save_fits(self, filename=None, overwrite=True)

source code 

Save content of SED object to a FITS file.

The .fits file will contain the following extensions if they are present in the object:
   1) data (all previously collected photometric data = content of .phot file)
   2) model_igrid_search (full best model SED table from grid_search)
   3) igrid_search (CI from grid search = actual grid samples)
   4) synflux_igrid_search (integrated synthetic fluxes for best model from grid_search)
   5) model_imc (full best model SED table from monte carlo)
   6) imc (CI from monte carlo = actual monte carlo samples)
   7) synflux_imc (integrated synthetic fluxes for best model from monte carlo)

@param filename: name of SED FITS file
@type filename: string
@param overwrite: overwrite old FITS file if true
@type overwrite: boolean

Example usage:

>>> #mysed.save_fits()
>>> #mysed.save_fits(filename='myname.fits')

load_fits(self, filename=None)

source code 

Load a previously made SED FITS file. Only works for SEDs saved with
the save_fits function after 14.06.2012.

The .fits file can contain the following extensions:
   1) data (all previously collected photometric data = content of .phot file)
   2) model_igrid_search (full best model SED table from grid_search)
   3) igrid_search (CI from grid search = actual grid samples)
   4) synflux_igrid_search (integrated synthetic fluxes for best model from grid_search)
   5) model_imc (full best model SED table from monte carlo)
   6) imc (CI from monte carlo = actual monte carlo samples)
   7) synflux_imc (integrated synthetic fluxes for best model from monte carlo)

@param filename: name of SED FITS file
@type filename: string
@rtype: bool
@return: true if Fits file could be loaded

save_hdf5(self, filename=None, update=True)

source code 

Save content of SED object to a HDF5 file. (HDF5 is the successor of FITS files, providing a clearer structure of the saved content.) This way of saving is more thorough that save_fits(), fx. the CI2D confidence intervals are not save to a fits file, but are saved to a hdf5 file. Currently the following data is saved to HDF5 file:

  • sed.master (photometry)
  • sed.results (results from all fitting methods)
  • sed.constraints (extra constraints on the fits)
Parameters:
  • filename (string) - name of SED FITS file
  • update (bool) - if True, an existing file will be updated with the current information, if False, an existing fill be overwritten
Returns: string
the name of the output HDF5 file.

load_hdf5(self, filename=None)

source code 

Load a previously made SED from HDF5 file.

Parameters:
  • filename (string) - name of SED FITS file
Returns: bool
True if HDF5 file could be loaded

save_bibtex(self)

source code 

Convert the bibcodes in a phot file to a bibtex file.

The first line in the bibtex file contains a \citet command citing all photometry.