Skip to content
Snippets Groups Projects
Commit 33bf5237 authored by Markus Mirz's avatar Markus Mirz
Browse files

add former dpsim funcs to timeseries

parent 8cb14c3d
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,8 @@ class TimeSeries:
def phasor(self, name):
"""Calculate phasor of complex time series and return dict with abs and phase.
"""
ts_abs = ts.abs(ts.name + '_abs')
ts_phase = ts.phase(ts.name + '_phase')
ts_abs = self.abs(self.name + '_abs')
ts_phase = self.phase(self.name + '_phase')
ts_phasor = {}
ts_phasor['abs'] = ts_abs
ts_phasor['phase'] = ts_phase
......@@ -168,4 +168,16 @@ class TimeSeries:
"""
ts_complex = np.vectorize(complex)(ts_real.values, ts_imag.values)
ts_abs = TimeSeries(name, ts_real.time, np.absolute(ts_complex))
return ts_abs
\ No newline at end of file
return ts_abs
@staticmethod
def phasors(timeseries_list):
"""Calculate voltage phasors of all nodes
:param timeseries_list: timeseries list with real and imaginary parts
:return: timeseries list with abs and phase
"""
phasor_list = {}
for name, ts in timeseries_list.items():
phasor_list[name] = ts.phasor(name)
return phasor_list
\ No newline at end of file
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