Skip to content

Commit

Permalink
Fixes a typo that caused specific intensities to return None
Browse files Browse the repository at this point in the history
  • Loading branch information
aprsa committed Oct 4, 2024
1 parent 5d0c182 commit 4175bc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions phoebe/atmospheres/passbands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,10 +1685,12 @@ def Imu(self, query_pts, atm='ck2004', ldatm='ck2004', ldint=None, ld_func='inte
raise ValueError(f'ldatm={ldatm} is not supported.')

if ld_func == 'interp':
if 'atm' == 'blackbody' and 'blackbody:Inorm' in self.content and ldatm in ['ck2004', 'phoenix', 'tmap_sdO', 'tmap_DA', 'tmap_DAO', 'tmap_DO']:
if atm == 'blackbody' and 'blackbody:Inorm' in self.content and ldatm in ['ck2004', 'phoenix', 'tmap_sdO', 'tmap_DA', 'tmap_DAO', 'tmap_DO']:
# we need to apply ldatm's limb darkening to blackbody intensities:
# Imu^bb = Lmu Inorm^bb = Imu^atm / Inorm^atm * Inorm^bb

# print(f'{atm=} {ld_func=} {ldatm=} {intens_weighting=} {query_pts=} {atm_extrapolation_method=}')

ndpolants = self.ndp[ldatm].ndpolate(f'imu@{intens_weighting}', query_pts, extrapolation_method=atm_extrapolation_method)
log10imus_atm = ndpolants['interps']
dists = ndpolants.get('dists', np.zeros_like(log10imus_atm))
Expand Down Expand Up @@ -1752,7 +1754,7 @@ def Imu(self, query_pts, atm='ck2004', ldatm='ck2004', ldint=None, ld_func='inte
atm_extrapolation_method=atm_extrapolation_method,
ld_extrapolation_method=ld_extrapolation_method
)
log10imus_bb = np.log10(ints_bb['inorms'])
log10imus_bb = np.log10(ints_bb)

log10imus_blended = log10imus_atm.copy()
log10imus_blended[off_grid] = (np.minimum(dists[off_grid], blending_margin) * log10imus_bb + np.maximum(blending_margin-dists[off_grid], 0) * log10imus_atm[off_grid])/blending_margin
Expand Down

0 comments on commit 4175bc5

Please sign in to comment.