Function manual of meas
pylib_sakata.meas
MeasData
class pylib_sakata.meas.MeasData(list, value, time, dt)
- Parameters:
- list: array of data list (str)
- value: array of data value
- time: 1-D array time data [s]
- dt: sampling time of the time response data
getcsvdata
pylib_sakata.meas.getcsvdata(filePath)
This function is for getting measurement data from a csv file.
- Parameters:
- filePath: csv file path of measurement file
- Returns:
- instance of MeasData class
Examples
measdata = meas.getcsvdata('data\001-inject.csv')gettxtdata
pylib_sakata.meas.gettxtdata(filePath)
This function is for getting measurement data from a txt file.
- Parameters:
- filePath: txt file path of measurement file
- Returns:
- instance of MeasData class
Examples
measdata = meas.gettxtdata('data\001-inject.txt')getmatdata
pylib_sakata.meas.getmatdata(filePath)
This function is for getting measurement data from a mat file.
- Parameters:
- filePath: mat file path of measurement file
- Returns:
- instance of MeasData class
Examples
measdata = meas.getmatdata('data\001-inject.mat')getdata
pylib_sakata.meas.getdata(filePath)
This function is for getting measurement data from a file.
- Parameters:
- filePath: file path of measurement file (.csv, .txt, and .mat are supported.)
- Returns:
- instance of MeasData class
Examples
measdata = meas.getdata('data\001-inject.csv')measdata = meas.getdata('data\001-inject.txt')measdata = meas.getdata('data\001-inject.mat')getdataindex
pylib_sakata.meas.getdataindex(measdata, dataName)
- Parameters:
- measdata: instance of MeasData class
- dataName: data name
- Returns:
- index: index of dataName
Examples
index = meas.getdataindex(measdata, 'ServoOut')measdata2frd
pylib_sakata.meas.measdata2frd(filePath, inputName, outputName, flagName, freq, inputGain=1.0, outputGain=1.0, windivnum=4, overlap=0.5)
This function is for system identification from input and output time response data of measurement file.
- Parameters:
- filePath: file path of measurement file (.csv, .txt, and .mat are supported.)
- inputName: input data name in the measurement file
- outputName: output data name in the measurement file
- flagName: flag data name in the measurement file
- freq: 1-D array frequency data [Hz]
- inputGain: inputdata gain (Optional), Default: 1.0, unit of input can be fixed by this parameter.
- outputGain: outputdata gain (Optional), Default: 1.0, unit of output can be fixed by this parameter.
- dt: sampling time of the time response data
- windivnum: number of windows to divide the time response data
- overlap: overlap ratio divided time response data (0 <= overlap < 1)
- Returns:
- freqresp: instance of FreqResp class
- coh: 1-D array coherence data
Examples
import numpy as np
freq = np.logspace(np.log10(1.), np.log10(1000.), 10000, base=10)
freqresp, coh = measdata2frd('data\001-inject.csv', 'ServoOut', 'PosErrUm', 'FlagNoise', freq, 1., 1.e-6)