GOALS-survey / CAFE

Spectral decomposition that works for astronomical data
Other
10 stars 5 forks source link

I encountered an error while running tutorial notebook #71

Closed unknowner-m closed 5 months ago

unknowner-m commented 6 months ago

When I followed the tutorial notebook, I encountered an error in fitting

# Read in the spec
s.read_spec(source_fn, file_dir=source_fd, z=z)

# Preview the spectrum and overlay the initial params
s.plot_spec_ini(inppar_fn, optpar_fn)

This gets the KeyError

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[9], line 5
      2 s.read_spec(source_fn, file_dir=source_fd, z=z)
      4 # Preview the spectrum and overlay the initial params
----> 5 s.plot_spec_ini(inppar_fn, optpar_fn)

File D:\Anaconda\envs\cafe\Lib\site-packages\CAFE\cafe.py:751, in specmod.plot_spec_ini(self, inparfile, optfile, init_parcube, cont_profs, force_all_lines)
    748 spec = Spectrum1D(spectral_axis=wave*u.micron, flux=flux*u.Jy, uncertainty=StdDevUncertainty(flux_unc), redshift=self.z)
    749 spec_dict = {'wave':wave, 'flux':flux, 'flux_unc':flux_unc}
--> 751 self.fitphot = self.inopts['MODEL OPTIONS']['FITPHOT']
    752 if self.fitphot is True:
    753     if hasattr(self, 'pwaves') is False: raise AttributeError('You are trying to fit photometry but the data have not been loaded. Use cafe.read_phot() to do so.')

KeyError: 'MODEL OPTIONS
unknowner-m commented 5 months ago

I found a problem, that is, I should run in UNIX environment. Now the notebook works well