Skip to content

Commit d33407a

Browse files
committed
Default to plot against relative airmass (1), allow more variables (2)
(1) instead of zenith (2) from the times dict of vectors (aoi, apparent_zenith, relative_airmass, dayofyear)
1 parent 67a069f commit d33407a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Irradiances_ratios/spectrl2_E_ratio_bench.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ def simulate_from_product(self, **inputvals):
162162
* aerosol_asymmetry_factor=0.65
163163
164164
Saves results to a dataframe with the following shape:
165-
================= =====================
166-
... inputvals ... ... zenith values ...
167-
================= =====================
168-
parameter values E_λ<λ₀/E values
169-
================= =====================
165+
==================== ========================
166+
... input values ... ... datetimes values ...
167+
==================== ========================
168+
parameter values E_λ<λ₀/E values
169+
==================== ========================
170170
"""
171171
# Initialize needed values, in case they were changed from the outside
172172
self.simulation_prerun()
@@ -178,7 +178,9 @@ def simulate_from_product(self, **inputvals):
178178

179179
# Simulation results, save an entry for each of the cartesian product
180180
self.results = pd.DataFrame(
181-
columns=(*self.input_keys, *self.time_params["apparent_zenith"]),
181+
# columns after *self.input_keys only represent a position in
182+
# self.time_params
183+
columns=(*self.input_keys, *self.datetimes),
182184
# pre-allocate to the length of the itertools.product result
183185
index=np.arange(np.prod([len(array) for array in inputvals.values()])),
184186
dtype=np.float64,
@@ -235,13 +237,13 @@ def plot_results(
235237
) -> plt.Figure:
236238
"""
237239
Generate a plot of 'E fraction' vs each input variable from
238-
self.simulate_from_product(...) and 'apparent_zenith'.
240+
self.simulate_from_product(...) and variable names at.
239241
Optionally, a set of variables can be specified via parameter 'plot_keys: set'.
240-
Defaults to plot all available.
242+
Defaults to plot all available and .
241243
"""
242244
start_time = time() # Initialize start time of block
243-
if plot_keys is None: # default to add apparent zenith
244-
plot_keys = {"apparent_zenith", *self.input_keys}
245+
if plot_keys is None: # default to add relative_airmass
246+
plot_keys = {"relative_airmass", *self.input_keys}
245247
elif isinstance(plot_keys, str):
246248
plot_keys = {
247249
plot_keys,

0 commit comments

Comments
 (0)