the constrait results ‘v’ and ‘w’ are inconsistent with my input data
Bug report
Minimum working example
my input data is con_tc_3.csv
my program
import numpy as np # numeric python functions
import pandas as pd # need this to load our data from the csv files
from pyconturb import gen_turb, gen_spat_grid, TimeConstraint # functions we need from PyConTurb
if __name__ == '__main__':
result_path = R'D:\GW\2022_VV\bug_fix_question'
con_tc = TimeConstraint(pd.read_csv(f'{result_path}\\con_tc_3.csv', index_col=0)) # load data from csv directly into tc
con_tc.index = con_tc.index.map(lambda x: float(x) if (x not in 'kxyz') else x) # index cleaning
pts_y = 5
z_space = 10
y = np.linspace(-65, 65, pts_y) # lateral components of turbulent grid
z = np.linspace(10, 115, z_space) # vertical components of turbulent grid
kwargs = {'u_ref': 6.22, 'turb_class': 'B', 'z_ref': 115, # necessary keyword arguments for IEC turbulence
'T': 600, 'nt': 600, 'coh_model': 'iec3d'} # simulation length (s) and time step (s)
# interp_data = 'none' # use the default IEC 61400-1 profile instead of interpolating from contstraints
interp_data = ['wsp', 'sig', 'spec'] # use the default IEC 61400-1 profile instead of interpolating from contstraints
spat_df = gen_spat_grid(y, z) # create our spatial pandas dataframe. Columns are k, p_id x, y, and z.
sim_turb_df = gen_turb(spat_df, con_tc=con_tc, interp_data=interp_data, **kwargs)
sim_turb_df.to_csv(f'{result_path}\\sim_turb_df_all.csv')
spat_df.to_csv(f'{result_path}\\spat_df.csv')
con_tc.get_time().to_csv(f'{result_path}\\con_tc_ts.csv')
print('done.')
my result file is sim_turb_df_all.csv
Expected behavior
my expected is 'u','v','w' all can coincide with input data.
Current behavior
from result we can 'u' data can coincide as follow:
'v' and 'w' data cannot coincide as follow:
'v' and 'w' are shifted to the mean of 'u'.
PyConTurb verion
PyConTurb version: <2.6.3> Editable installation?
Note that the version can be found by pip show pyconturb
.
Edited by Li Cuiping