Commit 29ffc61e authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

Transition. Erf fitting. first/last datetime now optional

parent 4b651244
Pipeline #152950 passed with stages
in 1 minute and 4 seconds
......@@ -221,14 +221,18 @@ def get_transition_duration_gauss_sigma(df: pd.DataFrame,
def get_transition_duration_erf(df: pd.DataFrame,
first_datetime: datetime.datetime,
last_datetime: datetime.datetime,
first_datetime: datetime.datetime = None,
last_datetime: datetime.datetime = None,
col_value_name: str = "value",
debug_plot: bool = False) -> float:
# Restrict the data to the transition area
df = df[(df.index >= first_datetime) & (df.index <= last_datetime)]
df = df.copy()
# Restrict the data to the transition area
if first_datetime is not None:
df = df[df.index >= first_datetime]
if last_datetime is not None:
df = df[df.index <= last_datetime]
def erfunc(x, C1, C2, z0, sigma):
return (C1/2) * (1 + erf((x - z0) / (sigma * np.sqrt(2)))) + C2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment