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
83d776be
Commit
83d776be
authored
Dec 17, 2021
by
JOSSOUD Olivier
Browse files
Flow. Use intermediate iceblocks.csv file for more convenient viewing/editing.
parent
5f4f24b7
Pipeline
#153663
passed with stages
in 1 minute and 25 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
cfatools/processor/flow.py
cfatools/processor/flow.py
+12
-3
No files found.
cfatools/processor/flow.py
View file @
83d776be
...
...
@@ -238,7 +238,7 @@ def get_bubble_density_from_conduct(dataset: DatasetReader):
return
compump_df
def
get_datasets_data
(
dataset
:
DatasetReader
)
\
def
get_datasets_data
(
dataset
:
DatasetReader
,
retrieve_iceblocks_from_processed_csv
:
bool
=
True
)
\
->
typing
.
Tuple
[
pd
.
DataFrame
,
pd
.
DataFrame
,
pd
.
DataFrame
,
pd
.
DataFrame
,
pd
.
DataFrame
,
pd
.
DataFrame
]:
"""Get the dataframes useful for flow analysis
...
...
@@ -246,6 +246,10 @@ def get_datasets_data(dataset: DatasetReader)\
----------
dataset: DatasetReader
Dataset whose data should be retrieved.
retrieve_iceblocks_from_processed_csv: bool, optional
If `True`, the information about the iceblock sequence will be read from a processed file
(`processed/iceblocks.csv`; if it exists, otherwise it will be created). If `False`, the information will be
re-processed from `yyyymmdd_[dataset_name]_ICBKCTRL_instant.log` file. Default is `True`.
Returns
-------
...
...
@@ -257,8 +261,13 @@ def get_datasets_data(dataset: DatasetReader)\
encoder_df
=
encoder_df
.
drop
(
columns
=
"speed_avg"
)
# Iceblock
iceblock_filename
=
os
.
path
.
join
(
dataset
.
dataset_path
,
"processed"
,
"iceblocks.csv"
)
if
retrieve_iceblocks_from_processed_csv
and
os
.
path
.
exists
(
iceblock_filename
):
iceblock_df
=
pd
.
read_csv
(
iceblock_filename
,
parse_dates
=
[
"datetime_start"
,
"datetime_end"
,
"datetime_stacked"
])
else
:
iceblock_df
=
dataset
.
get_timeseries
(
"ICBKCTRL_instant"
)
iceblock_df
=
iceblock
.
get_clean_iceblock_df
(
iceblock_df
)
iceblock_df
.
to_csv
(
iceblock_filename
,
index
=
False
,
date_format
=
"%Y-%m-%dT%H:%M:%SZ"
)
# Conductivity
conduct_df
=
dataset
.
get_timeseries
(
"CONDUCTI_periodic"
)
...
...
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