Skip to content
Snippets Groups Projects
Commit 60df4f7f authored by David Verelst's avatar David Verelst
Browse files

prepost.hawcstab2: robust handling of various pwr output formats + tests

parent 7e838bee
No related branches found
No related tags found
No related merge requests found
......@@ -37,31 +37,52 @@ def ReadFileHAWCStab2Header(fname):
includes the column number and units between square brackets.
"""
def _read(fname, header=0, widths=[20]*15, skipfooter=0):
df = pd.read_fwf(fname, header=header, widths=widths,
skipfooter=skipfooter)
units = regex_units.findall(''.join(df.columns))
return df, units
def get_lines(fname):
# get the line that contains the header/column names and the first
# line that holds the data
with open(fname) as f:
line_header = f.readline()
line_data = f.readline()
# sometimes there are more header lines. The header is always on the
# last of the lines marked with #
while line_data[:2].strip() == '#':
line_header = line_data
line_data = f.readline()
return line_header, line_data
def get_col_widths(line):
# it is very annoying that various files can have various column widths
# also, the first column is one character wider than the rest
i0 = re.search(r'\S',line).start()
i1_col1 = line[i0:].find(' ') + i0
# number of columns can also be different (gradients or not, node displ)
nr_cols = int(round(len(line)/i1_col1, 0))
colwidths = [i1_col1+1] + [i1_col1]*(nr_cols-1)
return colwidths
with open(fname) as f:
line = f.readline()
def get_col_names(line, colwidths):
# because sometimes there are no spaces between the header of each column
# sanitize the headers
ci = np.array([0] + colwidths).cumsum()
# remember zero based indexing
ci[1:] = ci[1:] - 1
columns = []
for i in range(len(ci)-1):
# also lose the index in the header
colname = line[ci[i]:ci[i+1]][:-2].replace('#', '').strip()
columns.append(colname)
return columns
# when gradients are included in the output
if len(line) > 800:
df, units = _read(fname, header=1, widths=[30]*27)
# column name has the name, unit and column number in it...
df.columns = [k[:-2].replace('#', '').strip() for k in df.columns]
return df, units
elif len(line) > 200:
df, units = _read(fname, header=0, widths=[20]*15)
# column name has the name, unit and column number in it...
df.columns = [k[:-2].replace('#', '').strip() for k in df.columns]
return df, units
# older versions of HS2 seem to have two columns less
else:
df, units = _read(fname, header=0, widths=[14]*13)
df.columns = [k.replace('#', '').strip() for k in df.columns]
return df, units
line_header, line_data = get_lines(fname)
colwidths = get_col_widths(line_data)
# FIXME: gradients have duplicate columns: set for with wake updated
# and another with frozen wake assumption
columns = get_col_names(line_header, colwidths)
df = pd.read_fwf(fname, widths=colwidths, comment='#', header=None,
names=columns)
units = regex_units.findall(''.join(columns))
return df, units
class InductionResults(object):
......@@ -76,8 +97,11 @@ class InductionResults(object):
def get_col_width(self, fname):
# figure out column width
with open(fname) as fid:
# line1 contains the header
line1 = fid.readline()
# line2 contains the numerical data
line2 = fid.readline()
# it is very annoying that various files can have various column widths
# also, the first column is one character wider than the rest
i0 = re.search(r'\S',line2).start()
......
# V [m/s] 1 P [kW] 2 T [kN] 3 Cp [-] 4 Ct [-] 5 Pitch Q [Nm] 6 Flap M [kNm] 7 Edge M [kNm] 8 Pitch [deg] 9 Speed [rpm] 10 Tip x [m] 11 Tip y [m] 12 Tip z [m] 13
0.5000000000E+01 0.7970169792E+03 0.3544331376E+03 0.4169253900E+00 0.9270327859E+00 0.9594040831E+04 -0.7285219033E+04 0.4266133176E+03 0.1520000000E+01 0.6000000000E+01 0.1058287730E+00 -0.4570720975E+01 0.8914999301E+02
0.6000000000E+01 0.1538224912E+04 0.5028078553E+03 0.4652851459E+00 0.9125415578E+00 0.5381139449E+05 -0.1012310608E+05 0.8194497447E+03 0.4600000000E+00 0.6000000000E+01 0.2331541125E+00 -0.3771950371E+01 0.8918544381E+02
0.7000000000E+01 0.2506971009E+04 0.6601028022E+03 0.4772730921E+00 0.8796851381E+00 0.9494399540E+05 -0.1317261132E+05 0.1255760384E+04 0.0000000000E+00 0.6370000000E+01 0.3464163472E+00 -0.2878853577E+01 0.8920985994E+02
0.8000000000E+01 0.3761077611E+04 0.8583261420E+03 0.4795983570E+00 0.8756039627E+00 0.1290616014E+06 -0.1709648905E+05 0.1646679988E+04 0.0000000000E+00 0.7280000000E+01 0.4680668290E+00 -0.1686808663E+01 0.8921715254E+02
0.9000000000E+01 0.5381732316E+04 0.1080310781E+04 0.4822396840E+00 0.8712284988E+00 0.1701276997E+06 -0.2147779640E+05 0.2092031161E+04 0.0000000000E+00 0.8190000000E+01 0.6022597200E+00 -0.4071172529E+00 0.8919241427E+02
0.1000000000E+02 0.7416712473E+04 0.1324854638E+04 0.4851495915E+00 0.8666274836E+00 0.2187145887E+06 -0.2629124663E+05 0.2591677356E+04 0.0000000000E+00 0.9100000000E+01 0.7474581721E+00 0.9382686044E+00 0.8913014778E+02
0.1100000000E+02 0.9907484978E+04 0.1546838035E+04 0.4877552803E+00 0.8376760228E+00 0.2812549251E+06 -0.3054233251E+05 0.3279346841E+04 0.0000000000E+00 0.9600000000E+01 0.8928524405E+00 0.2040564708E+01 0.8905163080E+02
0.1200000000E+02 0.1061014657E+05 0.1249721989E+04 0.4011774939E+00 0.5670349590E+00 0.2254674006E+06 -0.2399091342E+05 0.3517871551E+04 0.4100000000E+01 0.9600000000E+01 0.8502430701E+00 -0.4898551655E-01 0.8918109828E+02
0.1300000000E+02 0.1061208986E+05 0.1077410212E+04 0.3153511352E+00 0.4162151842E+00 0.1829537579E+06 -0.2005519301E+05 0.3521839899E+04 0.6690000000E+01 0.9600000000E+01 0.7105471690E+00 -0.1322639287E+01 0.8921676454E+02
0.1400000000E+02 0.1061401890E+05 0.9708527455E+03 0.2525095152E+00 0.3233547837E+00 0.1559014426E+06 -0.1748238187E+05 0.3524730063E+04 0.8620000000E+01 0.9600000000E+01 0.5668305192E+00 -0.2186290412E+01 0.8922206031E+02
0.1500000000E+02 0.1061329710E+05 0.8932979867E+03 0.2053212055E+00 0.2592215469E+00 0.1363963165E+06 -0.1551083230E+05 0.3526274664E+04 0.1026000000E+02 0.9600000000E+01 0.4200757269E+00 -0.2868166914E+01 0.8921514105E+02
0.1600000000E+02 0.1060155692E+05 0.8319576205E+03 0.1690468823E+00 0.2122553780E+00 0.1211316054E+06 -0.1387742351E+05 0.3523910934E+04 0.1174000000E+02 0.9600000000E+01 0.2690761529E+00 -0.3446315184E+01 0.8920132453E+02
0.1700000000E+02 0.1060183963E+05 0.7833358202E+03 0.1409974106E+00 0.1771033654E+00 0.1097254204E+06 -0.1250589079E+05 0.3525345535E+04 0.1310000000E+02 0.9600000000E+01 0.1163384788E+00 -0.3946279752E+01 0.8918325238E+02
0.1800000000E+02 0.1059682774E+05 0.7428073023E+03 0.1187798692E+00 0.1498703210E+00 0.1008807108E+06 -0.1130020855E+05 0.3524900846E+04 0.1438000000E+02 0.9600000000E+01 -0.4028360452E-01 -0.4394639668E+01 0.8916198430E+02
0.1900000000E+02 0.1061289335E+05 0.7098016174E+03 0.1012000817E+00 0.1285990169E+00 0.9464525489E+05 -0.1025221596E+05 0.3531333519E+04 0.1559000000E+02 0.9600000000E+01 -0.1969844321E+00 -0.4793302157E+01 0.8913884812E+02
0.2000000000E+02 0.1060030267E+05 0.6800543291E+03 0.8671201045E-01 0.1112588573E+00 0.8942778021E+05 -0.9275547527E+04 0.3528209496E+04 0.1676000000E+02 0.9600000000E+01 -0.3598763549E+00 -0.5166554397E+01 0.8911339331E+02
0.2100000000E+02 0.1061048923E+05 0.6555390118E+03 0.7502015373E-01 0.9733306017E-01 0.8621809447E+05 -0.8410251218E+04 0.3532565660E+04 0.1788000000E+02 0.9600000000E+01 -0.5224480721E+00 -0.5504269566E+01 0.8908699920E+02
0.2200000000E+02 0.1060110309E+05 0.6333292288E+03 0.6522967792E-01 0.8573267782E-01 0.8387755891E+05 -0.7596163932E+04 0.3530396023E+04 0.1897000000E+02 0.9600000000E+01 -0.6897955513E+00 -0.5822816349E+01 0.8905901247E+02
0.2300000000E+02 0.1058612080E+05 0.6136154737E+03 0.5704072800E-01 0.7604529574E-01 0.8251906318E+05 -0.6837127935E+04 0.3526341412E+04 0.2003000000E+02 0.9600000000E+01 -0.8600401258E+00 -0.6121188447E+01 0.8902990031E+02
0.2400000000E+02 0.1061205678E+05 0.5981919525E+03 0.5035738770E-01 0.6812639928E-01 0.8293079728E+05 -0.6168957698E+04 0.3535808055E+04 0.2105000000E+02 0.9600000000E+01 -0.1027553825E+01 -0.6391259215E+01 0.8900089860E+02
0.2500000000E+02 0.1061168881E+05 0.5837999848E+03 0.4457969688E-01 0.6131358268E-01 0.8380042886E+05 -0.5525518996E+04 0.3536527702E+04 0.2205000000E+02 0.9600000000E+01 -0.1200272290E+01 -0.6650867142E+01 0.8897053016E+02
# V [m/s] 1 P [kW] 2 T [kN] 3 Cp [-] 4 Ct [-] 5 Pitch Q [Nm] 6 Flap M [kNm] 7 Edge M [kNm] 8 Pitch [deg] 9 Speed [rpm] 10 Tip x [m] 11 Tip y [m] 12 Tip z [m] 13
0.5000000000000000E+01 0.7970169791578448E+03 0.3544331376231053E+03 0.4169253899720817E+00 0.9270327859180790E+00 0.9594040831429129E+04 -0.7285219033288880E+04 0.4266133175794696E+03 0.1520000000000000E+01 0.6000000000000000E+01 0.1058287730378880E+00 -0.4570720974965974E+01 0.8914999301491066E+02
0.6000000000000000E+01 0.1538224912236643E+04 0.5028078552591091E+03 0.4652851458655674E+00 0.9125415578002156E+00 0.5381139449224927E+05 -0.1012310607930005E+05 0.8194497447377861E+03 0.4600000000000001E+00 0.6000000000000000E+01 0.2331541124624440E+00 -0.3771950370961326E+01 0.8918544380531593E+02
0.7000000000000000E+01 0.2506971009248905E+04 0.6601028022124265E+03 0.4772730920662255E+00 0.8796851380883184E+00 0.9494399539690152E+05 -0.1317261132118186E+05 0.1255760383606364E+04 0.0000000000000000E+00 0.6370000000000000E+01 0.3464163472096511E+00 -0.2878853576663426E+01 0.8920985994276425E+02
0.8000000000000000E+01 0.3761077610689366E+04 0.8583261420148028E+03 0.4795983570259911E+00 0.8756039627213232E+00 0.1290616013640559E+06 -0.1709648904765180E+05 0.1646679988112126E+04 0.0000000000000000E+00 0.7279999999999999E+01 0.4680668290015476E+00 -0.1686808663189807E+01 0.8921715253544735E+02
0.9000000000000000E+01 0.5381732315696529E+04 0.1080310780888448E+04 0.4822396840120912E+00 0.8712284988272722E+00 0.1701276996611903E+06 -0.2147779639777565E+05 0.2092031161012877E+04 0.0000000000000000E+00 0.8190000000000000E+01 0.6022597199520462E+00 -0.4071172529039249E+00 0.8919241427217456E+02
0.1000000000000000E+02 0.7416712472523705E+04 0.1324854638420147E+04 0.4851495915269021E+00 0.8666274835963063E+00 0.2187145886774265E+06 -0.2629124662906981E+05 0.2591677355693617E+04 0.0000000000000000E+00 0.9100000000000000E+01 0.7474581721392320E+00 0.9382686044027334E+00 0.8913014778298016E+02
0.1100000000000000E+02 0.9907484978459799E+04 0.1546838035017184E+04 0.4877552803179612E+00 0.8376760228436287E+00 0.2812549250549605E+06 -0.3054233250592176E+05 0.3279346840966920E+04 0.0000000000000000E+00 0.9599999999999998E+01 0.8928524405421021E+00 0.2040564708128432E+01 0.8905163079868974E+02
0.1200000000000000E+02 0.1061014657108758E+05 0.1249721988766591E+04 0.4011774939027885E+00 0.5670349590398148E+00 0.2254674005676494E+06 -0.2399091342085267E+05 0.3517871550943046E+04 0.4100000000000001E+01 0.9599999999999998E+01 0.8502430701369529E+00 -0.4898551655049134E-01 0.8918109827975073E+02
0.1300000000000000E+02 0.1061208985668525E+05 0.1077410211782461E+04 0.3153511352272069E+00 0.4162151841656613E+00 0.1829537578781671E+06 -0.2005519301411685E+05 0.3521839899182678E+04 0.6690000000000001E+01 0.9599999999999998E+01 0.7105471690129758E+00 -0.1322639286687157E+01 0.8921676454114522E+02
0.1400000000000000E+02 0.1061401889940045E+05 0.9708527455375043E+03 0.2525095152315331E+00 0.3233547837483274E+00 0.1559014425969238E+06 -0.1748238186619036E+05 0.3524730063354117E+04 0.8620000000000001E+01 0.9599999999999998E+01 0.5668305192378178E+00 -0.2186290411632646E+01 0.8922206030638033E+02
0.1500000000000000E+02 0.1061329710264457E+05 0.8932979867475455E+03 0.2053212055070568E+00 0.2592215469078845E+00 0.1363963164848901E+06 -0.1551083229602619E+05 0.3526274664368028E+04 0.1026000000000000E+02 0.9599999999999998E+01 0.4200757268826584E+00 -0.2868166913940989E+01 0.8921514104676571E+02
0.1600000000000000E+02 0.1060155692128170E+05 0.8319576204597553E+03 0.1690468823274193E+00 0.2122553779774559E+00 0.1211316053618953E+06 -0.1387742351383117E+05 0.3523910934267796E+04 0.1174000000000000E+02 0.9599999999999998E+01 0.2690761528524743E+00 -0.3446315184459102E+01 0.8920132452776888E+02
0.1700000000000000E+02 0.1060183963499188E+05 0.7833358202115986E+03 0.1409974106264970E+00 0.1771033654307255E+00 0.1097254204332629E+06 -0.1250589079254378E+05 0.3525345535114981E+04 0.1310000000000000E+02 0.9599999999999998E+01 0.1163384787611592E+00 -0.3946279752224537E+01 0.8918325237589035E+02
0.1800000000000000E+02 0.1059682774409639E+05 0.7428073022970189E+03 0.1187798691986428E+00 0.1498703210122704E+00 0.1008807108347629E+06 -0.1130020855305979E+05 0.3524900845735160E+04 0.1438000000000000E+02 0.9599999999999998E+01 -0.4028360451736025E-01 -0.4394639668368468E+01 0.8916198430045489E+02
0.1900000000000000E+02 0.1061289335441474E+05 0.7098016173736669E+03 0.1012000817235990E+00 0.1285990169176314E+00 0.9464525489133733E+05 -0.1025221596297727E+05 0.3531333518711257E+04 0.1559000000000000E+02 0.9599999999999998E+01 -0.1969844320530114E+00 -0.4793302156631236E+01 0.8913884812140398E+02
0.2000000000000000E+02 0.1060030266827369E+05 0.6800543290753695E+03 0.8671201044635370E-01 0.1112588572840720E+00 0.8942778021483211E+05 -0.9275547526844854E+04 0.3528209495967019E+04 0.1676000000000000E+02 0.9599999999999998E+01 -0.3598763549410885E+00 -0.5166554397385442E+01 0.8911339331284624E+02
0.2100000000000000E+02 0.1061048922554726E+05 0.6555390117784526E+03 0.7502015372940181E-01 0.9733306017006643E-01 0.8621809447266402E+05 -0.8410251218309510E+04 0.3532565660171932E+04 0.1788000000000000E+02 0.9599999999999998E+01 -0.5224480720785591E+00 -0.5504269565763194E+01 0.8908699920362002E+02
0.2200000000000000E+02 0.1060110308578692E+05 0.6333292287585914E+03 0.6522967791689528E-01 0.8573267781714662E-01 0.8387755890787989E+05 -0.7596163931537479E+04 0.3530396023248682E+04 0.1897000000000000E+02 0.9599999999999998E+01 -0.6897955512604874E+00 -0.5822816349005327E+01 0.8905901247150452E+02
0.2300000000000000E+02 0.1058612079687397E+05 0.6136154737425885E+03 0.5704072800083193E-01 0.7604529573659602E-01 0.8251906317545590E+05 -0.6837127934996724E+04 0.3526341412461991E+04 0.2003000000000000E+02 0.9599999999999998E+01 -0.8600401258454597E+00 -0.6121188446982691E+01 0.8902990031045036E+02
0.2400000000000000E+02 0.1061205678332627E+05 0.5981919524558181E+03 0.5035738769763526E-01 0.6812639928143560E-01 0.8293079727758301E+05 -0.6168957697994681E+04 0.3535808055464818E+04 0.2105000000000000E+02 0.9599999999999998E+01 -0.1027553825139650E+01 -0.6391259215359025E+01 0.8900089859581524E+02
0.2500000000000000E+02 0.1061168880733778E+05 0.5837999848031249E+03 0.4457969688339745E-01 0.6131358268124843E-01 0.8380042886389370E+05 -0.5525518996295825E+04 0.3536527702270825E+04 0.2205000000000000E+02 0.9599999999999998E+01 -0.1200272290169282E+01 -0.6650867142082967E+01 0.8897053016152849E+02
# V [m/s] 1 P [kW] 2 T [kN] 3 Cp [-] 4 Ct [-] 5 Pitch Q [Nm] 6 Flap M [kNm] 7 Edge M [kNm] 8 Pitch [deg] 9 Speed [rpm] 10 Tip x [m] 11 Tip y [m] 12 Tip z [m] 13 J_rot [kg*m^2] 14 J_DT [kg*m^2] 15
0.5000000000E+01 0.7970164013E+03 0.3544311249E+03 0.4169257765E+00 0.9270290530E+00 0.9593137616E+04 -0.7285178091E+04 0.4266130258E+03 0.1520000000E+01 0.6000000000E+01 0.1058203520E+00 -0.4570793811E+01 0.8914991938E+02 0.1571481470E+09 0.1608991475E+09
0.6000000000E+01 0.1538219709E+04 0.5028097774E+03 0.4652843408E+00 0.9125465540E+00 0.5381154104E+05 -0.1012311164E+05 0.8194469682E+03 0.4600000000E+00 0.6000000000E+01 0.2331471676E+00 -0.3772022879E+01 0.8918537014E+02 0.1571992308E+09 0.1609502313E+09
0.7000000000E+01 0.2506968250E+04 0.6601011592E+03 0.4772733569E+00 0.8796844048E+00 0.9494301666E+05 -0.1317256657E+05 0.1255759006E+04 0.0000000000E+00 0.6370000000E+01 0.3464089832E+00 -0.2878930752E+01 0.8920978613E+02 0.1572452212E+09 0.1609962217E+09
0.8000000000E+01 0.3761073184E+04 0.8583238617E+03 0.4795985857E+00 0.8756030845E+00 0.1290599401E+06 -0.1709642729E+05 0.1646678063E+04 0.0000000000E+00 0.7280000000E+01 0.4680573570E+00 -0.1686889666E+01 0.8921707881E+02 0.1572877418E+09 0.1610387423E+09
0.9000000000E+01 0.5381725790E+04 0.1080307716E+04 0.4822398939E+00 0.8712274625E+00 0.1701250704E+06 -0.2147771394E+05 0.2092028650E+04 0.0000000000E+00 0.8190000000E+01 0.6022479265E+00 -0.4072028243E+00 0.8919234085E+02 0.1573090566E+09 0.1610600571E+09
0.1000000000E+02 0.7416703191E+04 0.1324850630E+04 0.4851497784E+00 0.8666262802E+00 0.2187106354E+06 -0.2629113938E+05 0.2591674158E+04 0.0000000000E+00 0.9100000000E+01 0.7474438528E+00 0.9381776879E+00 0.8913007496E+02 0.1573041843E+09 0.1610551848E+09
0.1100000000E+02 0.9907489855E+04 0.1546833046E+04 0.4877563114E+00 0.8376746793E+00 0.2812500156E+06 -0.3054220181E+05 0.3279348532E+04 0.0000000000E+00 0.9600000000E+01 0.8928368271E+00 0.2040468370E+01 0.8905155874E+02 0.1572781985E+09 0.1610291990E+09
0.1200000000E+02 0.1061009458E+05 0.1249708664E+04 0.4011761897E+00 0.5670298486E+00 0.2254602867E+06 -0.2399070932E+05 0.3517854363E+04 0.4100000000E+01 0.9600000000E+01 0.8502202733E+00 -0.4907227681E-01 0.8918102493E+02 0.1573179472E+09 0.1610689477E+09
0.1300000000E+02 0.1061210798E+05 0.1077414875E+04 0.3153521956E+00 0.4162176744E+00 0.1829527984E+06 -0.2005522253E+05 0.3521845895E+04 0.6690000000E+01 0.9600000000E+01 0.7105233446E+00 -0.1322709454E+01 0.8921669091E+02 0.1573104544E+09 0.1610614549E+09
0.1400000000E+02 0.1061408289E+05 0.9708623175E+03 0.2525114546E+00 0.3233585057E+00 0.1559026021E+06 -0.1748248961E+05 0.3524751234E+04 0.8620000000E+01 0.9600000000E+01 0.5668062119E+00 -0.2186351338E+01 0.8922198680E+02 0.1572919434E+09 0.1610429439E+09
0.1500000000E+02 0.1061339581E+05 0.8933094446E+03 0.2053234529E+00 0.2592252984E+00 0.1363988108E+06 -0.1551096512E+05 0.3526307335E+04 0.1026000000E+02 0.9600000000E+01 0.4200504649E+00 -0.2868223450E+01 0.8921506776E+02 0.1572697184E+09 0.1610207189E+09
0.1600000000E+02 0.1060168606E+05 0.8319703358E+03 0.1690492188E+00 0.2122589701E+00 0.1211353723E+06 -0.1387757376E+05 0.3523953686E+04 0.1174000000E+02 0.9600000000E+01 0.2690498697E+00 -0.3446369068E+01 0.8920125147E+02 0.1572456021E+09 0.1609966026E+09
0.1700000000E+02 0.1060199870E+05 0.7833490971E+03 0.1409997563E+00 0.1771066564E+00 0.1097315539E+06 -0.1250605460E+05 0.3525398165E+04 0.1310000000E+02 0.9600000000E+01 0.1163116774E+00 -0.3946330182E+01 0.8918317960E+02 0.1572208982E+09 0.1609718987E+09
0.1800000000E+02 0.1059699385E+05 0.7428200279E+03 0.1187819243E+00 0.1498731325E+00 0.1008861380E+06 -0.1130036820E+05 0.3524955829E+04 0.1438000000E+02 0.9600000000E+01 -0.4031146691E-01 -0.4394688733E+01 0.8916191174E+02 0.1571956213E+09 0.1609466218E+09
0.1900000000E+02 0.1061301360E+05 0.7098108720E+03 0.1012013928E+00 0.1286009026E+00 0.9464589093E+05 -0.1025233215E+05 0.3531373380E+04 0.1559000000E+02 0.9600000000E+01 -0.1970142882E+00 -0.4793352129E+01 0.8913877564E+02 0.1571706451E+09 0.1609216456E+09
0.2000000000E+02 0.1060032842E+05 0.6800559869E+03 0.8671236208E-01 0.1112593094E+00 0.8942555227E+05 -0.9275572778E+04 0.3528218038E+04 0.1676000000E+02 0.9600000000E+01 -0.3599092827E+00 -0.5166607540E+01 0.8911332074E+02 0.1571450248E+09 0.1608960253E+09
0.2100000000E+02 0.1061037601E+05 0.6555310158E+03 0.7501947555E-01 0.9733203156E-01 0.8621293330E+05 -0.8410161825E+04 0.3532528121E+04 0.1788000000E+02 0.9600000000E+01 -0.5224848197E+00 -0.5504327052E+01 0.8908692639E+02 0.1571200057E+09 0.1608710062E+09
0.2200000000E+02 0.1060089637E+05 0.6333157929E+03 0.6522851242E-01 0.8573099891E-01 0.8387051357E+05 -0.7596008959E+04 0.3530327481E+04 0.1897000000E+02 0.9600000000E+01 -0.6898353229E+00 -0.5822876284E+01 0.8905893950E+02 0.1570946936E+09 0.1608456941E+09
0.2300000000E+02 0.1058585219E+05 0.6136002561E+03 0.5703937371E-01 0.7604353387E-01 0.8251045411E+05 -0.6836951008E+04 0.3526252354E+04 0.2003000000E+02 0.9600000000E+01 -0.8600819689E+00 -0.6121248953E+01 0.8902982728E+02 0.1570694299E+09 0.1608204304E+09
0.2400000000E+02 0.1061174995E+05 0.5981779253E+03 0.5035601369E-01 0.6812491272E-01 0.8292118103E+05 -0.6168793380E+04 0.3535706326E+04 0.2105000000E+02 0.9600000000E+01 -0.1027596898E+01 -0.6391318830E+01 0.8900082562E+02 0.1570453133E+09 0.1607963138E+09
0.2500000000E+02 0.1061138296E+05 0.5837890084E+03 0.4457848443E-01 0.6131252946E-01 0.8379087418E+05 -0.5525389373E+04 0.3536426299E+04 0.2205000000E+02 0.9600000000E+01 -0.1200315943E+01 -0.6650924960E+01 0.8897045731E+02 0.1570208937E+09 0.1607718942E+09
# CP grad: CP grad: CP grad: CT grad: CT grad: CT grad: FW grad: FW grad: FW grad: FW grad: FW grad: FW grad:
# V [m/s] 1 P [kW] 2 T [kN] 3 Cp [-] 4 Ct [-] 5 Pitch Q [Nm] 6 Flap M [kNm] 7 Edge M [kNm] 8 Pitch [deg] 9 Speed [rpm] 10 Tip x [m] 11 Tip y [m] 12 Tip z [m] 13 J_rot [kg*m^2] 14 J_DT [kg*m^2] 15 dQ/dt [kNm/deg] 16 dQ/dV [kNm*s/m] 17 dQ/dO [kNm/rpm] 18 dT/dt [kN/deg] 19 dT/dV [kN*s/m] 20 dT/dO [kN/rpm] 21 dQ/dt [kNm/deg] 22 dQ/dV [kNm*s/m] 23 dQ/dO [kNm/rpm] 24 dT/dt [kN/deg] 25 dT/dV [kN*s/m] 26 dT/dO [kN/rpm] 27
0.5000000000000000E+01 0.7970169791578448E+03 0.3544331376231053E+03 0.4169253899720817E+00 0.9270327859180790E+00 0.9594040831429129E+04 -0.7285219033288880E+04 0.4266133175794696E+03 0.1520000000000000E+01 0.6000000000000000E+01 0.1058287730378880E+00 -0.4570720974965974E+01 0.8914999301491066E+02 0.1571486810714816E+09 0.1608996815674816E+09 0.5831251033395528E-01 0.1000206679638058E+04 -0.4008084840742802E+03 -0.3704847187110397E+02 0.1050165387044597E+03 0.2817433982911782E+02 -0.3344468879410391E+03 0.1152969629942774E+04 -0.1781608543546648E+03 -0.7148177238243700E+02 0.1229861785878016E+03 0.5240023830288010E+02
0.6000000000000000E+01 0.1538224912236643E+04 0.5028078552591091E+03 0.4652851458655674E+00 0.9125415578002156E+00 0.5381139449224927E+05 -0.1012310607930005E+05 0.8194497447377861E+03 0.4600000000000001E+00 0.6000000000000000E+01 0.2331541124624440E+00 -0.3771950370961326E+01 0.8918544380531593E+02 0.1571997657263904E+09 0.1609507662223904E+09 -0.6575852065421641E+00 0.1360685292240942E+04 -0.5295335763450456E+03 -0.3888956373630987E+02 0.1088933025432413E+03 0.5638758735773794E+02 -0.3815679435367393E+03 0.1452539116039467E+04 -0.8784683125326731E+02 -0.6879271504670193E+02 0.1181070865350491E+03 0.9247387169123199E+02
0.7000000000000000E+01 0.2506971009248905E+04 0.6601028022124265E+03 0.4772730920662255E+00 0.8796851380883184E+00 0.9494399539690152E+05 -0.1317261132118186E+05 0.1255760383606364E+04 0.0000000000000000E+00 0.6370000000000000E+01 0.3464163472096511E+00 -0.2878853576663426E+01 0.8920985994276425E+02 0.1572457575952859E+09 0.1609967580912859E+09 -0.2528643779328838E+02 0.1686801881376142E+04 -0.6527564920206764E+03 -0.4557642766260658E+02 0.1179995690734789E+03 0.7474061634029611E+02 -0.4676043759302305E+03 0.1735485246954009E+04 -0.3451896667135957E+02 -0.7536369924122208E+02 0.1219283766076678E+03 0.1201105853489163E+03
0.8000000000000000E+01 0.3761077610689366E+04 0.8583261420148028E+03 0.4795983570259911E+00 0.8756039627213232E+00 0.1290616013640559E+06 -0.1709648904765180E+05 0.1646679988112126E+04 0.0000000000000000E+00 0.7279999999999999E+01 0.4680668290015476E+00 -0.1686808663189807E+01 0.8921715253544735E+02 0.1572882794039066E+09 0.1610392798999066E+09 -0.4130807159359752E+02 0.1928614031344112E+04 -0.7364728833652474E+03 -0.5954008034563576E+02 0.1346345472969307E+03 0.8316171148132591E+02 -0.6175747894642805E+03 0.1986618571627411E+04 -0.3961041970741662E+02 -0.9855609798135120E+02 0.1395558940783116E+03 0.1358061967881769E+03
0.9000000000000000E+01 0.5381732315696529E+04 0.1080310780888448E+04 0.4822396840120912E+00 0.8712284988272722E+00 0.1701276996611903E+06 -0.2147779639777565E+05 0.2092031161012877E+04 0.0000000000000000E+00 0.8190000000000000E+01 0.6022597199520462E+00 -0.4071172529039249E+00 0.8919241427217456E+02 0.1573095953819258E+09 0.1610605958779258E+09 -0.6392415131954662E+02 0.2168770425430150E+04 -0.8173493020109321E+03 -0.7519310583714535E+02 0.1508683659965266E+03 0.9080171939772322E+02 -0.7899152995852835E+03 0.2237579877877443E+04 -0.4515854932658876E+02 -0.1247500970940785E+03 0.1571243910611799E+03 0.1508789278177841E+03
0.1000000000000000E+02 0.7416712472523705E+04 0.1324854638420147E+04 0.4851495915269021E+00 0.8666274835963063E+00 0.2187145886774265E+06 -0.2629124662906981E+05 0.2591677355693617E+04 0.0000000000000000E+00 0.9100000000000000E+01 0.7474581721392320E+00 0.9382686044027334E+00 0.8913014778298016E+02 0.1573047241201547E+09 0.1610557246161547E+09 -0.9428810573004743E+02 0.2406215418885532E+04 -0.8956636175853572E+03 -0.9236489094802178E+02 0.1665244149667083E+03 0.9767382283053594E+02 -0.9841216634432151E+03 0.2487347510092050E+04 -0.5114830177977089E+02 -0.1537989065684419E+03 0.1745487952355842E+03 0.1652714219466671E+03
0.1100000000000000E+02 0.9907484978459799E+04 0.1546838035017184E+04 0.4877552803179612E+00 0.8376760228436287E+00 0.2812549250549605E+06 -0.3054233250592176E+05 0.3279346840966920E+04 0.0000000000000000E+00 0.9599999999999998E+01 0.8928524405421021E+00 0.2040564708128432E+01 0.8905163079868974E+02 0.1572787391741392E+09 0.1610297396701392E+09 -0.1632699567734226E+03 0.2672915505748699E+04 -0.9742706282546466E+03 -0.1037200892704274E+03 0.1738807143304963E+03 0.1094599534884759E+03 -0.1164980604679687E+04 0.2770708726685543E+04 -0.4106108112561758E+02 -0.1704169938609436E+03 0.1842330438623933E+03 0.1806326291750896E+03
0.1200000000000000E+02 0.1061014657108758E+05 0.1249721988766591E+04 0.4011774939027885E+00 0.5670349590398148E+00 0.2254674005676494E+06 -0.2399091342085267E+05 0.3517871550943046E+04 0.4100000000000001E+01 0.9599999999999998E+01 0.8502430701369529E+00 -0.4898551655049134E-01 0.8918109827975073E+02 0.1573184863697737E+09 0.1610694868657737E+09 -0.7784337033826857E+03 0.2546468588076439E+04 -0.1023720042029936E+04 -0.1237896067153187E+03 0.1644370489163406E+03 0.4288966852953075E+02 -0.1665745774681842E+04 0.2944636332917164E+04 -0.7246807321021743E+03 -0.1792897534881736E+03 0.1893269434325972E+03 0.7145399763822869E+02
0.1300000000000000E+02 0.1061208985668525E+05 0.1077410211782461E+04 0.3153511352272069E+00 0.4162151841656613E+00 0.1829537578781671E+06 -0.2005519301411685E+05 0.3521839899182678E+04 0.6690000000000001E+01 0.9599999999999998E+01 0.7105471690129758E+00 -0.1322639286687157E+01 0.8921676454114522E+02 0.1573109916241897E+09 0.1610619921201897E+09 -0.1186339036115162E+04 0.2566034130013184E+04 -0.1365347294515502E+04 -0.1341346012752836E+03 0.1603462706088321E+03 -0.5265045893191127E+01 -0.2013571619409162E+04 0.3087262412014407E+04 -0.1375099117387270E+04 -0.1845597632460034E+03 0.1916767051682129E+03 0.1991393679360004E+01
0.1400000000000000E+02 0.1061401889940045E+05 0.9708527455375043E+03 0.2525095152315331E+00 0.3233547837483274E+00 0.1559014425969238E+06 -0.1748238186619036E+05 0.3524730063354117E+04 0.8620000000000001E+01 0.9599999999999998E+01 0.5668305192378178E+00 -0.2186290411632646E+01 0.8922206030638033E+02 0.1572924792137012E+09 0.1610434797097012E+09 -0.1523547952554889E+04 0.2671159210619870E+04 -0.1833184228602433E+04 -0.1420876767236560E+03 0.1600668229275855E+03 -0.4513250914672739E+02 -0.2290711378766428E+04 0.3228165966333190E+04 -0.1980554172348935E+04 -0.1861831817900721E+03 0.1913946251390654E+03 -0.4605327364389421E+02
0.1500000000000000E+02 0.1061329710264457E+05 0.8932979867475455E+03 0.2053212055070568E+00 0.2592215469078845E+00 0.1363963164848901E+06 -0.1551083229602619E+05 0.3526274664368028E+04 0.1026000000000000E+02 0.9599999999999998E+01 0.4200757268826584E+00 -0.2868166913940989E+01 0.8921514104676571E+02 0.1572702531419329E+09 0.1610212536379329E+09 -0.1799083240054842E+04 0.2779470236572838E+04 -0.2322961288273149E+04 -0.1472603270885045E+03 0.1597141612190730E+03 -0.7859163133860916E+02 -0.2535410606543733E+04 0.3364833626079042E+04 -0.2579346240343986E+04 -0.1876735466315165E+03 0.1910954236289868E+03 -0.8583368343426189E+02
0.1600000000000000E+02 0.1060155692128170E+05 0.8319576204597553E+03 0.1690468823274193E+00 0.2122553779774559E+00 0.1211316053618953E+06 -0.1387742351383117E+05 0.3523910934267796E+04 0.1174000000000000E+02 0.9599999999999998E+01 0.2690761528524743E+00 -0.3446315184459102E+01 0.8920132452776888E+02 0.1572461359157421E+09 0.1609971364117420E+09 -0.2053559968445305E+04 0.2897055949448059E+04 -0.2854945362786893E+04 -0.1512013341072509E+03 0.1594501559108274E+03 -0.1088556312566996E+03 -0.2757070978921717E+04 0.3477804202007061E+04 -0.3161027551102246E+04 -0.1876161734298662E+03 0.1883412079472982E+03 -0.1176167054628406E+03
0.1700000000000000E+02 0.1060183963499188E+05 0.7833358202115986E+03 0.1409974106264970E+00 0.1771033654307255E+00 0.1097254204332629E+06 -0.1250589079254378E+05 0.3525345535114981E+04 0.1310000000000000E+02 0.9599999999999998E+01 0.1163384787611592E+00 -0.3946279752224537E+01 0.8918325237589035E+02 0.1572214311738325E+09 0.1609724316698325E+09 -0.2312718941165063E+04 0.3040570343953353E+04 -0.3454901155758230E+04 -0.1554536047068252E+03 0.1603861397195578E+03 -0.1384300948287989E+03 -0.2991458505575221E+04 0.3620111503858904E+04 -0.3797217105058340E+04 -0.1886179730251877E+03 0.1874261191595918E+03 -0.1480814315425732E+03
0.1800000000000000E+02 0.1059682774409639E+05 0.7428073022970189E+03 0.1187798691986428E+00 0.1498703210122704E+00 0.1008807108347629E+06 -0.1130020855305979E+05 0.3524900845735160E+04 0.1438000000000000E+02 0.9599999999999998E+01 -0.4028360451736025E-01 -0.4394639668368468E+01 0.8916198430045489E+02 0.1571961535432153E+09 0.1609471540392153E+09 -0.2550870636231400E+04 0.3174751915609408E+04 -0.4066267413519080E+04 -0.1587224168720899E+03 0.1607329045824980E+03 -0.1652858350820199E+03 -0.3214120554485696E+04 0.3753682804651501E+04 -0.4442471599628647E+04 -0.1894794023616749E+03 0.1862309776543432E+03 -0.1757299242336659E+03
0.1900000000000000E+02 0.1061289335441474E+05 0.7098016173736669E+03 0.1012000817235990E+00 0.1285990169176314E+00 0.9464525489133733E+05 -0.1025221596297727E+05 0.3531333518711257E+04 0.1559000000000000E+02 0.9599999999999998E+01 -0.1969844320530114E+00 -0.4793302156631236E+01 0.8913884812140398E+02 0.1571711770000217E+09 0.1609221774960217E+09 -0.2773501417338688E+04 0.3299479004516611E+04 -0.4681385873644156E+04 -0.1611851718695422E+03 0.1604122735938942E+03 -0.1891630830963916E+03 -0.3429636394406001E+04 0.3880849995175178E+04 -0.5094820770405060E+04 -0.1902019266380649E+03 0.1847853633739625E+03 -0.2007716616750795E+03
0.2000000000000000E+02 0.1060030266827369E+05 0.6800543290753695E+03 0.8671201044635370E-01 0.1112588572840720E+00 0.8942778021483211E+05 -0.9275547526844854E+04 0.3528209495967019E+04 0.1676000000000000E+02 0.9599999999999998E+01 -0.3598763549410885E+00 -0.5166554397385442E+01 0.8911339331284624E+02 0.1571455566375209E+09 0.1608965571335209E+09 -0.2988780484741401E+04 0.3416674769421788E+04 -0.5314361651603244E+04 -0.1631787816604811E+03 0.1596135846526839E+03 -0.2114659597343998E+03 -0.3644951268055576E+04 0.4005546882406962E+04 -0.5771755782803293E+04 -0.1909054676388775E+03 0.1832493568852528E+03 -0.2244389960354568E+03
0.2100000000000000E+02 0.1061048922554726E+05 0.6555390117784526E+03 0.7502015372940181E-01 0.9733306017006643E-01 0.8621809447266402E+05 -0.8410251218309510E+04 0.3532565660171932E+04 0.1788000000000000E+02 0.9599999999999998E+01 -0.5224480720785591E+00 -0.5504269565763194E+01 0.8908699920362002E+02 0.1571205377751834E+09 0.1608715382711833E+09 -0.3200183591920711E+04 0.3534074745060522E+04 -0.5966469827391012E+04 -0.1650632068236866E+03 0.1589705001507711E+03 -0.2325897087039496E+03 -0.3859800584117250E+04 0.4129465526065580E+04 -0.6464694908382153E+04 -0.1917482748815677E+03 0.1818593841144073E+03 -0.2467357332832948E+03
0.2200000000000000E+02 0.1060110308578692E+05 0.6333292287585914E+03 0.6522967791689528E-01 0.8573267781714662E-01 0.8387755890787989E+05 -0.7596163931537479E+04 0.3530396023248682E+04 0.1897000000000000E+02 0.9599999999999998E+01 -0.6897955512604874E+00 -0.5822816349005327E+01 0.8905901247150452E+02 0.1570952257186909E+09 0.1608462262146908E+09 -0.3409275004805229E+04 0.3650241416574474E+04 -0.6643221468439130E+04 -0.1668967288111609E+03 0.1584121301822236E+03 -0.2531798565346049E+03 -0.4076174042601909E+04 0.4252786083709098E+04 -0.7183420190939370E+04 -0.1927371928567228E+03 0.1805938525498019E+03 -0.2683592198012838E+03
0.2300000000000000E+02 0.1058612079687397E+05 0.6136154737425885E+03 0.5704072800083193E-01 0.7604529573659602E-01 0.8251906317545590E+05 -0.6837127934996724E+04 0.3526341412461991E+04 0.2003000000000000E+02 0.9599999999999998E+01 -0.8600401258454597E+00 -0.6121188446982691E+01 0.8902990031045036E+02 0.1570699616978906E+09 0.1608209621938906E+09 -0.3617073394121032E+04 0.3764141021789480E+04 -0.7338829986478593E+04 -0.1686131602138874E+03 0.1577470247341442E+03 -0.2729006801358930E+03 -0.4295561693166425E+04 0.4376752935387794E+04 -0.7928033716250638E+04 -0.1938234758979231E+03 0.1793832212528510E+03 -0.2891956592399760E+03
0.2400000000000000E+02 0.1061205678332627E+05 0.5981919524558181E+03 0.5035738769763526E-01 0.6812639928143560E-01 0.8293079727758301E+05 -0.6168957697994681E+04 0.3535808055464818E+04 0.2105000000000000E+02 0.9599999999999998E+01 -0.1027553825139650E+01 -0.6391259215359025E+01 0.8900089859581524E+02 0.1570458446168525E+09 0.1607968451128525E+09 -0.3832475291937131E+04 0.3881501541414112E+04 -0.8062719511987725E+04 -0.1702830623861665E+03 0.1570170033335488E+03 -0.2914412601070531E+03 -0.4524554580752829E+04 0.4503502828910561E+04 -0.8696161300433720E+04 -0.1948804644110930E+03 0.1780968464265360E+03 -0.3085913581709253E+03
0.2500000000000000E+02 0.1061168880733778E+05 0.5837999848031249E+03 0.4457969688339745E-01 0.6131358268124843E-01 0.8380042886389370E+05 -0.5525518996295825E+04 0.3536527702270825E+04 0.2205000000000000E+02 0.9599999999999998E+01 -0.1200272290169282E+01 -0.6650867142082967E+01 0.8897053016152849E+02 0.1570214244053549E+09 0.1607724249013548E+09 -0.4049791545132425E+04 0.3997403343676068E+04 -0.8807753434411381E+04 -0.1718856848425099E+03 0.1562926259428839E+03 -0.3092850643221685E+03 -0.4758220938503094E+04 0.4628101476046289E+04 -0.9490578775769865E+04 -0.1959931077029209E+03 0.1768109719123891E+03 -0.3274385175590618E+03
......@@ -109,7 +109,18 @@ class Tests(unittest.TestCase):
df_data = res.load_ind(fname)
data = np.loadtxt(fname)
np.testing.assert_almost_equal(data, df_data.values)
print(df_data.columns)
def test_pwr_file(self):
fnames = ['dtu10mw_nofull.pwr',
'dtu10mw_nogradient.pwr',
'dtu10mw_nogradient_v2.pwr',
'dtu10mw_v1.pwr',]
for fname in fnames:
fname = pjoin(pdirname(__file__), 'data', fname)
res = results()
df_data, units = res.load_pwr_df(fname)
data = np.loadtxt(fname)
np.testing.assert_almost_equal(data, df_data.values)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment