PythonicDISORT 0.9.5__tar.gz → 1.0.1__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.9.5/src/PythonicDISORT.egg-info → pythonicdisort-1.0.1}/PKG-INFO +20 -4
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/README.md +19 -3
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/pyproject.toml +1 -1
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/_assemble_intensity_and_fluxes.py +71 -68
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/_solve_for_coeffs.py +86 -81
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/_solve_for_gen_and_part_sols.py +17 -17
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/pydisort.py +105 -68
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/subroutines.py +322 -74
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1/src/PythonicDISORT.egg-info}/PKG-INFO +20 -4
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/LICENSE.md +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/setup.cfg +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/__init__.py +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT.egg-info/SOURCES.txt +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT.egg-info/dependency_links.txt +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT.egg-info/requires.txt +0 -0
- {pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/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.
|
|
3
|
+
Version: 1.0.1
|
|
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
|
|
@@ -19,6 +19,9 @@ Requires-Dist: autograd>=1.5; extra == "notebook-dependencies"
|
|
|
19
19
|
Requires-Dist: jupyter>1.0.0; extra == "notebook-dependencies"
|
|
20
20
|
Requires-Dist: notebook>6.5.2; extra == "notebook-dependencies"
|
|
21
21
|
|
|
22
|
+
[](https://github.com/LDEO-CREW/Pythonic-DISORT/actions/workflows/continuous_integration.yml)
|
|
23
|
+
[](https://doi.org/10.21105/joss.06442)
|
|
24
|
+
|
|
22
25
|
# Introduction
|
|
23
26
|
The PythonicDISORT package is a Discrete Ordinates Solver for the (1D) Radiative Transfer Equation
|
|
24
27
|
in a plane-parallel, horizontally homogeneous atmosphere.
|
|
@@ -27,7 +30,7 @@ While PythonicDISORT has been optimized for speed, it will naturally be slower t
|
|
|
27
30
|
On the other hand, PythonicDISORT should be easier to install, use, and modify than FORTRAN-based Discrete Ordinates Solvers.
|
|
28
31
|
|
|
29
32
|
PythonicDISORT is based on Stamnes' FORTRAN DISORT (see References, in particular [2, 3, 8]) and has its main features: multi-layer solver,
|
|
30
|
-
delta-
|
|
33
|
+
delta-_M_ scaling, Nakajima-Tanaka (NT) corrections, only flux option, direct beam source, isotropic internal source (blackbody emission),
|
|
31
34
|
Dirichlet boundary conditions (diffuse flux boundary sources), Bi-Directional Reflectance Function (BDRF) for surface reflection,
|
|
32
35
|
and interpolation with respect to polar angle.
|
|
33
36
|
In addition, we added a subroutine to compute actinic fluxes to satisfy a user request, and integration with respect to optical depth was also added.
|
|
@@ -37,6 +40,8 @@ You may contact me, Dion, through dh3065@columbia.edu.
|
|
|
37
40
|
|
|
38
41
|
The **GitHub repository** is https://github.com/LDEO-CREW/Pythonic-DISORT.
|
|
39
42
|
|
|
43
|
+
Accompanying Journal of Open Source Software paper: https://joss.theoj.org/papers/10.21105/joss.06442.
|
|
44
|
+
|
|
40
45
|
# Documentation
|
|
41
46
|
https://pythonic-disort.readthedocs.io/en/latest/
|
|
42
47
|
|
|
@@ -49,11 +54,22 @@ It is highly recommended that new users read the non-optional parts of sections
|
|
|
49
54
|
## PyTest and examples of how to use PythonicDISORT
|
|
50
55
|
|
|
51
56
|
Not only are there verification tests in `Pythonic-DISORT.ipynb`,
|
|
52
|
-
most of the test problems in Stamnes' `disotest.f90` (download DISORT 4.0.99 from http://www.rtatmocn.com/disort/) have also been recreated.
|
|
57
|
+
most of the test problems in Stamnes' `disotest.f90` (download DISORT 4.0.99 from http://www.rtatmocn.com/disort/) have also been recreated and enhanced.
|
|
53
58
|
In these tests, the solutions from PythonicDISORT are compared against solutions
|
|
54
59
|
from a F2PY-wrapped Stamnes' DISORT (version 4.0.99; wrapper inspired by https://github.com/kconnour/pyRT_DISORT). With PyTest installed, execute the console command `pytest`
|
|
55
60
|
in the `pydisotest` directory to run these tests. The `pydisotest` directory also contains Jupyter Notebooks to show the implementation of each test.
|
|
56
|
-
These notebooks double up as examples of how to use PythonicDISORT.
|
|
61
|
+
These notebooks double up as examples of how to use PythonicDISORT. The tests which have been implemented are:
|
|
62
|
+
|
|
63
|
+
* Test Problem 1: Isotropic Scattering
|
|
64
|
+
* Test Problem 2: Rayleigh Scattering, Beam Source
|
|
65
|
+
* Test Problem 3: Henyey-Greenstein Scattering
|
|
66
|
+
* Test Problem 4: Haze-L Scattering, Beam Source
|
|
67
|
+
* Test Problem 5: Cloud C.1 Scattering, Beam Source
|
|
68
|
+
* Test Problem 6: No Scattering, Increasingly Complex Sources (relevant for modeling longwave radiation)
|
|
69
|
+
* Test Problem 7: Absorption + Scattering + All Possible Sources, Lambertian and Hapke Surface Reflectivities (one layer)
|
|
70
|
+
* Test Problem 8: Absorbing / Isotropic-Scattering Medium With (two layers)
|
|
71
|
+
* Test Problem 9: General Emitting / Absorbing / Scattering Medium with (many different layers)
|
|
72
|
+
* Test Problem 11: Single-Layer vs. Multiple Layers (no corresponding Jupyter Notebook)
|
|
57
73
|
|
|
58
74
|
# Installation
|
|
59
75
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
[](https://github.com/LDEO-CREW/Pythonic-DISORT/actions/workflows/continuous_integration.yml)
|
|
2
|
+
[](https://doi.org/10.21105/joss.06442)
|
|
3
|
+
|
|
1
4
|
# Introduction
|
|
2
5
|
The PythonicDISORT package is a Discrete Ordinates Solver for the (1D) Radiative Transfer Equation
|
|
3
6
|
in a plane-parallel, horizontally homogeneous atmosphere.
|
|
@@ -6,7 +9,7 @@ While PythonicDISORT has been optimized for speed, it will naturally be slower t
|
|
|
6
9
|
On the other hand, PythonicDISORT should be easier to install, use, and modify than FORTRAN-based Discrete Ordinates Solvers.
|
|
7
10
|
|
|
8
11
|
PythonicDISORT is based on Stamnes' FORTRAN DISORT (see References, in particular [2, 3, 8]) and has its main features: multi-layer solver,
|
|
9
|
-
delta-
|
|
12
|
+
delta-_M_ scaling, Nakajima-Tanaka (NT) corrections, only flux option, direct beam source, isotropic internal source (blackbody emission),
|
|
10
13
|
Dirichlet boundary conditions (diffuse flux boundary sources), Bi-Directional Reflectance Function (BDRF) for surface reflection,
|
|
11
14
|
and interpolation with respect to polar angle.
|
|
12
15
|
In addition, we added a subroutine to compute actinic fluxes to satisfy a user request, and integration with respect to optical depth was also added.
|
|
@@ -16,6 +19,8 @@ You may contact me, Dion, through dh3065@columbia.edu.
|
|
|
16
19
|
|
|
17
20
|
The **GitHub repository** is https://github.com/LDEO-CREW/Pythonic-DISORT.
|
|
18
21
|
|
|
22
|
+
Accompanying Journal of Open Source Software paper: https://joss.theoj.org/papers/10.21105/joss.06442.
|
|
23
|
+
|
|
19
24
|
# Documentation
|
|
20
25
|
https://pythonic-disort.readthedocs.io/en/latest/
|
|
21
26
|
|
|
@@ -28,11 +33,22 @@ It is highly recommended that new users read the non-optional parts of sections
|
|
|
28
33
|
## PyTest and examples of how to use PythonicDISORT
|
|
29
34
|
|
|
30
35
|
Not only are there verification tests in `Pythonic-DISORT.ipynb`,
|
|
31
|
-
most of the test problems in Stamnes' `disotest.f90` (download DISORT 4.0.99 from http://www.rtatmocn.com/disort/) have also been recreated.
|
|
36
|
+
most of the test problems in Stamnes' `disotest.f90` (download DISORT 4.0.99 from http://www.rtatmocn.com/disort/) have also been recreated and enhanced.
|
|
32
37
|
In these tests, the solutions from PythonicDISORT are compared against solutions
|
|
33
38
|
from a F2PY-wrapped Stamnes' DISORT (version 4.0.99; wrapper inspired by https://github.com/kconnour/pyRT_DISORT). With PyTest installed, execute the console command `pytest`
|
|
34
39
|
in the `pydisotest` directory to run these tests. The `pydisotest` directory also contains Jupyter Notebooks to show the implementation of each test.
|
|
35
|
-
These notebooks double up as examples of how to use PythonicDISORT.
|
|
40
|
+
These notebooks double up as examples of how to use PythonicDISORT. The tests which have been implemented are:
|
|
41
|
+
|
|
42
|
+
* Test Problem 1: Isotropic Scattering
|
|
43
|
+
* Test Problem 2: Rayleigh Scattering, Beam Source
|
|
44
|
+
* Test Problem 3: Henyey-Greenstein Scattering
|
|
45
|
+
* Test Problem 4: Haze-L Scattering, Beam Source
|
|
46
|
+
* Test Problem 5: Cloud C.1 Scattering, Beam Source
|
|
47
|
+
* Test Problem 6: No Scattering, Increasingly Complex Sources (relevant for modeling longwave radiation)
|
|
48
|
+
* Test Problem 7: Absorption + Scattering + All Possible Sources, Lambertian and Hapke Surface Reflectivities (one layer)
|
|
49
|
+
* Test Problem 8: Absorbing / Isotropic-Scattering Medium With (two layers)
|
|
50
|
+
* Test Problem 9: General Emitting / Absorbing / Scattering Medium with (many different layers)
|
|
51
|
+
* Test Problem 11: Single-Layer vs. Multiple Layers (no corresponding Jupyter Notebook)
|
|
36
52
|
|
|
37
53
|
# Installation
|
|
38
54
|
|
{pythonicdisort-0.9.5 → pythonicdisort-1.0.1}/src/PythonicDISORT/_assemble_intensity_and_fluxes.py
RENAMED
|
@@ -16,12 +16,13 @@ def _assemble_intensity_and_fluxes(
|
|
|
16
16
|
is_atmos_multilayered, # Is the atmosphere multilayered?
|
|
17
17
|
weighted_scaled_Leg_coeffs, # Weighted and delta-scaled Legendre coefficients
|
|
18
18
|
BDRF_Fourier_modes, # BDRF Fourier modes
|
|
19
|
-
mu0, I0,
|
|
19
|
+
mu0, I0, rescale_factor, phi0, # Properties of the direct beam
|
|
20
20
|
there_is_beam_source, # Is there a beam source?
|
|
21
21
|
b_pos, b_neg, # Dirichlet BCs
|
|
22
|
-
b_pos_is_scalar, b_neg_is_scalar, # Is each Dirichlet BCs scalar
|
|
22
|
+
b_pos_is_scalar, b_neg_is_scalar, # Is each Dirichlet BCs scalar and so isotropic?
|
|
23
|
+
b_pos_is_vector, b_neg_is_vector, # Is each Dirichlet BCs vector?
|
|
23
24
|
Nscoeffs, # Number of isotropic source polynomial coefficients
|
|
24
|
-
|
|
25
|
+
scaled_s_poly_coeffs, # Delta-scaled polynomial coefficients of isotropic source
|
|
25
26
|
there_is_iso_source, # Is there an isotropic source?
|
|
26
27
|
scale_tau, # Delta-scale factor for tau
|
|
27
28
|
only_flux, # Only compute fluxes?
|
|
@@ -40,40 +41,42 @@ def _assemble_intensity_and_fluxes(
|
|
|
40
41
|
documentation, explanation and derivation.
|
|
41
42
|
|
|
42
43
|
Arguments of _assemble_intensity_and_fluxes
|
|
43
|
-
| Variable |
|
|
44
|
-
| ------------------------------ |
|
|
45
|
-
| `scaled_omega_arr` | `NLayers`
|
|
46
|
-
| `tau_arr` | `NLayers`
|
|
47
|
-
| `scaled_tau_arr_with_0` | `NLayers + 1`
|
|
48
|
-
| `mu_arr_pos` | `NQuad/2`
|
|
49
|
-
| `mu_arr` | `NQuad`
|
|
50
|
-
| `M_inv` | `NQuad/2`
|
|
51
|
-
| `W` | `NQuad/2`
|
|
52
|
-
| `N` | scalar
|
|
53
|
-
| `NQuad` | scalar
|
|
54
|
-
| `NLeg` | scalar
|
|
55
|
-
| `NFourier` | scalar
|
|
56
|
-
| `NLayers` | scalar
|
|
57
|
-
| `NBDRF` | scalar
|
|
58
|
-
| `is_atmos_multilayered` | boolean
|
|
59
|
-
| `weighted_scaled_Leg_coeffs` | `NLayers x NLeg`
|
|
60
|
-
| `BDRF_Fourier_modes` | `NBDRF`
|
|
61
|
-
| `mu0` | scalar
|
|
62
|
-
| `I0` | scalar
|
|
63
|
-
| `
|
|
64
|
-
| `phi0` | scalar
|
|
65
|
-
| `there_is_beam_source` | scalar
|
|
66
|
-
| `b_pos` | `NQuad/2 x NFourier` or scalar
|
|
67
|
-
| `b_neg` | `NQuad/2 x NFourier` or scalar
|
|
68
|
-
| `b_pos_is_scalar` | boolean
|
|
69
|
-
| `b_neg_is_scalar` | boolean
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
44
|
+
| Variable | Type / Shape |
|
|
45
|
+
| ------------------------------ | -------------------------------------------- |
|
|
46
|
+
| `scaled_omega_arr` | `NLayers` |
|
|
47
|
+
| `tau_arr` | `NLayers` |
|
|
48
|
+
| `scaled_tau_arr_with_0` | `NLayers + 1` |
|
|
49
|
+
| `mu_arr_pos` | `NQuad/2` |
|
|
50
|
+
| `mu_arr` | `NQuad` |
|
|
51
|
+
| `M_inv` | `NQuad/2` |
|
|
52
|
+
| `W` | `NQuad/2` |
|
|
53
|
+
| `N` | scalar |
|
|
54
|
+
| `NQuad` | scalar |
|
|
55
|
+
| `NLeg` | scalar |
|
|
56
|
+
| `NFourier` | scalar |
|
|
57
|
+
| `NLayers` | scalar |
|
|
58
|
+
| `NBDRF` | scalar |
|
|
59
|
+
| `is_atmos_multilayered` | boolean |
|
|
60
|
+
| `weighted_scaled_Leg_coeffs` | `NLayers x NLeg` |
|
|
61
|
+
| `BDRF_Fourier_modes` | `NBDRF` |
|
|
62
|
+
| `mu0` | scalar |
|
|
63
|
+
| `I0` | scalar |
|
|
64
|
+
| `rescale_factor` | scalar |
|
|
65
|
+
| `phi0` | scalar |
|
|
66
|
+
| `there_is_beam_source` | scalar |
|
|
67
|
+
| `b_pos` | `NQuad/2 x NFourier` or `NQuad/2` or scalar |
|
|
68
|
+
| `b_neg` | `NQuad/2 x NFourier` or `NQuad/2` or scalar |
|
|
69
|
+
| `b_pos_is_scalar` | boolean |
|
|
70
|
+
| `b_neg_is_scalar` | boolean |
|
|
71
|
+
| `b_pos_is_vector` | boolean |
|
|
72
|
+
| `b_neg_is_vector` | boolean |
|
|
73
|
+
| `Nscoeffs` | scalar |
|
|
74
|
+
| `scaled_s_poly_coeffs` | `NLayers x Nscoeffs` |
|
|
75
|
+
| `there_is_iso_source` | boolean |
|
|
76
|
+
| `scale_tau` | `NLayers` |
|
|
77
|
+
| `only_flux` | boolean |
|
|
78
|
+
| `use_banded_solver_NLayers` | scalar |
|
|
79
|
+
| `autograd_compatible` | boolean |
|
|
77
80
|
|
|
78
81
|
Notable internal variables of _assemble_intensity_and_fluxes
|
|
79
82
|
| Variable | Type / Shape |
|
|
@@ -136,7 +139,6 @@ def _assemble_intensity_and_fluxes(
|
|
|
136
139
|
K_collect,
|
|
137
140
|
B_collect,
|
|
138
141
|
G_inv_collect_0,
|
|
139
|
-
tau_arr,
|
|
140
142
|
scaled_tau_arr_with_0,
|
|
141
143
|
mu_arr, mu_arr_pos, mu_arr_pos * W,
|
|
142
144
|
N, NQuad,
|
|
@@ -147,8 +149,9 @@ def _assemble_intensity_and_fluxes(
|
|
|
147
149
|
there_is_beam_source,
|
|
148
150
|
b_pos, b_neg,
|
|
149
151
|
b_pos_is_scalar, b_neg_is_scalar,
|
|
152
|
+
b_pos_is_vector, b_neg_is_vector,
|
|
150
153
|
Nscoeffs,
|
|
151
|
-
|
|
154
|
+
scaled_s_poly_coeffs,
|
|
152
155
|
there_is_iso_source,
|
|
153
156
|
use_banded_solver_NLayers,
|
|
154
157
|
)
|
|
@@ -160,7 +163,7 @@ def _assemble_intensity_and_fluxes(
|
|
|
160
163
|
|
|
161
164
|
if not only_flux:
|
|
162
165
|
|
|
163
|
-
# Construct the intensity function (refer to
|
|
166
|
+
# Construct the intensity function (refer to section 3.7 of the Comprehensive Documentation)
|
|
164
167
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
165
168
|
def u(tau, phi, is_antiderivative_wrt_tau=False, return_Fourier_error=False, return_tau_arr=False):
|
|
166
169
|
"""
|
|
@@ -173,7 +176,7 @@ def _assemble_intensity_and_fluxes(
|
|
|
173
176
|
"""
|
|
174
177
|
tau = np.atleast_1d(tau)
|
|
175
178
|
phi = np.atleast_1d(phi)
|
|
176
|
-
if np.
|
|
179
|
+
if np.any(tau < 0) or np.any(tau > tau_arr[-1]):
|
|
177
180
|
raise ValueError("tau input outside the tau range specified for the atmosphere (check `tau_arr`).")
|
|
178
181
|
|
|
179
182
|
# Atmospheric layer indices
|
|
@@ -228,8 +231,8 @@ def _assemble_intensity_and_fluxes(
|
|
|
228
231
|
if there_is_iso_source:
|
|
229
232
|
l_uniq, l_inv = np.unique(l, return_inverse=True)
|
|
230
233
|
_mathscr_v_contribution = _mathscr_v(
|
|
231
|
-
|
|
232
|
-
|
|
234
|
+
scaled_tau, l_inv, Nscoeffs,
|
|
235
|
+
scaled_s_poly_coeffs[l_uniq],
|
|
233
236
|
G_collect_0[l_uniq],
|
|
234
237
|
K_collect_0[l_uniq],
|
|
235
238
|
G_inv_collect_0[l_uniq],
|
|
@@ -300,14 +303,14 @@ def _assemble_intensity_and_fluxes(
|
|
|
300
303
|
)
|
|
301
304
|
|
|
302
305
|
if return_tau_arr:
|
|
303
|
-
return
|
|
306
|
+
return rescale_factor * np.squeeze(u), Fourier_error, tau_arr
|
|
304
307
|
else:
|
|
305
|
-
return
|
|
308
|
+
return rescale_factor * np.squeeze(u), Fourier_error
|
|
306
309
|
else:
|
|
307
310
|
if return_tau_arr:
|
|
308
|
-
return
|
|
311
|
+
return rescale_factor * np.squeeze(u), tau_arr
|
|
309
312
|
else:
|
|
310
|
-
return
|
|
313
|
+
return rescale_factor * np.squeeze(u)
|
|
311
314
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
312
315
|
|
|
313
316
|
# Construct u0
|
|
@@ -323,7 +326,7 @@ def _assemble_intensity_and_fluxes(
|
|
|
323
326
|
to switch to an antiderivative of the function with respect to `tau`.
|
|
324
327
|
"""
|
|
325
328
|
tau = np.atleast_1d(tau)
|
|
326
|
-
if np.
|
|
329
|
+
if np.any(tau < 0) or np.any(tau > tau_arr[-1]):
|
|
327
330
|
raise ValueError("tau input outside the tau range given for the atmosphere (check `tau_arr`).")
|
|
328
331
|
|
|
329
332
|
# Atmospheric layer indices
|
|
@@ -390,8 +393,8 @@ def _assemble_intensity_and_fluxes(
|
|
|
390
393
|
if there_is_iso_source:
|
|
391
394
|
l_uniq, l_inv = np.unique(l, return_inverse=True)
|
|
392
395
|
_mathscr_v_contribution = _mathscr_v(
|
|
393
|
-
|
|
394
|
-
|
|
396
|
+
scaled_tau, l_inv, Nscoeffs,
|
|
397
|
+
scaled_s_poly_coeffs[l_uniq],
|
|
395
398
|
G_collect_0[l_uniq],
|
|
396
399
|
K_collect_0[l_uniq],
|
|
397
400
|
G_inv_collect_0[l_uniq],
|
|
@@ -402,16 +405,16 @@ def _assemble_intensity_and_fluxes(
|
|
|
402
405
|
u0 = u0 + _mathscr_v_contribution
|
|
403
406
|
|
|
404
407
|
if return_tau_arr and _return_act_dscale_for_reclass:
|
|
405
|
-
return
|
|
408
|
+
return rescale_factor * np.squeeze(u0), tau_arr, act_dscale_reclassification
|
|
406
409
|
elif return_tau_arr and not _return_act_dscale_for_reclass:
|
|
407
|
-
return
|
|
410
|
+
return rescale_factor * np.squeeze(u0), tau_arr
|
|
408
411
|
elif not return_tau_arr and _return_act_dscale_for_reclass:
|
|
409
|
-
return
|
|
412
|
+
return rescale_factor * np.squeeze(u0), act_dscale_reclassification
|
|
410
413
|
else:
|
|
411
|
-
return
|
|
414
|
+
return rescale_factor * np.squeeze(u0)
|
|
412
415
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
413
416
|
|
|
414
|
-
# Construct the flux functions (refer to
|
|
417
|
+
# Construct the flux functions (refer to section 3.8 of the Comprehensive Documentation)
|
|
415
418
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
416
419
|
GC_pos = GC_collect_0[:, :N, :]
|
|
417
420
|
GC_neg = GC_collect_0[:, N:, :]
|
|
@@ -428,7 +431,7 @@ def _assemble_intensity_and_fluxes(
|
|
|
428
431
|
to switch to an antiderivative of the function with respect to `tau`.
|
|
429
432
|
"""
|
|
430
433
|
tau = np.atleast_1d(tau)
|
|
431
|
-
if np.
|
|
434
|
+
if np.any(tau < 0) or np.any(tau > tau_arr[-1]):
|
|
432
435
|
raise ValueError("tau input outside the tau range given for the atmosphere (check `tau_arr`).")
|
|
433
436
|
|
|
434
437
|
# Atmospheric layer indices
|
|
@@ -447,8 +450,8 @@ def _assemble_intensity_and_fluxes(
|
|
|
447
450
|
if there_is_iso_source:
|
|
448
451
|
l_uniq, l_inv = np.unique(l, return_inverse=True)
|
|
449
452
|
_mathscr_v_contribution = _mathscr_v(
|
|
450
|
-
|
|
451
|
-
|
|
453
|
+
scaled_tau, l_inv, Nscoeffs,
|
|
454
|
+
scaled_s_poly_coeffs[l_uniq],
|
|
452
455
|
G_collect_0[l_uniq, :N, :],
|
|
453
456
|
K_collect_0[l_uniq],
|
|
454
457
|
G_inv_collect_0[l_uniq],
|
|
@@ -495,9 +498,9 @@ def _assemble_intensity_and_fluxes(
|
|
|
495
498
|
flux = 2 * pi * (mu_arr_pos * W) @ u0_pos
|
|
496
499
|
|
|
497
500
|
if return_tau_arr:
|
|
498
|
-
return
|
|
501
|
+
return rescale_factor * np.squeeze(flux)[()], tau_arr
|
|
499
502
|
else:
|
|
500
|
-
return
|
|
503
|
+
return rescale_factor * np.squeeze(flux)[()]
|
|
501
504
|
|
|
502
505
|
|
|
503
506
|
def flux_down(tau, is_antiderivative_wrt_tau=False, return_tau_arr=False):
|
|
@@ -509,7 +512,7 @@ def _assemble_intensity_and_fluxes(
|
|
|
509
512
|
to switch to an antiderivative of the function with respect to `tau`.
|
|
510
513
|
"""
|
|
511
514
|
tau = np.atleast_1d(tau)
|
|
512
|
-
if np.
|
|
515
|
+
if np.any(tau < 0) or np.any(tau > tau_arr[-1]):
|
|
513
516
|
raise ValueError("tau input outside the tau range given for the atmosphere (check `tau_arr`).")
|
|
514
517
|
|
|
515
518
|
# Atmospheric layer indices
|
|
@@ -528,8 +531,8 @@ def _assemble_intensity_and_fluxes(
|
|
|
528
531
|
if there_is_iso_source:
|
|
529
532
|
l_uniq, l_inv = np.unique(l, return_inverse=True)
|
|
530
533
|
_mathscr_v_contribution = _mathscr_v(
|
|
531
|
-
|
|
532
|
-
|
|
534
|
+
scaled_tau, l_inv, Nscoeffs,
|
|
535
|
+
scaled_s_poly_coeffs[l_uniq],
|
|
533
536
|
G_collect_0[l_uniq, N:, :],
|
|
534
537
|
K_collect_0[l_uniq],
|
|
535
538
|
G_inv_collect_0[l_uniq],
|
|
@@ -577,18 +580,18 @@ def _assemble_intensity_and_fluxes(
|
|
|
577
580
|
|
|
578
581
|
if return_tau_arr:
|
|
579
582
|
return (
|
|
580
|
-
|
|
581
|
-
|
|
583
|
+
rescale_factor * np.squeeze(diffuse_flux)[()],
|
|
584
|
+
rescale_factor * np.squeeze(direct_beam)[()],
|
|
582
585
|
tau_arr
|
|
583
586
|
)
|
|
584
587
|
else:
|
|
585
588
|
return (
|
|
586
|
-
|
|
587
|
-
|
|
589
|
+
rescale_factor * np.squeeze(diffuse_flux)[()],
|
|
590
|
+
rescale_factor * np.squeeze(direct_beam)[()],
|
|
588
591
|
)
|
|
589
592
|
# --------------------------------------------------------------------------------------------------------------------------
|
|
590
593
|
|
|
591
594
|
if only_flux:
|
|
592
|
-
return flux_up, flux_down, u0
|
|
595
|
+
return flux_up, flux_down, u0#, GC_collect_0, K_collect_0, B_collect_0
|
|
593
596
|
else:
|
|
594
597
|
return flux_up, flux_down, u0, u
|