Skip to content

Commit

Permalink
Implements fractional blending information for Inorm
Browse files Browse the repository at this point in the history
  • Loading branch information
aprsa committed Oct 8, 2024
1 parent 3f31f63 commit fa84de4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions phoebe/atmospheres/passbands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ def Inorm(self, query_pts, atm='ck2004', ldatm='ck2004', ldint=None, ld_func='in
# raise ValueError(f'blending_method={blending_method} is not supported.')

raise_on_nans = True if atm_extrapolation_method == 'none' else False
blending_factors = None

if atm == 'blackbody' and 'blackbody:Inorm' in self.content:
# check if the required tables for the chosen ldatm are available:
Expand Down Expand Up @@ -1556,14 +1557,16 @@ def Inorm(self, query_pts, atm='ck2004', ldatm='ck2004', ldint=None, ld_func='in

log10ints_blended = log10ints.copy()
log10ints_blended[off_grid] = (np.minimum(dists[off_grid], blending_margin) * log10ints_bb[off_grid] + np.maximum(blending_margin-dists[off_grid], 0) * log10ints[off_grid])/blending_margin
blending_factors = np.minimum(dists, blending_margin)/blending_margin

intensities = 10**log10ints_blended
else:
intensities = 10**log10ints

ints = {
'inorms': intensities
# TODO: add other dict keys!
'inorms': intensities,
'bfs': blending_factors,
# TODO: add any other dict keys?
}

return ints
Expand Down

0 comments on commit fa84de4

Please sign in to comment.