Commit 698875f4 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

PH5 Change size evaluation method

parent 2f2d68c1
......@@ -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)
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,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment