Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
JOSSOUD Olivier
CFA Tools
Commits
1dec8521
Commit
1dec8521
authored
Apr 27, 2021
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
7 deletions
+32
-7
cfatools/processor/flow.py
cfatools/processor/flow.py
+28
-3
cfatools/tests/test_processor/tubing_volumes.csv
cfatools/tests/test_processor/tubing_volumes.csv
+4
-4
No files found.
cfatools/processor/flow.py
View file @
1dec8521
...
...
@@ -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
...
...
cfatools/tests/test_processor/tubing_volumes.csv
View file @
1dec8521
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment