Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model.py _loadInterpolatedModel cannot interpolate models with different resolutions #144

Open
chihchunhsu opened this issue Oct 15, 2018 · 0 comments

Comments

@chihchunhsu
Copy link

The resolutions for the BT-Settl 2008 models are different, and the _loadInterpolatedModel function cannot interpolate if the resolutions are different.

In [29]: sp = spmd.getModel(instrument='NIRSPEC-O65-RAW',teff=2600,logg=5.5,z=0.0)
In [30]: len(sp.wave)
Out[30]: 5422

In [31]: sp = spmd.getModel(instrument='NIRSPEC-O65-RAW',teff=2700,logg=5.5,z=0.0)

In [32]: len(sp.wave)
Out[32]: 2711

In [33]: sp = spmd.getModel(instrument='NIRSPEC-O65-RAW',teff=2650,logg=5.5,z=0.0)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-33-0242638771bf> in <module>()
----> 1 sp = spmd.getModel(instrument='NIRSPEC-O65-RAW',teff=2650,logg=5.5,z=0.0)

~/projects/splat/splat/model.py in getModel(*args, **kwargs)
   2110 
   2111     '''
-> 2112     return loadModel(*args, **kwargs)
   2113 
   2114 

~/projects/splat/splat/model.py in loadModel(modelset, instrument, raw, sed, *args, **kwargs)
   2059         if file=='':
   2060             if kwargs['force']: raise NameError('\nCould not find '+kwargs['filename']+' locally\n\n')
-> 2061             else: sp = _loadInterpolatedModel(**kwargs)
   2062         else: kwargs['filename'] = kwargs['filename']+'.gz'
   2063 #                kwargs['local']=False

~/projects/splat/splat/model.py in _loadInterpolatedModel(*args, **kwargs)
   2274 # create interpolation
   2275         mflx = []
-> 2276         for i,w in enumerate(models[0].wave):
   2277             print("1",len(models[0].wave),len(models[0].flux),len(models[1].wave),len(models[1].flux))
   2278             print("2",len(models[2].wave),len(models[2].flux),len(models[3].wave),len(models[3].flux))

~/projects/splat/splat/model.py in <listcomp>(.0)
   2274 # create interpolation
   2275         mflx = []
-> 2276         for i,w in enumerate(models[0].wave):
   2277             print("1",len(models[0].wave),len(models[0].flux),len(models[1].wave),len(models[1].flux))
   2278             print("2",len(models[2].wave),len(models[2].flux),len(models[3].wave),len(models[3].flux))

IndexError: index 2711 is out of bounds for axis 0 with size 2711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant