Coverage for python/lsst/sims/catUtils/IGM/applyIGM.py : 99%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" This class applies IGM to SED objects using lookup tables. If users want to enter their own lookup tables they can do that by specifying self.meanLookups and self.varLookups which are dictionaries containing redshift as the keys with (wavelength, transmission) arrays as the values. """
""" Initialize an applyIGM object with the desired redshift grid. If lookup tables are not evenly spaced in redshift then input manually desired zRange array.
@param [in] zMin is the minimum redshift.
@param [in] zMax is the maximum redshift.
@param [in] zDelta is the redshift spacing.
@param [in] minWavelen is the minimum wavelength in the lookup tables """ #Don't have max wavelength since transmission goes to 1.0 at longest wavelengths
'python/lsst/sims/catUtils/IGM/igm_tables')
""" Read in and store in dictionary the IGM Lookup Tables that contain IGM transmission for a given redshift and must be formatted in two columns: (wavelength (nm), IGM Transmission %) or for variance (wavelength (nm), IGM Transmission % Variance). Variance tables are not required and can be turned off as a requirement. Names in directory formatted as 'MeanLookupTable_zSourceX.X.tbl' or 'VarLookupTable_zSourceX.X.tbl' where X.X is the redshift of the given lookup table.
@param [in] filesDir is the location of the directory where lookup table are stored
@param [in] varianceTbl is a boolean that is True if variance tables are present in dir for loading. """
str(zValue) + '.tbl.gz')) str(zValue) + '.tbl.gz'))
""" Apply IGM extinction to already redshifted sed with redshift between zMin and zMax defined by range of lookup tables
@param [in] redshift is the redshift of the incoming SED object
@param [in] sedobj is the SED object to which IGM extinction will be applied. This object will be modified as a result of this. """
#First make sure redshift is in range of lookup tables.
#Now read in closest two lookup tables for given redshift flambda = self.meanLookups[str(lower)][:,1]) flambda = self.meanLookups[str(upper)][:,1])
#Redshift lookup tables to redshift of source, i.e. if source redshift is 1.78 shift lookup #table for 1.7 and lookup table for 1.8 to up and down to 1.78, respectively
#Resample lower and upper transmission data onto same wavelength grid.
#Now insert this into a transmission array of 1.0 beyond the limits of current application #So that we can get an sed back that extends to the longest wavelengths of the incoming sed
#Weighted Average of Transmission from each lookup table to get final transmission #table at desired redshift upperSed.flambda*(1.0 - ((upper - redshift)/dzGrid)))
#Resample incoming sed to new grid so that we don't get warnings from multiplySED #about matching wavelength grids
#Now multiply transmission curve by input SED to get final result and make it the new flambda #data in the original sed which also is now on a new grid starting at 300 nm |