Home | Trees | Indices | Help |
---|
|
Fit SED models to observed data using various approaches.
|
|||
PCA functions | |||
---|---|---|---|
N-D numpy array,(1Darray,1Darray,1Darray) |
|
||
N-D array, N-D array, (1D array, 1D array) |
|
||
n-tuple |
|
||
list of lists |
|
||
Grid search | |||
float,float,float |
|
||
|
|||
|
|||
record array |
|
||
record array |
|
||
Fitting: grid search | |||
array |
|
||
4/5X1d array |
|
||
Fitting: minimizer | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
logger = logging.getLogger("SED.FIT")
|
|
Transform a flux grid to a colour grid. The resulting grid is actually log10(flux ratio) instead of flux ratio! This works better in the PCA. Extra keyword arguments can be used to set the atmosphere model.
|
Find the principal components of a color grid.
|
Define the interpretations of the principal components. T are the PCA scores, pars a list of axes (e.g. teff, logg and ebv).
|
Derive fundamental parameters of a sample of observations given a PCA. Monte Carlo simulations are only available when you give 1 target.
|
Calculate Chi2 and compute angular diameter. Colors and absolute fluxes are used to compute the Chi2, only absolute fluxes are used to compute angular diameter. If no absolute fluxes are given, the angular diameter is set to 0.
|
Generate a grid of parameters for 1 or more stars. Based on the generate_grid_single_pix method. The radius of the components is based on the masses if given, otherwise on the radrange arguments. If masses are given the radrange arguments are ignored, meaning that the returned radius can be outside those limits. If only 1 component is provided no radius will be returned. This function can handle multiple components in the same way as a single component. parameter ranges are provided as <parname><component>range=(...,...). fx: teffrange = (5000, 10000), loggrange = (3.5, 4.5), teff2range = (10000, 20000), logg2range = (5.5, 6.0) For the first (or only) component both no component number (teffrange) or 1 as component number (teff1range) can be used. Returns a dictionary with for each parameter that has a range provided, an array of values. In the case of multiple components, the radius will be returned even is no radius ranges are provided. |
Generate grid points at which to fit an interpolated grid of SEDs. If Extra keyword arguments can be used to give more details on the atmosphere models to use. Colors are automatically detected. You can fix one parameter e.g. via setting teffrange=(10000,10000). >>> photbands = ['GENEVA.G','GENEVA.B-V'] Start a figure: >>> p = pl.figure() >>> rows,cols = 2,4 On the grid points, but only one in every 100 points (otherwise we have over a million points):
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,res=100)
>>> p = pl.subplot(rows,cols,1) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,1+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Randomly distributed over the grid's ranges:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,points=10000)
>>> p = pl.subplot(rows,cols,2) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,2+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Confined to a small area in the grid's range:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,teffrange=(8000,10000),loggrange=(4.1,4.2),zrange=(0,inf),ebvrange=(1.,2),points=10000)
>>> p = pl.subplot(rows,cols,3) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,3+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Confined to a small area in the grid's range with some parameters fixed:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,teffrange=(8765,8765),loggrange=(4.1,4.2),zrange=(0,0),ebvrange=(1,2),points=10000)
>>> p = pl.subplot(rows,cols,4) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,4+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') ]include figure]]ivs_sed_fit_grids.png]
|
Generate grid points at which to fit an interpolated grid of SEDs. If Setting Extra keyword arguments can be used to give more details on the atmosphere models to use. Colors are automatically detected. You can fix one parameter e.g. via setting teffrange=(10000,10000). >>> photbands = ['GENEVA.G','GENEVA.B-V'] Start a figure: >>> p = pl.figure() >>> rows,cols = 2,4 On the grid points, but only one in every 100 points (otherwise we have over a million points):
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,res=100)
>>> p = pl.subplot(rows,cols,1) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,1+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Randomly distributed over the grid's ranges:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,points=10000)
>>> p = pl.subplot(rows,cols,2) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,2+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Confined to a small area in the grid's range:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,teffrange=(8000,10000),loggrange=(4.1,4.2),zrange=(0,inf),ebvrange=(1.,2),points=10000)
>>> p = pl.subplot(rows,cols,3) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,3+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') Confined to a small area in the grid's range with some parameters fixed:
>>> teffs,loggs,ebvs,zs = generate_grid(photbands,teffrange=(8765,8765),loggrange=(4.1,4.2),zrange=(0,0),ebvrange=(1,2),points=10000)
>>> p = pl.subplot(rows,cols,4) >>> p = pl.scatter(teffs,loggs,c=ebvs,s=(zs+5)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlim(pl.xlim()[::-1]);p = pl.ylim(pl.ylim()[::-1]) >>> p = pl.xlabel('Teff');p = pl.ylabel('Logg') >>> p = pl.subplot(rows,cols,4+cols) >>> p = pl.scatter(ebvs,zs,c=teffs,s=(loggs+2)*10,edgecolors='none',cmap=pl.cm.spectral) >>> p = pl.xlabel('E(B-V)');p = pl.ylabel('Z') ]include figure]]ivs_sed_fit_grids.png]
|
Run over gridpoints and evaluate model The measurements are defined via The grid points are defined via At each grid point, the pre-calculated photometry will be retrieved
via the keyword Extra arguments are passed to parallel_gridsearch for parallelization and to {model_func} for further specification of grids etc. The index array is returned to trace the results after parallelization.
|
Run over gridpoints and evaluate model The measurements are defined via The grid points are defined via At each grid point, the pre-calculated photometry will be retrieved
via the keyword Extra arguments are passed to parallel_gridsearch for parallelization and to {model_func} for further specification of grids etc. The index array is returned to trace the results after parallelization.
|
minimizer based on the sigproc.fit lmfit minimizer. provide the observed data, the fitting model, residual function and parameter information about the variables, and this function will return the best fit parameters together with extra information about the fit. if the fitkws keyword is supplied, this dict will be made available to the model_func (fit model) during the fitting process. The order of the parameters will also be made available as the 'pnames' keyword. |
Calculate the confidence intervalls for every parameter. When ci fails, the boundaries are returned as ci. |
Calculate a 2D confidence grid for the given parameters. You can provide limits on the parameters yourself, if none are provided, the function will take care of it, but it might crash if the limits are outside the model range. returns: x vals, y vals, ci values |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Mar 30 10:45:19 2018 | http://epydoc.sourceforge.net |