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

Unable to convolve GAIA DR2 bandpasses with ck04 models #70

Open astrophyzie opened 4 years ago

astrophyzie commented 4 years ago

I am attempting to create ck04 stellar model fluxes with the GAIA passbands. I downloaded the Revised GAIA bandpasses from https://www.cosmos.esa.int/web/gaia/iow_20180316. Using the online guide, I did the following:

`wlg,g,gbp,grp=np.loadtxt('GaiaDR2_RevisedPassbands.dat',unpack=True,usecols=(0,1,3,5)) f=Filter() f.name="GAIA_G" f.central_wavelength=0.6419u.micron f.nu=(2.99792458e8/(wlg1e-9))*u.Hz f.response=g

convolve_model_dir(model_dir, [f])`

I have given the model_dir where the ck04 models reside along with the models.conf file. The result in the fits file that is written shows 0 flux for every wavelength. I noticed that in filter.py class, the condition on line 129 is never met:

if nu2 != nu1:

Hope you can help me solve this issue.

Thanks!

stormnick commented 2 years ago

I know the issue has been opened more than a year ago, but answering in case someone else comes here in the future.

I had a very similar issue and what seemed to be the case is that in the OP's implementation, the f.nu is sorted descending. Since the Gaia passbands is given in terms of ascending wavelength, converting to frequency would reverse the order. That seemed to screw things up.

So I simply reversed the wavelength/frequency list together with the response list (so feeding the data in ascending frequency order). I also removed the entries with response of 99 from the original Gaia passbands response textfile. That seemed to do the trick and I got my fits to work.

cezeva commented 4 months ago

Just in case, it happened to me too and I tried to convolved with another model, it seems like the model I was using was "corrupted"