Auswertung Schersteifigkeit Labor Hart ergänzt
This commit is contained in:
@@ -133,6 +133,7 @@ class CITTBase(DataSineLoad):
|
||||
for idxcol, col in enumerate(self.columns_analyse):
|
||||
|
||||
if not col in data.columns: continue
|
||||
|
||||
y = data[col].values
|
||||
|
||||
res = fit_cos(x, y, freq=freq)
|
||||
@@ -744,3 +745,105 @@ class CITT_LaborHart(CITTBase):
|
||||
# log infos
|
||||
self._logger.info(self.metadata)
|
||||
self._logger.info(self.data.head())
|
||||
|
||||
|
||||
class CITT_BAGKoeln(CITTBase):
|
||||
|
||||
def _define_units(self):
|
||||
|
||||
self.unit_s = 1.0 #mm
|
||||
self.unit_F = 1.0 #N
|
||||
self.unit_t = 1. / 1000.0 #s
|
||||
|
||||
def update_parameter(self):
|
||||
|
||||
self.meta_names_of_parameter = {
|
||||
'sigma': ['Oberspannung'],
|
||||
'T': ['Solltemperatur'],
|
||||
't': ['TIME'],
|
||||
'speciment_diameter': ['Probendurchmesser'],
|
||||
'speciment_height': ['Probenhöhe'],
|
||||
} #list of names
|
||||
|
||||
self.data_column_names = {
|
||||
'time': ['TIME'],
|
||||
'f': ['FREQUENZ'],
|
||||
'F': ['Load'],
|
||||
's_hor_1': ['SENSOR 4'],
|
||||
's_hor_2': ['SENSOR Extension'],
|
||||
's_piston': ['Position'],
|
||||
'N': ['Impulsnummer'],
|
||||
}
|
||||
|
||||
def _process_data(self):
|
||||
|
||||
meta = {}
|
||||
|
||||
splitsign = ':;'
|
||||
encoding = 'latin-1'
|
||||
skiprows = 14
|
||||
|
||||
self.data.seek(0)
|
||||
f = self.data.readlines()
|
||||
|
||||
count = 0
|
||||
|
||||
for line in f:
|
||||
count += 1
|
||||
|
||||
#remove whitespace
|
||||
line = line.decode(encoding)
|
||||
linesplit = line.strip()
|
||||
linesplit = linesplit.split(splitsign)
|
||||
|
||||
if len(linesplit) == 2:
|
||||
|
||||
meta[linesplit[0]] = linesplit[1]
|
||||
|
||||
if count >= skiprows:
|
||||
break
|
||||
|
||||
# data
|
||||
self.data.seek(0)
|
||||
|
||||
data = pd.read_csv(self.data,
|
||||
encoding=encoding,
|
||||
skiprows=skiprows,
|
||||
decimal=',',
|
||||
sep=';')
|
||||
|
||||
## add header to df
|
||||
self.data.seek(0)
|
||||
f = self.data.readlines()
|
||||
count = 0
|
||||
|
||||
for line in f:
|
||||
count += 1
|
||||
|
||||
if count >= skiprows:
|
||||
break
|
||||
|
||||
line = line.decode(encoding)
|
||||
head = line.split(';')
|
||||
data.columns = head
|
||||
|
||||
# FIX: Sigma nicht in Metadaten oder Messdaten enthalten
|
||||
sigma = float(
|
||||
os.path.split(self.filename)[-1].split('MPa')[0].strip().replace(
|
||||
',', '.'))
|
||||
|
||||
meta['sigma'] = sigma
|
||||
|
||||
#clean data
|
||||
data = data.dropna(axis=1)
|
||||
|
||||
#remove whitespace
|
||||
data.columns = [c.strip() for c in data.columns]
|
||||
|
||||
#define in class
|
||||
self.data = data
|
||||
self.metadata.update(meta)
|
||||
|
||||
# log infos
|
||||
self._logger.info(self.metadata)
|
||||
self._logger.info(self.data.head())
|
||||
|
||||
Reference in New Issue
Block a user