PythonicDISORT 0.6.1__py3-none-any.whl → 0.6.2__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.
@@ -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, NLoops,
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
- NLoops,
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
- NLoops,
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((NLoops - 1, len(tau), NQuad))))
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(NLoops)[:, None] * (phi0 - phi)[None, :]),
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((NLoops - 1) * (phi0 - phi))[None, None, :]),
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
- NLoops,
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((NLoops * NLayers, NQuad, NQuad))
33
- K_collect = np.empty((NLoops * NLayers, NQuad))
34
- alpha_arr = np.empty((NLoops * NLayers, N, N))
35
- beta_arr = np.empty((NLoops * NLayers, N, N))
36
- X_tilde_arr = np.empty((NLoops * NLayers, NQuad))
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((NLoops * NLayers, NQuad))
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 NLoops Fourier modes
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(NLoops):
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((NLoops, NLayers, NQuad, NQuad)),
173
- K_collect.reshape((NLoops, NLayers, NQuad)),
174
- B_collect.reshape((NLoops, NLayers, NQuad)),
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((NLoops, NLayers, NQuad, NQuad)),
180
- K_collect.reshape((NLoops, NLayers, NQuad)),
181
- B_collect.reshape((NLoops, NLayers, NQuad)),
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((NLoops, NLayers, NQuad, NQuad)),
187
- K_collect.reshape((NLoops, NLayers, NQuad)),
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((NLoops, NLayers, NQuad, NQuad)),
193
- K_collect.reshape((NLoops, NLayers, NQuad)),
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
- NLoops,
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((NLoops, NLayers, NQuad, NQuad))
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(NLoops):
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
- NLoops=None,
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
- NLoops : optional, int
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 NLoops is None:
120
- NLoops = NQuad
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 (NLoops)
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 NLoops > 0
166
- assert NLoops <= NLeg
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, NLoops)
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, NLoops)
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, NLoops,
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
- NLoops = 1 # We only need to solve for the 0th Fourier mode to compute the flux
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, NLoops,
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.1
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
@@ -0,0 +1,11 @@
1
+ PythonicDISORT/__init__.py,sha256=V1obNzaFgqInxqYJ5h_r6JHbZRxx4VM5VgzCIS6EEzI,84
2
+ PythonicDISORT/_assemble_solution_functions.py,sha256=_VyCjn6WUXE6thYrf-KoGL0sYZI9dotGtlcaJPWo_fc,14849
3
+ PythonicDISORT/_diagonalize.py,sha256=CT3pG1Hi3-iRJGYoJNiGYey4Mlp0yyGS6qYlUXHYYeA,9147
4
+ PythonicDISORT/_solve_for_coefs.py,sha256=4LEcwveWC70-ALDQjwpnOKxb6yXd5BHqJYdxkkhGtvI,15014
5
+ PythonicDISORT/pydisort.py,sha256=wjiIv0MZZ8QOXyYdZrd86YpzDdmIG12_HXAPNoO0P6s,24295
6
+ PythonicDISORT/subroutines.py,sha256=KXaFUIBdt0o8Ag204oBGObcw1-JYUyxJF3_VX_zNEpI,13295
7
+ PythonicDISORT-0.6.2.dist-info/LICENSE.md,sha256=q1i1QVh0OLzK0fj6kaNRNWsM_KZca66JwWgWwbuCPlA,1092
8
+ PythonicDISORT-0.6.2.dist-info/METADATA,sha256=g6MguV17dX4teiOi0iLYSTq82HuOUwzrERa5jOiacPU,7135
9
+ PythonicDISORT-0.6.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
10
+ PythonicDISORT-0.6.2.dist-info/top_level.txt,sha256=aX6kCeI1E7naZz3xfw4_mIbWh5KBh9dmF3FIvgP5m3Y,15
11
+ PythonicDISORT-0.6.2.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- PythonicDISORT/__init__.py,sha256=V1obNzaFgqInxqYJ5h_r6JHbZRxx4VM5VgzCIS6EEzI,84
2
- PythonicDISORT/_assemble_solution_functions.py,sha256=J2RJUr9xWquN4RTXukRk5d7sjzYqWSnG2FmGz57QSAI,14837
3
- PythonicDISORT/_diagonalize.py,sha256=qXilWumIzDC3c-sMuVqF0XWdpFbzVSw9cmAWDMOvevA,9109
4
- PythonicDISORT/_solve_for_coefs.py,sha256=LnrHm-UdTyKNpaOHXYJ5-jLX0PPgHD_-h5Gp4UAZUNs,15008
5
- PythonicDISORT/pydisort.py,sha256=tU_WBMLJIRpkiP-VrNoHEgX-XOvdbbvXS7JVaL269KU,24271
6
- PythonicDISORT/subroutines.py,sha256=KXaFUIBdt0o8Ag204oBGObcw1-JYUyxJF3_VX_zNEpI,13295
7
- PythonicDISORT-0.6.1.dist-info/LICENSE.md,sha256=q1i1QVh0OLzK0fj6kaNRNWsM_KZca66JwWgWwbuCPlA,1092
8
- PythonicDISORT-0.6.1.dist-info/METADATA,sha256=Gf7MIPlVOwk4_cNaHsh2Fm3W51jxt5klBMpPLoDGAXo,7135
9
- PythonicDISORT-0.6.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
10
- PythonicDISORT-0.6.1.dist-info/top_level.txt,sha256=aX6kCeI1E7naZz3xfw4_mIbWh5KBh9dmF3FIvgP5m3Y,15
11
- PythonicDISORT-0.6.1.dist-info/RECORD,,