Commit 1dec8521 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

Flow Processor. Compute arrival times for conductivity probes

parent b329b988
Pipeline #116407 passed with stages
in 6 minutes and 25 seconds
......@@ -282,6 +282,7 @@ def get_arrival_df(encoder_df: pd.DataFrame,
pump_df: pd.DataFrame,
volumes_dict: dict,
keep_intermediate: bool = False,
with_conduct: bool = True,
parallel: bool = True,
force_update: bool = False,
dataset: DatasetReader = None) -> pd.DataFrame:
......@@ -297,6 +298,8 @@ def get_arrival_df(encoder_df: pd.DataFrame,
Tubing volumes, as obtained with :func:`get_tubing_volume_dict` function.
keep_intermediate: bool, default: False
If `True` keep arrival datetime at intermediate position: debubbler, T1 and T2.
with_conduct: bool, default: True
If `True`, return also arrival datetimes at conductivity probes.
parallel: bool, default: True
If `True` compute arrival datetime in parallel. This speeds up the process but can mess up the debugger.
force_update: bool, default: False
......@@ -325,17 +328,37 @@ def get_arrival_df(encoder_df: pd.DataFrame,
arrival_df = arrival_df.drop(columns="speed")
arrival_df["melt"] = arrival_df.index
# Melting base -> to T1
# Melting base -> T1
arrival_df["debubbler"] = get_datetime_out(arrival_df["melt"], pump_df["com"],
volumes_dict["melt_debub"], parallel=parallel)
arrival_df["T1"] = get_datetime_out(arrival_df["debubbler"], pump_df["colpic"],
volumes_dict["debub_T1"], parallel=parallel)
# To Collector
# Melting base -> C1
arrival_df["C1"] = get_datetime_out(arrival_df["melt"], pump_df["com"],
volumes_dict["melt_C1"], parallel=parallel)
# T1 -> C2
arrival_df["C2"] = get_datetime_out(arrival_df["T1"], pump_df["col"], volumes_dict["T1_C2"],
parallel=parallel)
# C2 -> C4
arrival_df["C4"] = get_datetime_out(arrival_df["C2"], pump_df["col"], volumes_dict["C2_C4"],
parallel=parallel)
# T1 -> Collector
arrival_df["needle"] = get_datetime_out(arrival_df["T1"], pump_df["col"], volumes_dict["T1_needle"],
parallel=parallel)
# To Picarro
# T1 -> C3
arrival_df["C3"] = get_datetime_out(arrival_df["T1"], pump_df["pic"], volumes_dict["T1_C3"],
parallel=parallel)
# C3 -> C5
arrival_df["C5"] = get_datetime_out(arrival_df["C3"], pump_df["pic"], volumes_dict["C3_C5"],
parallel=parallel)
# T1 -> Picarro
arrival_df["T2"] = get_datetime_out(arrival_df["T1"], pump_df["pic"], volumes_dict["T1_T2"],
parallel=parallel)
arrival_df["picarro"] = arrival_df["T2"] + pd.Timedelta(seconds=volumes_dict["T2_pic_sec"])
......@@ -348,6 +371,8 @@ def get_arrival_df(encoder_df: pd.DataFrame,
if not keep_intermediate:
arrival_df = arrival_df.drop(columns=["debubbler", "T1", "T2"])
if not with_conduct:
arrival_df = arrival_df.drop(columns=["C1", "C2", "C3", "C4", "C5"])
return arrival_df
......
datetime,melt_debub,debub_T1,T1_needle,T1_T2,T2_pic_sec
2019-12-01,1,2,3,4,100
2021-04-01,3.5,0.43,1.8,0.35,50
2020-12-01,5,6,7,8,200
\ No newline at end of file
datetime,melt_debub,melt_C1,debub_T1,T1_needle,T1_T2,T2_pic_sec,T1_C2,C2_C4,T1_C3,C3_C5
2019-12-01,1,2,3,4,5,6,7,8,9,10
2020-12-01,3.5,3.457,0.43,1.8,0.35,50,0.17,0.7,0.05,0.154
2020-12-01,11,12,13,14,15,16,17,18,18,19
\ No newline at end of file
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