import json d = json.load(open(r'F:\seismic_webapp\inventory.json')) # Verifier quelques fichiers print("=== EXEMPLES DE FICHIERS ===") for f in d[:5]: print(f"File: {f['filename']}") print(f" Bumper: {f['bumper_id']}, Channel: {f['channel']}") print(f" Samples: {f['samples']}, Epoch: {f['epoch_time']}") print() # Compter les bumpers uniques bumpers = set(f['bumper_id'] for f in d if f['bumper_id']) print(f"Bumpers uniques: {len(bumpers)}") print(f"Liste: {sorted(bumpers, key=lambda x: int(x) if x and x.isdigit() else 999)[:30]}") # Verifier le probleme des samples print("\n=== FICHIERS AVEC GROS SAMPLES ===") big_files = [f for f in d if f['samples'] > 100000000] for f in big_files[:5]: print(f" {f['filename']}: {f['samples']} samples = {f['samples']/200/3600:.1f}h") # Stats par bumper from collections import defaultdict by_bumper = defaultdict(lambda: {'files': 0, 'channels': set()}) for f in d: if f['bumper_id']: by_bumper[f['bumper_id']]['files'] += 1 if f['channel']: by_bumper[f['bumper_id']]['channels'].add(f['channel']) print(f"\n=== PAR BUMPER (premiers 20) ===") for b in sorted(by_bumper.keys(), key=lambda x: int(x) if x.isdigit() else 999)[:20]: s = by_bumper[b] print(f" b{b}: {s['files']} files, channels: {sorted(s['channels'])}")