fix: color_xrange 范围限定 d_max + color_driver + color 范围改为 [0,1] + bug 修复
This commit is contained in:
+18
-6
@@ -668,12 +668,20 @@ def load_driver_file(driver_path, atom_ids):
|
||||
return None
|
||||
|
||||
print(f"[compute] 已加载驱动力: {len(drivers)} 条定义")
|
||||
for d in drivers:
|
||||
print(f" 原子 {d['atom_id']}: "
|
||||
f"A=({d['amp'][0]},{d['amp'][1]},{d['amp'][2]}), "
|
||||
f"f=({d['freq'][0]},{d['freq'][1]},{d['freq'][2]}), "
|
||||
f"φ=({phi_deg[d['amp'].tolist().index(max(d['amp']))]}° 等), "
|
||||
f"period={d['period_str']}")
|
||||
if len(drivers) <= 20:
|
||||
for d in drivers:
|
||||
print(f" 原子 {d['atom_id']}: "
|
||||
f"A=({d['amp'][0]},{d['amp'][1]},{d['amp'][2]}), "
|
||||
f"f=({d['freq'][0]},{d['freq'][1]},{d['freq'][2]}), "
|
||||
f"φ=({phi_deg[d['amp'].tolist().index(max(d['amp']))]}° 等), "
|
||||
f"period={d['period_str']}")
|
||||
else:
|
||||
_first = drivers[0]
|
||||
_last = drivers[-1]
|
||||
print(f" 原子 {_first['atom_id']}~{_last['atom_id']}: "
|
||||
f"A=({_first['amp'][0]},{_first['amp'][1]},{_first['amp'][2]}), "
|
||||
f"f=({_first['freq'][0]},{_first['freq'][1]},{_first['freq'][2]}), "
|
||||
f"period={_first['period_str']} 等 {len(drivers)} 条")
|
||||
return drivers
|
||||
|
||||
|
||||
@@ -1070,6 +1078,10 @@ def run_engine_dll(engine, output_dir, config):
|
||||
"number_of_particles": str(n_atoms),
|
||||
# draw.py 需要的渲染参数
|
||||
"use_marker": str(use_marker),
|
||||
"display_color": json.dumps(config.get("display_color",
|
||||
{"x":[0,[1.0,0.0,0.0]],"y":[0,[0.0,1.0,0.0]],"z":[0,[0.0,0.0,1.0]],
|
||||
"xy":[0,[1.0,1.0,0.0]],"yz":[0,[0.0,1.0,1.0]],"zx":[0,[1.0,0.0,1.0]],
|
||||
"xyz":[1,[1.0,1.0,1.0]]})),
|
||||
"ball_radius": str(config.get("ball_radius", float(ATOM_RADII[0]) if ATOM_RADII is not None else 0.5)),
|
||||
"ball_color_r": str(config.get("ball_color_r", 0.9)),
|
||||
"ball_color_g": str(config.get("ball_color_g", 0.2)),
|
||||
|
||||
Reference in New Issue
Block a user