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
WIM Collect
Commits
7d5c20f2
Commit
7d5c20f2
authored
Feb 18, 2020
by
JOSSOUD Olivier
Browse files
Quickviz. Selectable Air ValveMask
parent
1e2bae02
Pipeline
#59973
passed with stages
in 3 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
wimcollect/quickviz.py
wimcollect/quickviz.py
+4
-4
No files found.
wimcollect/quickviz.py
View file @
7d5c20f2
...
...
@@ -15,7 +15,7 @@ class Visualizator(utils.LogConfig):
utils
.
LogConfig
.
__init__
(
self
,
"VIZU"
,
config_parser
,
log
)
self
.
base_dir
=
self
.
config
[
self
.
object_id
][
"root_dir"
]
def
create_data_source_file
(
self
,
site_id
:
str
,
picarro_id
:
str
,
day
:
datetime
.
date
):
def
create_data_source_file
(
self
,
site_id
:
str
,
picarro_id
:
str
,
day
:
datetime
.
date
,
air_valve_mask
:
int
=
1
):
source_filepath
=
utils
.
get_standard_filepath
(
self
.
config
[
"LOCAL"
][
"base_dir"
],
site_id
,
"picarro"
,
picarro_id
,
day
.
strftime
(
"%Y%m%d"
),
"lzma"
)
if
not
os
.
path
.
exists
(
source_filepath
):
...
...
@@ -25,7 +25,7 @@ class Visualizator(utils.LogConfig):
# Decompress, and read data as Pandas' DataFrame
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
dat_files
=
utils
.
extract_compressed_file
(
source_filepath
,
tmpdirname
)
df
=
self
.
get_data
(
dat_files
)
df
=
self
.
get_data
(
dat_files
,
air_valve_mask
)
# Save calibration data file
calib_dir
=
os
.
path
.
join
(
self
.
base_dir
,
site_id
)
...
...
@@ -38,7 +38,7 @@ class Visualizator(utils.LogConfig):
return
True
def
get_data
(
self
,
dat_files
:
list
)
->
pd
.
DataFrame
:
def
get_data
(
self
,
dat_files
:
list
,
air_valve_mask
:
int
=
1
)
->
pd
.
DataFrame
:
dateparse
=
lambda
x
:
pd
.
datetime
.
strptime
(
x
,
'%Y-%m-%d %H:%M:%S.%f'
)
day_df
=
pd
.
DataFrame
()
for
dat_file
in
dat_files
:
...
...
@@ -47,7 +47,7 @@ class Visualizator(utils.LogConfig):
parse_dates
=
{
'datetime'
:
[
'DATE'
,
'TIME'
]},
date_parser
=
dateparse
)
df
=
df
[[
"datetime"
,
"H2O"
,
"Delta_18_16"
,
"Delta_D_H"
,
"ValveMask"
]]
df
=
df
[
df
[
"ValveMask"
]
!=
1
]
df
=
df
[
df
[
"ValveMask"
]
!=
air_valve_mask
]
if
len
(
day_df
.
index
)
==
0
:
day_df
=
df
...
...
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