Skip to content

Commit 8d267c8

Browse files
committed
v1.0.1 ready. The restriction on the phase function Legendre coefficients Leg_coeffs_all is corrected from [0, 1] to [-1, 1].
1 parent 53ae6b8 commit 8d267c8

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/Pythonic-DISORT.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@
587587
"source": [
588588
"* **Unweighted phase function Legendre coefficients** $g_\\ell$ **(PMOM)**\n",
589589
"\n",
590-
"We require at least $\\text{NLeg}$ coefficients each between $0$ and $1$ inclusive. For a multi-layer atmosphere, `Leg_coeffs_all` must be a matrix which $l$th row index corresponds to the atmospheric layer indexed by $l$."
590+
"We require at least $\\text{NLeg}$ coefficients each between $-1$ and $1$ inclusive. For a multi-layer atmosphere, `Leg_coeffs_all` must be a matrix which $l$th row index corresponds to the atmospheric layer indexed by $l$."
591591
]
592592
},
593593
{

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
project = 'Pythonic DISORT'
1010
copyright = '2023, HO Jia Xu Dion'
1111
author = 'Dion HO Jia Xu'
12-
release = '1.0.0'
12+
release = '1.0.1'
1313

1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies = [
88
"scipy>=1.8.0",
99
]
1010
name = "PythonicDISORT"
11-
version = "1.0.0"
11+
version = "1.0.1"
1212
authors = [
1313
{ name="Dion HO Jia Xu", email="dh3065@columbia.edu" },
1414
]

src/PythonicDISORT/_assemble_intensity_and_fluxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,6 @@ def flux_down(tau, is_antiderivative_wrt_tau=False, return_tau_arr=False):
592592
# --------------------------------------------------------------------------------------------------------------------------
593593

594594
if only_flux:
595-
return flux_up, flux_down, u0#, GC_collect_0, K_collect_0
595+
return flux_up, flux_down, u0#, GC_collect_0, K_collect_0, B_collect_0
596596
else:
597597
return flux_up, flux_down, u0, u

src/PythonicDISORT/_solve_for_coeffs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _solve_for_coeffs(
8787
# The following loops can easily be parallelized, but the speed-up is unlikely to be worth the overhead
8888
for m in range(NFourier):
8989
m_equals_0 = (m == 0)
90-
BDRF_bool = (NBDRF > m)
90+
there_is_BDRF_mode = (NBDRF > m)
9191

9292
G_collect_m = G_collect[m, :, :, :]
9393
K_collect_m = K_collect[m, :, :]
@@ -97,7 +97,7 @@ def _solve_for_coeffs(
9797
# Generate mathscr_D and mathscr_X (BDRF terms)
9898
# Just for this part, refer to section 3.4.2 of the Comprehensive Documentation
9999
# --------------------------------------------------------------------------------------------------------------------------
100-
if BDRF_bool:
100+
if there_is_BDRF_mode:
101101
mathscr_D_neg = (1 + m_equals_0 * 1) * BDRF_Fourier_modes[m](mu_arr_pos, mu_arr_pos)
102102
R = mathscr_D_neg * mu_arr_pos_times_W[None, :]
103103

@@ -212,7 +212,7 @@ def _solve_for_coeffs(
212212
* np.exp(-scaled_tau_arr_with_0 / mu0)[l_range, None]
213213
).ravel()
214214

215-
if BDRF_bool:
215+
if there_is_BDRF_mode:
216216
RHS = (
217217
np.concatenate(
218218
[
@@ -260,7 +260,7 @@ def _solve_for_coeffs(
260260
G_0_np
261261
* np.exp(K_collect_m[0, :N] * scaled_tau_arr_with_0[1])[None, :]
262262
)
263-
if BDRF_bool:
263+
if there_is_BDRF_mode:
264264
LHS[-N:, -NQuad : -N] = (G_L_pn - R @ G_L_nn) * E_Lm1L[None, :]
265265
LHS[-N:, -N:] = G_L_pp - R @ G_L_np
266266
else:

src/PythonicDISORT/pydisort.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ def pydisort(
232232
raise ValueError("The number of phase function Legendre coefficients must be positive.")
233233
if not np.all(omega_arr * Leg_coeffs_all[:, 0] == omega_arr):
234234
raise ValueError("The first phase function Legendre coefficient must equal 1.")
235-
if not (np.all(0 <= Leg_coeffs_all) and np.all(Leg_coeffs_all <= 1)):
236-
raise ValueError("The phase function Legendre coefficients must all be between 0 and 1.")
235+
if not (np.all(-1 <= Leg_coeffs_all) and np.all(Leg_coeffs_all <= 1)):
236+
raise ValueError("The phase function Legendre coefficients must all be between -1 and 1.")
237237
if not NLeg <= NLeg_all:
238238
raise ValueError("`NLeg` cannot be larger than the number of phase function Legendre coefficients provided.")
239239
# Ensure that the first dimension of the following inputs corresponds to the number of layers
@@ -263,9 +263,9 @@ def pydisort(
263263
if I0 < 0:
264264
raise ValueError("The incident beam must have positive intensity.")
265265
if there_is_beam_source:
266-
if not 0 < mu0 and mu0 <= 1:
266+
if not (0 < mu0 and mu0 <= 1):
267267
raise ValueError("The cosine of the polar angle of the incident beam must be between 0 and 1, excluding 0.")
268-
if not 0 <= phi0 and phi0 < 2 * pi:
268+
if not (0 <= phi0 and phi0 < 2 * pi):
269269
raise ValueError("Provide the principal azimuthal angle for the incident beam (must be between 0 and 2pi, excluding 2pi).")
270270
# Ensure that the BC inputs are of the correct shape
271271
if len(np.atleast_1d(b_pos)) == 1:

0 commit comments

Comments
 (0)