TemplateGrid

class eazy.photoz.TemplateGrid(zgrid, templates, RES='FILTERS.RES.latest', f_numbers=[156], add_igm=True, galactic_ebv=0, Eb=0, n_proc=4, interpolator=None, filters=None, verbose=2, cosmology=None, array_dtype=<class 'numpy.float32'>, tempfilt_data=None)[source]

Bases: object

Integrate filters through filters on a redshift grid

Parameters:
zgridarray

Redshift grid

templateslist

List of Template objects

RESstr

Filename of a FilterFile, or the object itself.

f_numberslist

List of unit-indexed filter numbers for the desired filters to integrate.

add_igmbool

Add IGM absorption as a function of redshift

galactic_ebvfloat

MW extinction \(E(B-V)\)

Ebfloat

Extra dust bump Drude profile to apply to galactic extinction

n_procint

Number of parallel processes

interpolatorNone

See init_interpolator

filterslist, optional

Explicit list of filters to bypass RES and f_numbers

verboseint

Some control over status messages

cosmologyastropy.cosmology object

(Not really used here)

array_dtypedtype

Data type for computed arrays

tempfilt_dataarray

Precomputed array of integrated fluxes

Attributes:
NZ

Number of redshift grid points

NFILT

Number of filters

NTEMP

Number of templates

pivot

Filter pivot wavelengths

zgridarray (NZ)

Redshfit grid

trdzarray (NZ)

Array for trapezoid integration as a dot product (see trapz_dx)

tempfiltarray (NZ, NTEMP, NFILT)

Templates integrated through filter bandpasses on the redshift grid.

splineinterpolator

Spline interpolator that interpolates tempfilt at a specified redshift

Attributes Summary

NFILT

Number of filters

NOBJ

Number of objects in catalog

NTEMP

Number of templates

NZ

Number of redshift grid points

lc

Filter pivot wavelengths (deprecated, use pivot)

pivot

Filter pivot wavelengths

Methods Summary

__call__(z)

Interpolate filter flux grid at specified redshift

apply_SFH_constraint([max_mass_frac, ...])

Set interpolated template fluxes to zero for a given redshift/tmeplate combination if the accumulated stellar mass fraction at ages older than the age of the universe is greater than max_mass_frac.

init_interpolator([interpolator])

Initialize filter flux interpolator

Attributes Documentation

NFILT

Number of filters

NOBJ

Number of objects in catalog

NTEMP

Number of templates

NZ

Number of redshift grid points

lc

Filter pivot wavelengths (deprecated, use pivot)

pivot

Filter pivot wavelengths

Methods Documentation

__call__(z)[source]

Interpolate filter flux grid at specified redshift

apply_SFH_constraint(max_mass_frac=0.5, cosmology=None, sfh_file='templates/fsps_full/fsps_QSF_12_v3.sfh.fits')[source]

Set interpolated template fluxes to zero for a given redshift/tmeplate combination if the accumulated stellar mass fraction at ages older than the age of the universe is greater than max_mass_frac.

Requires the “sfh.fits” file.

Warning

The implementation seems to work but the results when applied to running on a full catalog don’t seem very reliable, probably caused by the effect of clipping out templates at discrete redshifts.

init_interpolator(interpolator=None)[source]

Initialize filter flux interpolator

Parameters:
interpolatorNone or a scipy.interpolate class.

Defaults to scipy.interpolate.Akima1DInterpolator which has desirable smooth behavior robust to large curvature in the interpolated data.