Commit 1ca4b48e authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Total PH5 corrigé

parent dbbdc920
......@@ -76,10 +76,12 @@ def scan_ph5_volume(volpath):
logger.error("Unable to get year from path %s. Ignoring this one", path)
# Récupération de la liste des stations
h5data = h5py.File(f"{path}/master.ph5",'r')
logger.debug("Master PH5 stations: %s",
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:
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