Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
resif_data_reporter
Commits
1ca4b48e
Commit
1ca4b48e
authored
Dec 02, 2020
by
Jonathan Schaeffer
Browse files
Total PH5 corrigé
parent
dbbdc920
Changes
1
Hide whitespace changes
Inline
Side-by-side
resifdatareporter/resifdatareporter.py
View file @
1ca4b48e
...
...
@@ -76,10 +76,12 @@ def scan_ph5_volume(volpath):
logger
.
error
(
"Unable to get year from path %s. Ignoring this one"
,
path
)
continue
try
:
# Récupération de la liste des stations
h5data
=
h5py
.
File
(
f
"
{
path
}
/master.ph5"
,
'r'
)
logger
.
debug
(
"Master PH5 stations: %s"
,
h5data
[
'Experiment_g'
][
'Maps_g'
])
stations
=
[
sta
[
6
:]
for
sta
in
list
(
h5data
[
'Experiment_g'
][
'Maps_g'
])
if
sta
.
startswith
(
'Das_g_'
)]
logger
.
debug
(
"%s stations in %s"
,
len
(
stations
),
network
)
except
Exception
as
err
:
logger
.
error
(
"No master.ph5 file in %s. Let's assume there is one station"
,
path
)
...
...
@@ -88,7 +90,8 @@ def scan_ph5_volume(volpath):
for
i
in
filenames
:
logger
.
debug
(
"Scanning %s: file %s"
,
network
,
i
)
if
i
.
endswith
(
'ph5'
):
total
=
os
.
path
.
getsize
(
f
"
{
path
}
/
{
i
}
"
)
total
=
total
+
os
.
path
.
getsize
(
f
"
{
path
}
/
{
i
}
"
)
logger
.
debug
(
"Total size of %s is %s (%s GB)"
,
network
,
total
,
total
/
(
1024
**
3
)
)
# Make a statistic array with those stations dividing total size on each station.
per_station_size
=
int
(
total
/
len
(
stations
))
for
sta
in
stations
:
...
...
Write
Preview
Supports
Markdown
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