コード例 #1
0
print "Instrumental magnitudes include both grey-scale and color-dependent variations as bandpasses and SEDs change."
print "Calibrated natural magnitudes remove the grey-scale variation, and only show color-dependent/wavelength-dependent"
print " variations in measured magnitudes as the shape of the bandpass or the shape of the SED change. "
print "If the blue stars are used as calibration stars for the instrumental magnitudes (i.e. the zeropoint variation is"
print " removed with the blue stars, so the grey-scale variation is removed), the changes in instrumental magnitudes then"
print " show only the color-dependent changes in reported magnitudes. (this can be done here using matchBlue=True in calcDeltaMags)."
print "The reason that the natural magnitudes show a small change in magnitude even for blue objects is that these are being"
print " referenced against a flat Fnu spectrum, instead of the blue star spectrum. If matchBlue is turned on for changes in magnitudes"
print "  calculated using natural magnitudes (calcNatMags), the results are identical to the results for changes in instrumental"
print "  magnitudes calculated using matchBlue."


filterlist = ('u', 'g', 'r', 'i', 'z', 'y')

# Read the SED files.
seds, sedlists = pT.readPhotSeds(sedDir='../')

# And redshift the galaxies, quasar, and SN.
# These are just sample redshifts, not supposed to be 'typical'. 
redshifts = {}
redshifts['galaxies'] = numpy.array([0.5, 1.0], 'float')
redshifts['quasar'] = numpy.array([1.0, 1.5, 2.5], 'float')
redshifts['sn'] = numpy.array([0.3, 0.8, 1.2, 1.5], 'float')
redshifts['photoZ_outliers'] = numpy.array([0, 0.2, 2.0], 'float')
seds, sedlists = pT.makeRedshiftedSeds(seds, sedlists, redshifts)

# Okay, now let's look at two different bandpass comparisons. 
# We will compare the 'normal' base throughputs to a set of throughputs where the bandpasses are shifted by 1%.
# First read the basic components, except for the filters.
componentList_common = ['atmos.dat', 'detector.dat', 'lens1.dat', 'lens2.dat', 'lens3.dat',
                        'm1_ProtAl_Aged.dat', 'm2_ProtAl_Aged.dat', 'm3_ProtAl_Aged.dat']
コード例 #2
0
    # Plot the information from this SED. 
    if sedname != None:
        pylab.plot(sed.wavelen, sed.fnu, label='%s' %(str(sedname)))
    else:
        pylab.plot(sed.wavelen, sed.fnu)
    pylab.xlim(300, 1150)
    pylab.xlabel('Wavelength (nm)')
    pylab.ylabel(r'F$_\nu$')
    if sedname != None:
        pylab.title('%s' %(str(sedname)))
    if savefig:
        if sedname != None:
            pylab.savefig('%s.%s' %(str(sedname), figformat), format=figformat)
        else:
            pylab.savefig('fnu.%s' %(figformat), format=figformat)
    return
    

def plot_all_seds(sedDict):
    """Plot all seds in the sedDict."""
    for s in sedDict.keys():
        plot_sed(sedDict[s], sedname=s)
    return


if __name__ == "__main__":
    
    sedDict, sedlists = pT.readPhotSeds()
    plot_all_seds(sedDict)