astrofrog / sedfitter

Python version of the SED fitter from Robitaille et al., 2007, ApJS 169 328
http://sedfitter.readthedocs.org
BSD 2-Clause "Simplified" License
20 stars 22 forks source link

SED plots have some problems #77

Closed ShanghuoLi closed 2 years ago

ShanghuoLi commented 2 years ago

I run the example to test the SED fitting. Everything work, except for SED plot.

I would appreciate it very much if someone could tell me how to fix this problem. Thanks!

select_format = ('F', 3) plot('output.fitinfo', output_dir='plots_seds', plot_max=100, select_format=select_format)


TypeError Traceback (most recent call last)

in 1 # Make SED plots ----> 2 plot('output.fitinfo', output_dir='plots_seds', plot_max=100, select_format=select_format) ~/opt/anaconda3/lib/python3.8/site-packages/sedfitter/plot.py in plot(input_fits, output_dir, select_format, plot_max, plot_mode, sed_type, show_sed, show_convolved, x_mode, y_mode, x_range, y_range, plot_name, plot_info, format, sources, memmap, dpi) 300 301 s = s.scale_to_distance(10. ** info.sc[i] * KPC) --> 302 s = s.scale_to_av(info.av[i], info.meta.extinction_law.get_av) 303 304 if sed_type == 'interp': ~/opt/anaconda3/lib/python3.8/site-packages/sedfitter/sed/sed.py in scale_to_av(self, av, law) 84 def scale_to_av(self, av, law): 85 sed = self.copy() ---> 86 sed.flux = sed.flux * 10. ** (av * law(sed.wav)) 87 sed.error = sed.error * 10. ** (av * law(sed.wav)) 88 return sed ~/opt/anaconda3/lib/python3.8/site-packages/sedfitter/extinction/extinction.py in get_av(self, wav) 84 """ 85 if isinstance(wav, u.Quantity) and wav.unit.is_equivalent(u.m): ---> 86 return (-0.4 * np.interp(wav.to(self.wav.unit), self.wav, self.chi, left=0., right=0.) 87 / np.interp(([0.55] * u.micron).to(self.wav.unit), self.wav, self.chi)) 88 else: <__array_function__ internals> in interp(*args, **kwargs) TypeError: no implementation found for 'numpy.interp' on types that implement __array_function__: [] ---------------------------------------------------------------------------