Skip to content

Commit

Permalink
Merge pull request #20 from eblur/fix_graphite
Browse files Browse the repository at this point in the history
Use astropy to deal with wavelength units
  • Loading branch information
eblur authored Mar 20, 2018
2 parents 3f9b1b7 + e210507 commit 279b53f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions newdust/graindist/composition/cmgraphite.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@ def __init__(self, rho=RHO_GRA, size='big', orient='perp'):

if orient == 'perp':
wavel = D03dat_perp['wave(um)'] * u.micron
lamvals = wavel.to(u.cm).value
revals = 1.0 + D03dat_perp['Re(n)-1']
imvals = D03dat_perp['Im(n)']

if orient == 'para':
wavel = D03dat_para['wave(um)'] * u.micron
lamvals = wavel.to(u.cm).value
revals = 1.0 + D03dat_para['Re(n)-1']
imvals = D03dat_para['Im(n)']

rp = interp1d(lamvals * c.micron2cm, revals) # wavelength (cm), rp
ip = interp1d(lamvals * c.micron2cm, imvals) # wavelength (cm), ip
rp = interp1d(wavel.to(u.cm).value, revals) # wavelength (cm), rp
ip = interp1d(wavel.to(u.cm).value, imvals) # wavelength (cm), ip
self.interps = (rp, ip)

def _interp_helper(self, lam_cm, interp, rp=False):
Expand Down

0 comments on commit 279b53f

Please sign in to comment.