Power Module
The power module contains a set of functions to calculate quantities of interest for power production and power quality.
Characteristics
The characteristics submodule calculates power quantities of interest from voltage and current timseries.
Calculates instantaneous frequency of measured voltage 

Calculates DC power from voltage and current 

Calculates magnitude of active AC power from line to neutral voltage and current 
 mhkit.power.characteristics.instantaneous_frequency(um)[source]
Calculates instantaneous frequency of measured voltage
 Parameters
um (pandas Series or DataFrame) – Measured voltage (V) indexed by time
 Returns
frequency (pandas DataFrame) – Frequency of the measured voltage (Hz) indexed by time with signal name columns
 mhkit.power.characteristics.dc_power(voltage, current)[source]
Calculates DC power from voltage and current
 Parameters
voltage (pandas Series or DataFrame) – Measured DC voltage [V] indexed by time
current (pandas Series or DataFrame) – Measured three phase current [A] indexed by time
 Returns
P (pandas DataFrame) – DC power [W] from each channel and gross power indexed by time
 mhkit.power.characteristics.ac_power_three_phase(voltage, current, power_factor, line_to_line=False)[source]
Calculates magnitude of active AC power from line to neutral voltage and current
 Parameters
voltage (pandas DataFrame) – Timeseries of three phase measured voltage [V] indexed by time
current (pandas DataFrame) – Timeseries of three phase measured current [A] indexed by time
power_factor (float) – Power factor for the efficiency of the system
line_to_line (bool) – Set to true if the given voltage measurements are line_to_line
 Returns
P (pandas DataFrame) – Magnitude of active AC power [W] indexed by time with Power column
Quality
The quality submodule functions assess power quality, including harmonics, interharmonics, and distortion. Calculations are based on IEC TS 6260030:2018 ED1 and IEC TS 6100047:2008 ED2.
Calculates the harmonics from time series of voltage or current based on IEC 6100047. 

Calculates the harmonic subgroups based on IEC 6100047 

Calculates the total harmonic current distortion (THC) based on IEC/TS 6260030 

Calculates the interharmonics from the harmonics of current 
 mhkit.power.quality.harmonics(x, freq, grid_freq)[source]
Calculates the harmonics from time series of voltage or current based on IEC 6100047.
 Parameters
x (pandas Series or DataFrame) – Timeseries of voltage [V] or current [A]
freq (float or Int) – Frequency of the timeseries data [Hz]
grid_freq (int) – Value indicating if the power supply is 50 or 60 Hz. Options = 50 or 60
 Returns
harmonics (pandas DataFrame) – Amplitude of the timeseries data harmonics indexed by the harmonic frequency with signal name columns
 mhkit.power.quality.harmonic_subgroups(harmonics, grid_freq)[source]
Calculates the harmonic subgroups based on IEC 6100047
 Parameters
harmonics (pandas Series or DataFrame) – Harmonic amplitude indexed by the harmonic frequency
grid_freq (int) – Value indicating if the power supply is 50 or 60 Hz. Options = 50 or 60
 Returns
harmonic_subgroups (pandas DataFrame) – Harmonic subgroups indexed by harmonic frequency with signal name columns
 mhkit.power.quality.total_harmonic_current_distortion(harmonics_subgroup, rated_current)[source]
Calculates the total harmonic current distortion (THC) based on IEC/TS 6260030
 Parameters
harmonics_subgroup (pandas DataFrame or Series) – Subgrouped current harmonics indexed by harmonic frequency
rated_current (float) – Rated current of the energy device in Amps
 Returns
THCD (pd.DataFrame) – Total harmonic current distortion indexed by signal name with THCD column
 mhkit.power.quality.interharmonics(harmonics, grid_freq)[source]
Calculates the interharmonics from the harmonics of current
 Parameters
harmonics (pandas Series or DataFrame) – Harmonic amplitude indexed by the harmonic frequency
grid_freq (int) – Value indicating if the power supply is 50 or 60 Hz. Options = 50 or 60
 Returns
interharmonics (pandas DataFrame) – Interharmonics groups