PythonicDISORT 0.9.3__py3-none-any.whl → 0.9.5__py3-none-any.whl
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/_assemble_intensity_and_fluxes.py +2 -2
- PythonicDISORT/pydisort.py +2 -2
- PythonicDISORT/subroutines.py +65 -33
- {PythonicDISORT-0.9.3.dist-info → PythonicDISORT-0.9.5.dist-info}/METADATA +4 -4
- PythonicDISORT-0.9.5.dist-info/RECORD +11 -0
- {PythonicDISORT-0.9.3.dist-info → PythonicDISORT-0.9.5.dist-info}/WHEEL +1 -1
- PythonicDISORT-0.9.3.dist-info/RECORD +0 -11
- {PythonicDISORT-0.9.3.dist-info → PythonicDISORT-0.9.5.dist-info}/LICENSE.md +0 -0
- {PythonicDISORT-0.9.3.dist-info → PythonicDISORT-0.9.5.dist-info}/top_level.txt +0 -0
|
@@ -370,14 +370,14 @@ def _assemble_intensity_and_fluxes(
|
|
|
370
370
|
+ (B_collect_0.T / (-scale_tau / mu0)[None, :])[:, l]
|
|
371
371
|
* np.exp(-scaled_tau / mu0)[None, :]
|
|
372
372
|
)
|
|
373
|
-
|
|
373
|
+
elif is_antiderivative_wrt_tau and not there_is_beam_source:
|
|
374
374
|
u0 = np.einsum(
|
|
375
375
|
"tij, tj -> it",
|
|
376
376
|
GC_collect_0[l, :, :],
|
|
377
377
|
np.exp(exponent) / (scale_tau[:, None] * K_collect_0)[l, :],
|
|
378
378
|
optimize=True,
|
|
379
379
|
)
|
|
380
|
-
|
|
380
|
+
elif not is_antiderivative_wrt_tau and there_is_beam_source:
|
|
381
381
|
u0 = np.einsum(
|
|
382
382
|
"tij, tj -> it", GC_collect_0[l, :, :], np.exp(exponent), optimize=True
|
|
383
383
|
) + B_collect_0.T[:, l] * np.exp(-scaled_tau / mu0)[None, :]
|
PythonicDISORT/pydisort.py
CHANGED
|
@@ -23,8 +23,8 @@ def pydisort(
|
|
|
23
23
|
NT_cor=False,
|
|
24
24
|
BDRF_Fourier_modes=[],
|
|
25
25
|
s_poly_coeffs=np.array([[]]),
|
|
26
|
-
use_banded_solver_NLayers=
|
|
27
|
-
autograd_compatible
|
|
26
|
+
use_banded_solver_NLayers=10,
|
|
27
|
+
autograd_compatible=False,
|
|
28
28
|
):
|
|
29
29
|
"""Solves the 1D RTE for the fluxes, and optionally intensity,
|
|
30
30
|
of a multi-layer atmosphere with the specified optical properties, boundary conditions
|
PythonicDISORT/subroutines.py
CHANGED
|
@@ -299,14 +299,15 @@ def interpolate(u):
|
|
|
299
299
|
|
|
300
300
|
Parameters
|
|
301
301
|
----------
|
|
302
|
-
u : function
|
|
302
|
+
u or u0 : function
|
|
303
303
|
Non-interpolated intensity function as given by ``pydisort``.
|
|
304
304
|
|
|
305
305
|
Returns
|
|
306
306
|
-------
|
|
307
307
|
u_interpol : function
|
|
308
|
-
Intensity function with arguments ``(mu, tau, phi)``
|
|
309
|
-
|
|
308
|
+
Intensity function with arguments ``(mu, tau, phi)`` (for ``u``)
|
|
309
|
+
or ``(mu, tau)`` (for ``u0``) each of type array or float.
|
|
310
|
+
Returns an ndarray with axes corresponding to variation with each argument in the same order.
|
|
310
311
|
Pass ``is_antiderivative_wrt_tau = True`` (defaults to ``False``)
|
|
311
312
|
to switch to an antiderivative of the function with respect to ``tau``.
|
|
312
313
|
Pass ``return_Fourier_error = True`` (defaults to ``False``) to return the
|
|
@@ -319,38 +320,69 @@ def interpolate(u):
|
|
|
319
320
|
|
|
320
321
|
u_pos_interpol = sc.interpolate.BarycentricInterpolator(mu_arr_pos)
|
|
321
322
|
u_neg_interpol = sc.interpolate.BarycentricInterpolator(-mu_arr_pos)
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
323
|
+
|
|
324
|
+
if u.__code__.co_argcount == 5: # Function is u instead of u0
|
|
325
|
+
def u_interpol(mu, tau, phi, is_antiderivative_wrt_tau=False, return_Fourier_error=False, return_tau_arr=False):
|
|
326
|
+
if not np.all(np.abs(mu) <= 1):
|
|
327
|
+
raise ValueError("mu values must be between -1 and 1.")
|
|
328
|
+
|
|
329
|
+
mu = np.atleast_1d(mu)
|
|
330
|
+
|
|
331
|
+
if return_Fourier_error or return_tau_arr:
|
|
332
|
+
u_outputs = u(tau, phi, is_antiderivative_wrt_tau, return_Fourier_error, return_tau_arr)
|
|
333
|
+
u_cache = u_outputs[0]
|
|
334
|
+
else:
|
|
335
|
+
u_cache = u(tau, phi, is_antiderivative_wrt_tau)
|
|
336
|
+
|
|
337
|
+
results = np.empty((len(mu),) + np.shape(u_cache)[1:])
|
|
338
|
+
mask_pos = mu > 0
|
|
339
|
+
mask_else = ~mask_pos
|
|
340
|
+
|
|
341
|
+
if np.any(mask_pos):
|
|
342
|
+
u_pos_interpol.set_yi(u_cache[:N])
|
|
343
|
+
results[mask_pos] = u_pos_interpol(mu[mask_pos])
|
|
344
|
+
if np.any(mask_else):
|
|
345
|
+
u_neg_interpol.set_yi(u_cache[N:])
|
|
346
|
+
results[mask_else] = u_neg_interpol(mu[mask_else])
|
|
347
|
+
|
|
348
|
+
if return_Fourier_error or return_tau_arr:
|
|
349
|
+
return (np.squeeze(results)[()],) + u_outputs[1:]
|
|
350
|
+
else:
|
|
351
|
+
return np.squeeze(results)[()]
|
|
352
|
+
|
|
353
|
+
elif u.__code__.co_argcount == 4: # Function is u0 instead of u
|
|
354
|
+
def u_interpol(mu, tau, is_antiderivative_wrt_tau=False, return_Fourier_error=False, return_tau_arr=False):
|
|
355
|
+
if not np.all(np.abs(mu) <= 1):
|
|
356
|
+
raise ValueError("mu values must be between -1 and 1.")
|
|
357
|
+
|
|
358
|
+
mu = np.atleast_1d(mu)
|
|
359
|
+
|
|
360
|
+
if return_Fourier_error or return_tau_arr:
|
|
361
|
+
u_outputs = u(tau, is_antiderivative_wrt_tau, return_Fourier_error, return_tau_arr)
|
|
362
|
+
u_cache = u_outputs[0]
|
|
363
|
+
else:
|
|
364
|
+
u_cache = u(tau, is_antiderivative_wrt_tau)
|
|
365
|
+
|
|
366
|
+
results = np.empty((len(mu),) + np.shape(u_cache)[1:])
|
|
367
|
+
mask_pos = mu > 0
|
|
368
|
+
mask_else = ~mask_pos
|
|
369
|
+
|
|
370
|
+
if np.any(mask_pos):
|
|
371
|
+
u_pos_interpol.set_yi(u_cache[:N])
|
|
372
|
+
results[mask_pos] = u_pos_interpol(mu[mask_pos])
|
|
373
|
+
if np.any(mask_else):
|
|
374
|
+
u_neg_interpol.set_yi(u_cache[N:])
|
|
375
|
+
results[mask_else] = u_neg_interpol(mu[mask_else])
|
|
376
|
+
|
|
377
|
+
if return_Fourier_error or return_tau_arr:
|
|
378
|
+
return (np.squeeze(results)[()],) + u_outputs[1:]
|
|
379
|
+
else:
|
|
380
|
+
return np.squeeze(results)[()]
|
|
381
|
+
else:
|
|
382
|
+
raise ValueError("This subroutine can only interpolate u or u0")
|
|
383
|
+
|
|
351
384
|
return u_interpol
|
|
352
385
|
|
|
353
|
-
|
|
354
386
|
|
|
355
387
|
def to_diag_ordered_form(A, sym_offset):
|
|
356
388
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PythonicDISORT
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
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
|
|
@@ -28,9 +28,9 @@ On the other hand, PythonicDISORT should be easier to install, use, and modify t
|
|
|
28
28
|
|
|
29
29
|
PythonicDISORT is based on Stamnes' FORTRAN DISORT (see References, in particular [2, 3, 8]) and has its main features: multi-layer solver,
|
|
30
30
|
delta-M scaling, Nakajima-Tanaka (NT) corrections, only flux option, direct beam source, isotropic internal source (blackbody emission),
|
|
31
|
-
Dirichlet boundary conditions (diffuse flux boundary sources), Bi-Directional Reflectance Function (BDRF) for surface reflection,
|
|
32
|
-
interpolation with respect to polar angle
|
|
33
|
-
In addition, we added a subroutine to
|
|
31
|
+
Dirichlet boundary conditions (diffuse flux boundary sources), Bi-Directional Reflectance Function (BDRF) for surface reflection,
|
|
32
|
+
and interpolation with respect to polar angle.
|
|
33
|
+
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.
|
|
34
34
|
Further feature requests as well as feedback are welcome.
|
|
35
35
|
|
|
36
36
|
You may contact me, Dion, through dh3065@columbia.edu.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
PythonicDISORT/__init__.py,sha256=V1obNzaFgqInxqYJ5h_r6JHbZRxx4VM5VgzCIS6EEzI,84
|
|
2
|
+
PythonicDISORT/_assemble_intensity_and_fluxes.py,sha256=g5VOjVNe9byEAdifi--9vFdj_JqHlzTkJgRK0FkY30o,29138
|
|
3
|
+
PythonicDISORT/_solve_for_coeffs.py,sha256=8xnjR6fenaTiPXXzxvtXmETFZRnwOnGkHIuuOFpz7Lc,15402
|
|
4
|
+
PythonicDISORT/_solve_for_gen_and_part_sols.py,sha256=1IvyEZrcqLcafAQgAFpXtJ2H6hCvIM11OgBHF3KqmGc,12960
|
|
5
|
+
PythonicDISORT/pydisort.py,sha256=Y8Smva-DM7uF8vVbC67Y8Taicvr6BAfRHav7LAy5ksw,37037
|
|
6
|
+
PythonicDISORT/subroutines.py,sha256=MhVwT3C5iwoDr0M51jnsvqkEFk1nfm7L_0svaQ5NOSE,22937
|
|
7
|
+
PythonicDISORT-0.9.5.dist-info/LICENSE.md,sha256=q1i1QVh0OLzK0fj6kaNRNWsM_KZca66JwWgWwbuCPlA,1092
|
|
8
|
+
PythonicDISORT-0.9.5.dist-info/METADATA,sha256=Z-N--CK4I4gUqZEjzd8LXwI-DqgNtUlLbjsIO0eFdZ0,7104
|
|
9
|
+
PythonicDISORT-0.9.5.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
10
|
+
PythonicDISORT-0.9.5.dist-info/top_level.txt,sha256=aX6kCeI1E7naZz3xfw4_mIbWh5KBh9dmF3FIvgP5m3Y,15
|
|
11
|
+
PythonicDISORT-0.9.5.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
PythonicDISORT/__init__.py,sha256=V1obNzaFgqInxqYJ5h_r6JHbZRxx4VM5VgzCIS6EEzI,84
|
|
2
|
-
PythonicDISORT/_assemble_intensity_and_fluxes.py,sha256=PsZJN-eHKKMP2VHqk8zFVw1CZ5Em2tc0aJOej3qdg2k,29134
|
|
3
|
-
PythonicDISORT/_solve_for_coeffs.py,sha256=8xnjR6fenaTiPXXzxvtXmETFZRnwOnGkHIuuOFpz7Lc,15402
|
|
4
|
-
PythonicDISORT/_solve_for_gen_and_part_sols.py,sha256=1IvyEZrcqLcafAQgAFpXtJ2H6hCvIM11OgBHF3KqmGc,12960
|
|
5
|
-
PythonicDISORT/pydisort.py,sha256=AZmhV2niPW_XK5cGi_tMSgQQemBtApQB1sKLbEQXqLY,37039
|
|
6
|
-
PythonicDISORT/subroutines.py,sha256=tq9_m4iXE8zLE8hh69aWh4wNfRHyCkgZFxZI48DRNE0,21312
|
|
7
|
-
PythonicDISORT-0.9.3.dist-info/LICENSE.md,sha256=q1i1QVh0OLzK0fj6kaNRNWsM_KZca66JwWgWwbuCPlA,1092
|
|
8
|
-
PythonicDISORT-0.9.3.dist-info/METADATA,sha256=elndi6Hlfg3SmgDWdV-Esuu3JML574zlvDvpwrI4I8k,7102
|
|
9
|
-
PythonicDISORT-0.9.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
10
|
-
PythonicDISORT-0.9.3.dist-info/top_level.txt,sha256=aX6kCeI1E7naZz3xfw4_mIbWh5KBh9dmF3FIvgP5m3Y,15
|
|
11
|
-
PythonicDISORT-0.9.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|