Package ivs :: Package sed :: Module creategrids
[hide private]
[frames] | no frames]

Module creategrids

source code

Create photometric and spectral grid.

It is possible to run this module from the terminal, e.g., to generate a limb darkening grid. All input is automatically processed, so there are a few tweaks you need to take into account when supplying parameters. Some of them are explained in the ivs.aux.argkwargparser module.

Examples:

   $:> python creategrids.py calc_limbdark_grid 'responses=["OPEN.BOL","MOST.V","GENEVA"]' ebvs=[0.05] outfile=mygrid.fits
Functions [hide private]
    Helper functions
 
get_responses(responses=None, add_spectrophotometry=False, wave=(0,np.inf))
Get a list of response functions and their information.
source code
    Limb darkening coefficients
 
calc_limbdark_grid(responses=None, vrads=[0], ebvs=[0], zs=[0.], ld_law='claret', fitmethod='equidist_r_leastsq', outfile=None, force=False, **kwargs)
Calculate a grid of limb-darkening coefficients.
source code
    Integrated photometry
 
calc_integrated_grid(threads=1, ebvs=None, law='fitzpatrick2004', Rv=3.1, units='Flambda', responses=None, update=False, add_spectrophotometry=False, **kwargs)
Integrate an entire SED grid over all passbands and save to a FITS file.
source code
 
update_grid(gridfile, responses, threads=10)
Add passbands to an existing grid.
source code
 
fix_grid(grid) source code
Variables [hide private]
  logger = logging.getLogger('IVS.SED.CREATE')
Function Details [hide private]

get_responses(responses=None, add_spectrophotometry=False, wave=(0,np.inf))

source code 

Get a list of response functions and their information.

You can specify bandpass systems (e.g. GENEVA) and then all Geveva filters will be collected. You can also specific specific bandpasses (e.g. GENEVA.V), in which case only that one will be returned. The default None returns all systems except some Hubble ones.

You can also set responses to None and give a wavelength range for filter selection.

Example input for responses are:

>>> responses = ['GENEVA.V','2MASS.J']
>>> responses = ['GENEVA','2MASS.J']
>>> responses = ['BOXCAR','STROMGREN']
>>> responses = None
Parameters:
  • responses (list of str) - a list of filter systems of passbands
  • add_spectrophotometry (bool) - add spectrophotometric filters to the filter list
  • wave (tuple (float,float)) - wavelength range

calc_limbdark_grid(responses=None, vrads=[0], ebvs=[0], zs=[0.], ld_law='claret', fitmethod='equidist_r_leastsq', outfile=None, force=False, **kwargs)

source code 

Calculate a grid of limb-darkening coefficients.

You need to specify a list of response curves, and a grid of radial velocity (vrads), metallicity (z) and reddening (ebvs) points. You can choose which law to fit and with which fitmethod. Extra kwargs specify the properties of the atmosphere grid to be used.

If you give a gridfile that already exists, the current file is simply updated with the new passbands, i.e. all overlapping response curves will not be recomputed. Unless you set force=True, in which case previous calculations will be overwritten. You'd probably only want to update or overwrite existing files if you use the same vrads, ebvs, zs etc...

The generated FITS file has the following structure:

  1. The primary HDU is empty. The primary header contains only the fit routine (FIT), LD law (LAW) and used grid (GRID)
  2. Each table extension has the name of the photometric passband (e.g. "GENEVA.V". Each record in the table extension has the following columns: Teff, logg, ebv, vrad, z (the grid points) and a1, a2, a3, a4 (the limb darkening coefficients) and Imu1 (the intensity in the center of the disk) and SRS, dint (fit evaluation parameters, see ivs.sed.limbdark). Although the system and filter can be derived from the extension name, there are also separate entries in the header for "SYSTEM" and "FILTER".

Example usage:

>>> calc_limbdark_grid(['MOST.V','GENEVA'],vrads=[0],ebvs=[0.06],zs=[0,0],    ...  law='claret',fitmethod='equidist_r_leastsq',outfile='HD261903.fits')

calc_integrated_grid(threads=1, ebvs=None, law='fitzpatrick2004', Rv=3.1, units='Flambda', responses=None, update=False, add_spectrophotometry=False, **kwargs)

source code 

Integrate an entire SED grid over all passbands and save to a FITS file.

The output file can be used to fit SEDs more efficiently, since integration over the passbands has already been carried out.

WARNING: this function can take a loooooong time to compute!

Extra keywords can be used to specify the grid.

Parameters:
  • threads - number of threads @type threads; integer, 'max', 'half' or 'safe'
  • ebvs (numpy array) - reddening parameters to include
  • law (string (valid law name, see reddening.py)) - interstellar reddening law to use
  • Rv (float) - Rv value for reddening law
  • units (str, one of 'Flambda','Fnu') - choose to work in 'Flambda' or 'Fnu'
  • responses (list of strings) - respons curves to add (if None, add all)
  • update (boolean) - if true append to existing FITS file, otherwise overwrite possible existing file.