From 9aaf3992dba16c6663ddca30a7bcbb3f12c08384 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 11 Nov 2023 07:59:27 -0500 Subject: [PATCH] update network pynucastro scripts to new RateCollection plot interface --- networks/CNO_extras/CNO_extras.py | 11 +++++++---- networks/He-C-Fe-group/He-C-Fe-group.py | 2 +- networks/ase/ase.py | 5 ++++- networks/nova/network_plot.py | 5 ++++- networks/nova/nova.py | 4 +++- networks/nova2/nova2.py | 4 +++- networks/subch_approx/subch_approx.py | 5 ++++- networks/subch_full/network_plot.py | 5 ++++- networks/subch_full/subch_full.py | 5 ++++- networks/subch_simple/subch_simple.py | 5 ++++- 10 files changed, 38 insertions(+), 13 deletions(-) diff --git a/networks/CNO_extras/CNO_extras.py b/networks/CNO_extras/CNO_extras.py index 56d035d470..b84ad5bc34 100644 --- a/networks/CNO_extras/CNO_extras.py +++ b/networks/CNO_extras/CNO_extras.py @@ -19,7 +19,10 @@ comp = pyna.Composition(rc.get_nuclei()) comp.set_solar_like() -rc.plot(outfile="cno_extras.png", rho=1.e6, T=1.e8, comp=comp, Z_range=[1,13], N_range=[1,13]) -rc.plot(outfile="cno_extras_hide_alpha.png", rho=1.e6, T=1.e8, comp=comp, Z_range=[1,13], N_range=[1,13], - rotated=True, highlight_filter_function=lambda r: r.Q > 0, - curved_edges=True, hide_xalpha=True) +rho = 1.e6 +T = 1.e8 + +rc.plot(rho, T, comp, outfile="cno_extras.png", Z_range=[1,13], N_range=[1,13]) +rc.plot(rho, T, comp, outfile="cno_extras_hide_alpha.png", Z_range=[1,13], N_range=[1,13], + rotated=True, highlight_filter_function=lambda r: r.Q > 0, + curved_edges=True, hide_xalpha=True) diff --git a/networks/He-C-Fe-group/He-C-Fe-group.py b/networks/He-C-Fe-group/He-C-Fe-group.py index dfa374d31f..2a9a7940dd 100644 --- a/networks/He-C-Fe-group/He-C-Fe-group.py +++ b/networks/He-C-Fe-group/He-C-Fe-group.py @@ -128,7 +128,7 @@ comp.set_all(1.0) comp.normalize() -fig = net.plot(rho=rho, T=T, comp=comp, +fig = net.plot(rho, T, comp, rotated=True, curved_edges=True, hide_xalpha=True, size=(1800, 900), node_size=500, node_shape="s", node_font_size=10) diff --git a/networks/ase/ase.py b/networks/ase/ase.py index 273bcbc310..dc04116d9c 100644 --- a/networks/ase/ase.py +++ b/networks/ase/ase.py @@ -113,7 +113,10 @@ def doit(): comp.set_nuc("he4", 0.95) comp.normalize() - net.plot(outfile="ase.png", rho=1.e7, T=6.e9, comp=comp, + rho = 1.e7 + T = 6.e9 + + net.plot(rho, T, comp, outfile="ase.png", rotated=True, hide_xalpha=True, curved_edges=True, size=(1500, 450), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s", diff --git a/networks/nova/network_plot.py b/networks/nova/network_plot.py index 90edac6a7c..589c7942e2 100644 --- a/networks/nova/network_plot.py +++ b/networks/nova/network_plot.py @@ -15,4 +15,7 @@ comp = pyna.Composition(rc.get_nuclei()) comp.set_solar_like() -rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp) +rho = 1.e4 +T = 9.e7 + +rc.plot(rho, T, comp, outfile="nova.png") diff --git a/networks/nova/nova.py b/networks/nova/nova.py index 0b7046f53d..2e4862202c 100644 --- a/networks/nova/nova.py +++ b/networks/nova/nova.py @@ -19,5 +19,7 @@ comp = Composition(rc.get_nuclei()) comp.set_solar_like() -rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp) +rho = 1.e4 +T = 9.e7 +rc.plot(rho, T, comp, outfile="nova.png") diff --git a/networks/nova2/nova2.py b/networks/nova2/nova2.py index 4ae93400b9..2a7301f490 100644 --- a/networks/nova2/nova2.py +++ b/networks/nova2/nova2.py @@ -19,5 +19,7 @@ comp = pyna.Composition(rc.get_nuclei()) comp.set_solar_like() -rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp) +rho = 1.e4 +T = 9.e7 +rc.plot(rho, T, comp, outfile="nova.png") diff --git a/networks/subch_approx/subch_approx.py b/networks/subch_approx/subch_approx.py index c6fd60aa6f..50ff013d33 100644 --- a/networks/subch_approx/subch_approx.py +++ b/networks/subch_approx/subch_approx.py @@ -52,7 +52,10 @@ def doit(): comp.set_nuc("he4", 0.95) comp.normalize() - net.plot(outfile="subch_approx.png", rho=1.e6, T=1.e9, comp=comp, + rho = 1.e6 + T = 1.e9 + + net.plot(rho, T, comp, outfile="subch_approx.png", rotated=True, hide_xalpha=True, curved_edges=True, size=(1500, 450), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s", diff --git a/networks/subch_full/network_plot.py b/networks/subch_full/network_plot.py index 71799699c3..720961351d 100644 --- a/networks/subch_full/network_plot.py +++ b/networks/subch_full/network_plot.py @@ -12,6 +12,9 @@ comp.set_nuc("he4", 0.95) comp.normalize() -rc.plot(outfile="subch2.pdf", rho=1.e6, T=1.e9, comp=comp, hide_xalpha=True, +rho = 1.e6 +T = 1.e9 + +rc.plot(rho, T, comp, outfile="subch2.pdf", hide_xalpha=True, size=(1500, 650), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s", Z_range=(1,29), rotated=True, curved_edges=True) diff --git a/networks/subch_full/subch_full.py b/networks/subch_full/subch_full.py index 3f1160d78e..cebd3cd571 100644 --- a/networks/subch_full/subch_full.py +++ b/networks/subch_full/subch_full.py @@ -44,7 +44,10 @@ def doit(): comp.set_nuc("he4", 0.95) comp.normalize() - rc.plot(outfile="subch_full.png", rho=1.e6, T=1.e9, comp=comp, + rho = 1.e6 + T = 1.e9 + + rc.plot(rho, T, comp, outfile="subch_full.png", rotated=True, hide_xalpha=True, curved_edges=True, size=(1500, 450), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s", diff --git a/networks/subch_simple/subch_simple.py b/networks/subch_simple/subch_simple.py index c90aea5299..a4edaa0fec 100644 --- a/networks/subch_simple/subch_simple.py +++ b/networks/subch_simple/subch_simple.py @@ -102,7 +102,10 @@ def doit(): comp.set_nuc("he4", 0.95) comp.normalize() - net.plot(outfile="subch_simple.png", rho=1.e6, T=1.e9, comp=comp, + rho = 1.e6 + T = 1.e9 + + net.plot(rho, T, comp, outfile="subch_simple.png", rotated=True, hide_xalpha=True, curved_edges=True, size=(1500, 450), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",