Ко всем библиотекам · scripts

scripts/run_scan.py

Pilot outcome scan on the dev VPS.

21 строк · 1.0 KB · pbhgr @ 9e8e13d · как текст

#!/usr/bin/env python3
"""Pilot outcome scan on the dev VPS. Usage: run_scan.py OUT_DIR [n_part] [K]"""
import sys, itertools, json
import numpy as np
from pbhgr.scan import scan

out = sys.argv[1] if len(sys.argv) > 1 else "runs/scan_pilot"
n_part = int(sys.argv[2]) if len(sys.argv) > 2 else 10000
K = int(sys.argv[3]) if len(sys.argv) > 3 else 300
nus = [0.05, 0.15, 0.3]
flats = [1.0, 3.0]
Ls = [0.0, 0.5]
Gs = [0.0, 0.3]
points = [(nu, fl, L, G, n_part, K, 6.0, 5.0, 11) for nu, fl, L, G in itertools.product(nus, flats, Ls, Gs)]
rows, wall = scan(points, out)
print(f"{len(rows)} points, wall {wall:.0f} s")
print(f"{'nu':>5} {'flat':>5} {'Lrms':>5} {'G*td':>5} {'outcome':>12} {'max2m/r':>8} {'lapse':>7} {'ADMdrift':>9} {'mc':>8} {'wall':>6} {'RSS':>6}")
for r in rows:
    print(f"{r['nu']:5.2f} {r['flatness']:5.1f} {r['L_rms']:5.2f} {r['Gamma_tdyn']:5.2f} {r['outcome']:>12} {r['max_compactness']:8.4f} "
          f"{r['min_lapse']:7.4f} {r['M_total_drift']:9.2e} {r['momentum_constraint_max'] or 0:8.2e} {r['wall_s']:6.0f} {r['peak_rss_MB']:6.0f}")