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
698875f4
Commit
698875f4
authored
Dec 02, 2020
by
Jonathan Schaeffer
Browse files
PH5 Change size evaluation method
parent
2f2d68c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
resifdatareporter/resifdatareporter.py
View file @
698875f4
...
...
@@ -10,7 +10,7 @@ from datetime import datetime, date, timedelta
import
yaml
import
psycopg2
import
click
import
h5py
from
pathlib
import
Path
from
fdsnextender
import
FdsnExtender
from
resifdatareporter
import
__version__
logging
.
basicConfig
(
format
=
'%(asctime)s %(levelname)s: %(message)s'
,
level
=
logging
.
INFO
)
...
...
@@ -73,13 +73,9 @@ def scan_ph5_volume(volpath):
# Bon, ça n'a pas marché, on fait quoi ?
logger
.
error
(
"Unable to get year from path %s. Ignoring this one"
,
path
)
continue
total
=
0
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
path
):
for
i
in
filenames
:
logger
.
debug
(
"Scanning %s: file %s"
,
network
,
i
)
if
i
.
endswith
(
'ph5'
):
total
=
total
+
os
.
path
.
getsize
(
f
"
{
path
}
/
{
i
}
"
)
for
path
in
Path
(
path
).
rglob
(
'*.ph5'
):
total
=
total
+
path
.
stat
().
st_size
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.
data
.
append
({
'type'
:
'ph5'
,
'year'
:
year
,
'network'
:
network
,
'station'
:
None
,
...
...
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