Skip to content

Commit

Permalink
Fix yaw angles
Browse files Browse the repository at this point in the history
  • Loading branch information
paulf81 committed Oct 26, 2023
1 parent d246726 commit 87d15f1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions flasc/model_tuning/floris_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ def sweep_deflection_parameter_for_total_uplift(
df_scada_baseline = pl.from_pandas(df_scada_baseline_in)
df_scada_wakesteering = pl.from_pandas(df_scada_wakesteering_in)

# Add a simple index
df_scada_baseline = df_scada_baseline.with_columns(
pl.col('simple_index', np.arange(0,df_scada_baseline.shape[0]))
)
df_scada_wakesteering = df_scada_wakesteering.with_columns(
pl.col('simple_index', np.arange(0,df_scada_wakesteering.shape[0]))
)



# Trim to ws/wd
df_scada_baseline = df_scada_baseline.filter(
Expand All @@ -333,6 +342,15 @@ def sweep_deflection_parameter_for_total_uplift(
(pl.col('wd') < wd_max)
)


# Trim the yaw angle matrices
if yaw_angles_baseline is not None:
simple_index = df_scada_baseline['simple_index'].to_numpy()
yaw_angles_baseline = yaw_angles_baseline[simple_index,:,:]
if yaw_angles_wakesteering is not None:
simple_index = df_scada_wakesteering['simple_index'].to_numpy()
yaw_angles_wakesteering = yaw_angles_wakesteering[simple_index,:,:]

ref_cols = [f'pow_{i:03d}' for i in ref_turbines]
test_cols = [f'pow_{i:03d}' for i in test_turbines]
df_scada_baseline = add_power_ref(df_scada_baseline, ref_cols)
Expand Down

0 comments on commit 87d15f1

Please sign in to comment.