phoebe-project / phoebe2

PHOEBE - Eclipsing Binary Star Modeling Software
http://phoebe-project.org
GNU General Public License v3.0
76 stars 28 forks source link

Currently hosted passband files have broken extinction tables #911

Open Raindogjones opened 1 week ago

Raindogjones commented 1 week ago

The passband files currently hosted on the passband server are either missing extinction tables or have extinction tables with incorrect values.

aprsa commented 1 week ago

I verified blackbody extinction tables thus far and everything seems to check out in the feature-blending branch. For example, this snippet works as expected:

>>> import phoebe
>>> pb = phoebe.get_passband("Johnson:V")
>>> query_pts = np.ascontiguousarray([[10000, 3.1, 1.0]])
>>> pb.interpolate_extinct(query_pts, atm='blackbody')
array([[0.05699106]])

Note that the order of axes was flipped in the bug report: blackbody table axes are (teffs, rvs, ebvs).

Raindogjones commented 1 week ago

pb.interpolate_extinct(Teff=10000.0,atm='blackbody',extinct=1.0,Rv=3.1) Still fails in 2.4.14, giving the error:

Passband.interpolate_extinct(self, Teff, logg, abun, atm, extinct, Rv, photon_weighted)
   1953 nanmask = np.isnan(extinct_factor)
   1954 if np.any(nanmask):
-> 1955     raise ValueError('Atmosphere parameters out of bounds: atm=%s, extinct=%f, Rv=%f, Teff=%s, logg=%s, abun=%s' % (atm, extinct, Rv, Teff[nanmask], logg[nanmask], abun[nanmask]))
   1957 return extinct_factor

TypeError: 'float' object is not subscriptable
Raindogjones commented 1 week ago

Seems to me that the order has flipped between 2.4.14 and feature-blending, as in 2.4.14 (and earlier) the query to the BB extinction table is: req = np.array(((Teff, extinct, Rv),))

aprsa commented 6 days ago

Perhaps we should deprecate re-implementing extinction and use an astropy-affiliated canned version?

Raindogjones commented 6 days ago

@aprsa That is definitely an option, but in the mean time the implementation in libphoebe should be fine. For blackbodies at least, it should just be a matter of flipping the way the tables are stored/queried in feature-blending to return to being backwards compatible. For the other atmospheres, I'm not sure...

Raindogjones commented 6 days ago

And, in any case, the re-implementation in passbands.py will be pretty similar whether we use libphoebe or something from astropy - so that needs to be fixed either way.