Skip to content

Commit

Permalink
Passband limb-darkening coefficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavbroz committed Nov 1, 2024
1 parent 9edb1d8 commit 33f5bcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions phoebe/backend/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,13 +1185,16 @@ def _run_single_time(self, b, i, time, infolist, **kwargs):
if kind in ['vis', 'clo', 't3'] and dataset != previous:
if_method = b.get_value(qualifier='if_method', dataset=dataset, context='dataset')
if_method = kwargs.get('if_method', if_method)

if if_method == 'integrate':
interferometry.complexvis = interferometry.complexvis_integrate
elif if_method == 'simple':
interferometry.complexvis = interferometry.complexvis_simple
else:
raise NotImplementedError("if_method='{}' not supported".format(if_method))

info['dataset'] = dataset

# save baselines and wavelengths (for interferometry)
if kind == 'vis' and dataset != previous:
ucoord = b.get_value(qualifier='u', dataset=dataset, context='dataset')
Expand Down
12 changes: 7 additions & 5 deletions phoebe/backend/interferometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def complexvis_simple(b, system, ucoord=None, vcoord=None, wavelengths=None, inf
"""

# print("complexvis_sim")
# print("complexvis_simple")
# print("b = ", b)
# print("b['distance@system'] = ", b['distance@system'])
# print("b['hierarchy@system'] = ", b['hierarchy@system'])
Expand Down Expand Up @@ -124,12 +124,13 @@ def complexvis_simple(b, system, ucoord=None, vcoord=None, wavelengths=None, inf
y = system.yi[i]/d # rad
arg = np.pi*phi*B/lambda_ # rad

# Note: limb-darkening should be passband (monochromatic)!
coeff = body.ld_coeffs['bol'][0]
# Note: limb-darkening is passband, not per-wavelength!
coeff = body.ld_coeffs[info['dataset']][0]
alpha = 1.0-coeff
beta = coeff

Lum_lambda = np.pi*(body.requiv*units.solRad.to('m'))**2 * planck(lambda_, T=body.teff)
I_lambda = planck(lambda_, T=body.teff)
Lum_lambda = np.pi*(body.requiv*units.solRad.to('m'))**2 * I_lambda

mu = Lum_lambda * 1.0/(alpha/2.0 + beta/3.0)
mu *= (alpha*j1(arg)/arg + beta*np.sqrt(np.pi/2.0)*j32(arg)/arg**(3.0/2.0))
Expand Down Expand Up @@ -167,7 +168,7 @@ def complexvis_integrate(b, system, ucoord=None, vcoord=None, wavelengths=None,
if np.all(visibilities==0):
return {'complexvis': np.nan}

# Note: intensity should be per-wavelength!
# Note: intensities are passband, not per-wavelength!
abs_intensities = meshes.get_column_flat('abs_intensities:{}'.format(dataset), components)
mus = meshes.get_column_flat('mus', components)
areas = meshes.get_column_flat('areas_si', components)
Expand Down Expand Up @@ -243,3 +244,4 @@ def clo(b, system, ucoord1=None, vcoord1=None, ucoord2=None, vcoord2=None, wavel
complexvis = complexvis_integrate
t3 = clo


0 comments on commit 33f5bcf

Please sign in to comment.