Skip to content

Commit

Permalink
Merge pull request #90 from desihub/stdstar_filter
Browse files Browse the repository at this point in the history
stdstar filter SDSS_R or DECAM_R
  • Loading branch information
sbailey committed Nov 3, 2015
2 parents 9dfad1d + b52d00a commit 0b89c64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions py/desispec/fluxcalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,17 @@ def findappMag(flux,wave,filt):

for i,v in enumerate(filters):
#Normalizing using only SDSS_R band magnitude
if v=='SDSS_R':
if v.upper() == 'SDSS_R' or v.upper() =='DECAM_R' :
refmag=mags[i]
filter_response=read_filter_response(v,basepath) # outputs wavelength,qe
rebinned_model_flux=rebinSpectra(stdflux,stdwave,filter_response[0])
apMag=findappMag(rebinned_model_flux,filter_response[0],filter_response[1])
log.info('scaling SDSS_r mag {0:f} to {1:f}.'.format(apMag,refmag))
log.info('scaling {} mag {:f} to {:f}.'.format(v, apMag,refmag))
scalefac=10**((apMag-refmag)/2.5)
normflux=stdflux*scalefac

break #- found SDSS_R or DECAM_R; we can stop now

return stdwave,normflux


Expand Down

0 comments on commit 0b89c64

Please sign in to comment.