PythonicDISORT 0.6.1__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PythonicDISORT-0.6.1/src/PythonicDISORT.egg-info → PythonicDISORT-0.6.2}/PKG-INFO +1 -1
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/pyproject.toml +1 -1
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/_assemble_solution_functions.py +6 -6
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/_diagonalize.py +19 -19
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/_solve_for_coefs.py +3 -3
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/pydisort.py +12 -12
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2/src/PythonicDISORT.egg-info}/PKG-INFO +1 -1
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/LICENSE.md +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/README.md +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/setup.cfg +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/__init__.py +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/subroutines.py +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT.egg-info/SOURCES.txt +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT.egg-info/dependency_links.txt +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT.egg-info/requires.txt +0 -0
- {PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PythonicDISORT
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Discrete Ordinates Solver for the (1D) Radiative Transfer Equation in a single or multi-layer atmosphere.
|
|
5
5
|
Author-email: Dion HO Jia Xu <dh3065@columbia.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/LDEO-CREW/Pythonic-DISORT
|
{PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT/_assemble_solution_functions.py
RENAMED
|
@@ -11,7 +11,7 @@ def _assemble_solution_functions(
|
|
|
11
11
|
scaled_tau_arr_with_0,
|
|
12
12
|
mu_arr_pos, mu_arr,
|
|
13
13
|
M_inv, W,
|
|
14
|
-
N, NQuad, NLeg,
|
|
14
|
+
N, NQuad, NLeg, NFourier,
|
|
15
15
|
NLayers, NBDRF,
|
|
16
16
|
atmos_is_multilayered,
|
|
17
17
|
weighted_scaled_Leg_coeffs,
|
|
@@ -46,7 +46,7 @@ def _assemble_solution_functions(
|
|
|
46
46
|
# Compute all the necessary quantities
|
|
47
47
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
48
48
|
outputs = _diagonalize(
|
|
49
|
-
|
|
49
|
+
NFourier,
|
|
50
50
|
scaled_omega_arr,
|
|
51
51
|
mu_arr_pos, mu_arr,
|
|
52
52
|
M_inv, W,
|
|
@@ -74,7 +74,7 @@ def _assemble_solution_functions(
|
|
|
74
74
|
B_collect = None
|
|
75
75
|
|
|
76
76
|
GC_collect = _solve_for_coefs(
|
|
77
|
-
|
|
77
|
+
NFourier,
|
|
78
78
|
G_collect,
|
|
79
79
|
K_collect,
|
|
80
80
|
B_collect,
|
|
@@ -154,14 +154,14 @@ def _assemble_solution_functions(
|
|
|
154
154
|
)
|
|
155
155
|
|
|
156
156
|
if _is_compatible_with_autograd:
|
|
157
|
-
um = um + np.concatenate((_mathscr_v_contribution.T, np.zeros((
|
|
157
|
+
um = um + np.concatenate((_mathscr_v_contribution.T, np.zeros((NFourier - 1, len(tau), NQuad))))
|
|
158
158
|
else:
|
|
159
159
|
um[0, :, :] += _mathscr_v_contribution.T
|
|
160
160
|
|
|
161
161
|
intensities = np.einsum(
|
|
162
162
|
"mti, mp -> itp",
|
|
163
163
|
um,
|
|
164
|
-
np.cos(np.arange(
|
|
164
|
+
np.cos(np.arange(NFourier)[:, None] * (phi0 - phi)[None, :]),
|
|
165
165
|
optimize=True,
|
|
166
166
|
)
|
|
167
167
|
|
|
@@ -183,7 +183,7 @@ def _assemble_solution_functions(
|
|
|
183
183
|
)
|
|
184
184
|
intensities_abs = np.abs(intensities)
|
|
185
185
|
Fourier_error = np.max(
|
|
186
|
-
np.abs(ulast[:, :, None] * np.cos((
|
|
186
|
+
np.abs(ulast[:, :, None] * np.cos((NFourier - 1) * (phi0 - phi))[None, None, :]),
|
|
187
187
|
intensities_abs,
|
|
188
188
|
out=np.zeros_like(intensities_abs),
|
|
189
189
|
where=intensities_abs > 1e-8,
|
|
@@ -4,7 +4,7 @@ from math import pi
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def _diagonalize(
|
|
7
|
-
|
|
7
|
+
NFourier,
|
|
8
8
|
scaled_omega_arr,
|
|
9
9
|
mu_arr_pos, mu_arr,
|
|
10
10
|
M_inv, W,
|
|
@@ -29,24 +29,24 @@ def _diagonalize(
|
|
|
29
29
|
ells_all = np.arange(NLeg)
|
|
30
30
|
ind = 0
|
|
31
31
|
|
|
32
|
-
G_collect = np.empty((
|
|
33
|
-
K_collect = np.empty((
|
|
34
|
-
alpha_arr = np.empty((
|
|
35
|
-
beta_arr = np.empty((
|
|
36
|
-
X_tilde_arr = np.empty((
|
|
32
|
+
G_collect = np.empty((NFourier * NLayers, NQuad, NQuad))
|
|
33
|
+
K_collect = np.empty((NFourier * NLayers, NQuad))
|
|
34
|
+
alpha_arr = np.empty((NFourier * NLayers, N, N))
|
|
35
|
+
beta_arr = np.empty((NFourier * NLayers, N, N))
|
|
36
|
+
X_tilde_arr = np.empty((NFourier * NLayers, NQuad))
|
|
37
37
|
no_shortcut_indices = []
|
|
38
38
|
no_shortcut_indices_0 = []
|
|
39
39
|
|
|
40
40
|
if there_is_beam_source:
|
|
41
|
-
B_collect = np.zeros((
|
|
41
|
+
B_collect = np.zeros((NFourier * NLayers, NQuad))
|
|
42
42
|
if there_is_iso_source:
|
|
43
43
|
G_inv_collect_0 = np.empty((NLayers, NQuad, NQuad))
|
|
44
44
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
45
45
|
|
|
46
|
-
# Loop over
|
|
46
|
+
# Loop over NFourier Fourier modes
|
|
47
47
|
# These can easily be parallelized, but the speed-up is unlikely to be worth the overhead
|
|
48
48
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
49
|
-
for m in range(
|
|
49
|
+
for m in range(NFourier):
|
|
50
50
|
# Setup
|
|
51
51
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
52
52
|
m_equals_0 = (m == 0)
|
|
@@ -169,26 +169,26 @@ def _diagonalize(
|
|
|
169
169
|
if there_is_beam_source:
|
|
170
170
|
if there_is_iso_source:
|
|
171
171
|
return (
|
|
172
|
-
G_collect.reshape((
|
|
173
|
-
K_collect.reshape((
|
|
174
|
-
B_collect.reshape((
|
|
172
|
+
G_collect.reshape((NFourier, NLayers, NQuad, NQuad)),
|
|
173
|
+
K_collect.reshape((NFourier, NLayers, NQuad)),
|
|
174
|
+
B_collect.reshape((NFourier, NLayers, NQuad)),
|
|
175
175
|
G_inv_collect_0,
|
|
176
176
|
)
|
|
177
177
|
else:
|
|
178
178
|
return (
|
|
179
|
-
G_collect.reshape((
|
|
180
|
-
K_collect.reshape((
|
|
181
|
-
B_collect.reshape((
|
|
179
|
+
G_collect.reshape((NFourier, NLayers, NQuad, NQuad)),
|
|
180
|
+
K_collect.reshape((NFourier, NLayers, NQuad)),
|
|
181
|
+
B_collect.reshape((NFourier, NLayers, NQuad)),
|
|
182
182
|
)
|
|
183
183
|
else:
|
|
184
184
|
if there_is_iso_source:
|
|
185
185
|
return (
|
|
186
|
-
G_collect.reshape((
|
|
187
|
-
K_collect.reshape((
|
|
186
|
+
G_collect.reshape((NFourier, NLayers, NQuad, NQuad)),
|
|
187
|
+
K_collect.reshape((NFourier, NLayers, NQuad)),
|
|
188
188
|
G_inv_collect_0,
|
|
189
189
|
)
|
|
190
190
|
else:
|
|
191
191
|
return (
|
|
192
|
-
G_collect.reshape((
|
|
193
|
-
K_collect.reshape((
|
|
192
|
+
G_collect.reshape((NFourier, NLayers, NQuad, NQuad)),
|
|
193
|
+
K_collect.reshape((NFourier, NLayers, NQuad)),
|
|
194
194
|
)
|
|
@@ -7,7 +7,7 @@ from math import pi
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def _solve_for_coefs(
|
|
10
|
-
|
|
10
|
+
NFourier,
|
|
11
11
|
G_collect,
|
|
12
12
|
K_collect,
|
|
13
13
|
B_collect,
|
|
@@ -36,11 +36,11 @@ def _solve_for_coefs(
|
|
|
36
36
|
"""
|
|
37
37
|
################################## Solve for coefficients of homogeneous solution ##########################################
|
|
38
38
|
|
|
39
|
-
GC_collect = np.empty((
|
|
39
|
+
GC_collect = np.empty((NFourier, NLayers, NQuad, NQuad))
|
|
40
40
|
use_sparse_framework = NLayers >= use_sparse_NLayers
|
|
41
41
|
|
|
42
42
|
# The following loops can easily be parallelized, but the speed-up is unlikely to be worth the overhead
|
|
43
|
-
for m in range(
|
|
43
|
+
for m in range(NFourier):
|
|
44
44
|
m_equals_0 = (m == 0)
|
|
45
45
|
BDRF_bool = m < NBDRF
|
|
46
46
|
|
|
@@ -14,7 +14,7 @@ def pydisort(
|
|
|
14
14
|
Leg_coeffs_all,
|
|
15
15
|
mu0, I0, phi0,
|
|
16
16
|
NLeg=None,
|
|
17
|
-
|
|
17
|
+
NFourier=None,
|
|
18
18
|
b_pos=0,
|
|
19
19
|
b_neg=0,
|
|
20
20
|
only_flux=False,
|
|
@@ -54,7 +54,7 @@ def pydisort(
|
|
|
54
54
|
Azimuthal angle of the incident beam.
|
|
55
55
|
NLeg : optional, int
|
|
56
56
|
Number of phase function Legendre coefficients.
|
|
57
|
-
|
|
57
|
+
NFourier : optional, int
|
|
58
58
|
Number of Fourier modes to use in the intensity function.
|
|
59
59
|
b_pos : optional, 2darray or float
|
|
60
60
|
Dirichlet boundary condition for the upward direction.
|
|
@@ -116,8 +116,8 @@ def pydisort(
|
|
|
116
116
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
117
117
|
if NLeg is None:
|
|
118
118
|
NLeg = NQuad
|
|
119
|
-
if
|
|
120
|
-
|
|
119
|
+
if NFourier is None:
|
|
120
|
+
NFourier = NQuad
|
|
121
121
|
if np.all(b_pos == 0):
|
|
122
122
|
b_pos = 0
|
|
123
123
|
if np.all(b_neg == 0):
|
|
@@ -159,11 +159,11 @@ def pydisort(
|
|
|
159
159
|
assert len(f_arr) == NLayers
|
|
160
160
|
if there_is_iso_source:
|
|
161
161
|
assert np.shape(s_poly_coeffs)[0] == NLayers
|
|
162
|
-
# Conditions on the number of quadrature angles (NQuad), Legendre coefficients (NLeg) and loops (
|
|
162
|
+
# Conditions on the number of quadrature angles (NQuad), Legendre coefficients (NLeg) and loops (NFourier)
|
|
163
163
|
assert NQuad >= 2
|
|
164
164
|
assert NQuad % 2 == 0
|
|
165
|
-
assert
|
|
166
|
-
assert
|
|
165
|
+
assert NFourier > 0
|
|
166
|
+
assert NFourier <= NLeg
|
|
167
167
|
# Not strictly necessary but there will be tremendous inaccuracies if this is violated
|
|
168
168
|
assert NLeg <= NQuad
|
|
169
169
|
# We require principal angles and a downward incident beam
|
|
@@ -175,11 +175,11 @@ def pydisort(
|
|
|
175
175
|
if len(np.atleast_1d(b_pos)) == 1:
|
|
176
176
|
b_pos_is_scalar = True
|
|
177
177
|
else:
|
|
178
|
-
assert np.shape(b_pos) == (N,
|
|
178
|
+
assert np.shape(b_pos) == (N, NFourier)
|
|
179
179
|
if len(np.atleast_1d(b_neg)) == 1:
|
|
180
180
|
b_neg_is_scalar = True
|
|
181
181
|
else:
|
|
182
|
-
assert np.shape(b_neg) == (N,
|
|
182
|
+
assert np.shape(b_neg) == (N, NFourier)
|
|
183
183
|
# The fractional scattering must be between 0 and 1
|
|
184
184
|
assert np.all(0 <= f_arr) and np.all(f_arr <= 1)
|
|
185
185
|
# The minimum threshold is the minimum numbers of layers: 1
|
|
@@ -240,7 +240,7 @@ def pydisort(
|
|
|
240
240
|
scaled_tau_arr_with_0,
|
|
241
241
|
mu_arr_pos, mu_arr,
|
|
242
242
|
M_inv, W,
|
|
243
|
-
N, NQuad, NLeg,
|
|
243
|
+
N, NQuad, NLeg, NFourier,
|
|
244
244
|
NLayers, NBDRF,
|
|
245
245
|
atmos_is_multilayered,
|
|
246
246
|
weighted_scaled_Leg_coeffs,
|
|
@@ -487,14 +487,14 @@ def pydisort(
|
|
|
487
487
|
|
|
488
488
|
else:
|
|
489
489
|
if only_flux:
|
|
490
|
-
|
|
490
|
+
NFourier = 1 # We only need to solve for the 0th Fourier mode to compute the flux
|
|
491
491
|
return (mu_arr,) + _assemble_solution_functions(
|
|
492
492
|
scaled_omega_arr,
|
|
493
493
|
tau_arr,
|
|
494
494
|
scaled_tau_arr_with_0,
|
|
495
495
|
mu_arr_pos, mu_arr,
|
|
496
496
|
M_inv, W,
|
|
497
|
-
N, NQuad, NLeg,
|
|
497
|
+
N, NQuad, NLeg, NFourier,
|
|
498
498
|
NLayers, NBDRF,
|
|
499
499
|
atmos_is_multilayered,
|
|
500
500
|
weighted_scaled_Leg_coeffs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PythonicDISORT
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Discrete Ordinates Solver for the (1D) Radiative Transfer Equation in a single or multi-layer atmosphere.
|
|
5
5
|
Author-email: Dion HO Jia Xu <dh3065@columbia.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/LDEO-CREW/Pythonic-DISORT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{PythonicDISORT-0.6.1 → PythonicDISORT-0.6.2}/src/PythonicDISORT.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|