nucleardatapy 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nucleardatapy/crust/setup_crust.py +46 -1
- nucleardatapy/data/crust/2018-PCPFDDG-BSK22.dat +83 -0
- nucleardatapy/data/crust/2018-PCPFDDG-BSK24.dat +74 -0
- nucleardatapy/data/crust/2018-PCPFDDG-BSK25.dat +130 -0
- nucleardatapy/data/crust/2018-PCPFDDG-BSK26.dat +81 -0
- nucleardatapy/data/matter/micro/2006-BHF/2006-BHF-Av18-effmass-SM.dat +11 -0
- nucleardatapy/data/matter/micro/2006-BHF/2006-BHF-Av18-effmass-beta0.2.dat +11 -0
- nucleardatapy/data/matter/micro/2006-BHF/2006-BHF-Av18-effmass-beta0.4.dat +11 -0
- nucleardatapy/data/nuclei/masses/Theory/2023-BSkG3.txt +0 -4
- nucleardatapy/data/nuclei/masses/Theory/2025-BSkG4.txt +0 -1
- nucleardatapy/eos/setup_am.py +43 -31
- nucleardatapy/eos/setup_am_Beq.py +18 -12
- nucleardatapy/eos/setup_am_Leq.py +53 -47
- nucleardatapy/fig/__init__.py +15 -2
- nucleardatapy/fig/crust_setupCrust_fig.py +3 -3
- nucleardatapy/fig/eos_setupAMBeq_fig.py +866 -49
- nucleardatapy/fig/eos_setupAMLeq_fig.py +185 -53
- nucleardatapy/fig/eos_setupAM_e_asy_lep_fig.py +125 -0
- nucleardatapy/fig/eos_setupAM_e_asy_nuc_fig.py +115 -0
- nucleardatapy/fig/eos_setupAM_e_asy_tot_fig.py +117 -0
- nucleardatapy/fig/eos_setupAM_e_fig.py +173 -0
- nucleardatapy/fig/hnuc_setupRE1LExp_fig.py +1 -1
- nucleardatapy/fig/matter_ENM_fig.py +50 -41
- nucleardatapy/fig/matter_ESM_fig.py +60 -39
- nucleardatapy/fig/matter_Esym_fig.py +48 -36
- nucleardatapy/fig/matter_cs2_fig.py +83 -0
- nucleardatapy/fig/matter_preNM_fig.py +146 -0
- nucleardatapy/fig/matter_preSM_fig.py +144 -0
- nucleardatapy/fig/matter_setupFFGNuc_fig.py +2 -1
- nucleardatapy/fig/matter_setupMicroEsym_fig.py +50 -19
- nucleardatapy/fig/matter_setupMicro_band_fig.py +1 -0
- nucleardatapy/fig/matter_setupMicro_effmass_fig.py +59 -4
- nucleardatapy/fig/matter_setupMicro_fig.py +81 -79
- nucleardatapy/fig/matter_setupPhenoEsym_fig.py +28 -26
- nucleardatapy/fig/matter_setupPheno_fig.py +34 -24
- nucleardatapy/fig/nuc_setupBEExp_chart_fig.py +275 -0
- nucleardatapy/fig/nuc_setupBEExp_fig.py +225 -70
- nucleardatapy/fig/nuc_setupBETheo_fig.py +316 -0
- nucleardatapy/fig/nuc_setupISGMRExp_fig.py +59 -0
- nucleardatapy/fig/nuc_setupRchExp_fig.py +139 -0
- nucleardatapy/fig/nuc_setupRchTheo_fig.py +142 -0
- nucleardatapy/fig/nuc_setupRnpExp_fig.py +120 -0
- nucleardatapy/fig/nuc_setupRnpTheo_fig.py +134 -0
- nucleardatapy/hnuc/__init__.py +3 -3
- nucleardatapy/matter/__init__.py +1 -0
- nucleardatapy/matter/setup_check.py +97 -0
- nucleardatapy/matter/setup_ffg.py +15 -8
- nucleardatapy/matter/setup_micro.py +144 -79
- nucleardatapy/matter/setup_micro_band.py +6 -1
- nucleardatapy/matter/setup_micro_effmass.py +55 -2
- nucleardatapy/matter/setup_micro_esym.py +37 -30
- nucleardatapy/matter/setup_micro_gap.py +3 -3
- nucleardatapy/matter/setup_micro_lp.py +18 -17
- nucleardatapy/matter/setup_pheno.py +2 -2
- nucleardatapy/matter/setup_pheno_esym.py +13 -13
- nucleardatapy/nuc/__init__.py +2 -2
- nucleardatapy/nuc/setup_be_exp.py +90 -90
- nucleardatapy/nuc/setup_be_theo.py +112 -100
- nucleardatapy/nuc/setup_rch_exp.py +49 -6
- nucleardatapy/nuc/setup_rch_theo.py +72 -3
- nucleardatapy/nuc/{setup_nskin_exp.py → setup_rnp_exp.py} +58 -65
- nucleardatapy/nuc/{setup_nskin_theo.py → setup_rnp_theo.py} +34 -39
- nucleardatapy-0.2.1.dist-info/METADATA +521 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-0.2.1.dist-info}/RECORD +86 -65
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-0.2.1.dist-info}/WHEEL +1 -1
- nucleardatapy/fig/eos_setupAM_fig.py +0 -81
- nucleardatapy-0.2.0.dist-info/METADATA +0 -115
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-E2A-AM.dat → 2006-BHF-Av18-E2A-AM.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-E2A-NM.dat → 2006-BHF-Av18-E2A-NM.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-E2A-SM.dat → 2006-BHF-Av18-E2A-SM.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-Esym2-SM.dat → 2006-BHF-Av18-Esym2-SM.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-GAP-NM-FreeSpectrum.dat → 2006-BHF-Av18-GAP-NM-FreeSpectrum.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-GAP-NM-SelfEnergy.dat → 2006-BHF-Av18-GAP-NM-SelfEnergy.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-GAP-SM-FreeSpectrum.dat → 2006-BHF-Av18-GAP-SM-FreeSpectrum.dat} +0 -0
- /nucleardatapy/data/matter/micro/2006-BHF/{2006-BHF-GAP-SM-SelfEnergy.dat → 2006-BHF-Av18-GAP-SM-SelfEnergy.dat} +0 -0
- /nucleardatapy/data/matter/micro/{2020-MBPT-NM-DHSL59.dat → 2019-MBPT-NM-DHSL59.dat} +0 -0
- /nucleardatapy/data/matter/micro/{2020-MBPT-NM-DHSL69.dat → 2019-MBPT-NM-DHSL69.dat} +0 -0
- /nucleardatapy/data/matter/micro/{2020-MBPT-SM-DHSL59.dat → 2019-MBPT-SM-DHSL59.dat} +0 -0
- /nucleardatapy/data/matter/micro/{2020-MBPT-SM-DHSL69.dat → 2019-MBPT-SM-DHSL69.dat} +0 -0
- /nucleardatapy/data/matter/micro/{2023-MBPT-NM.csv → 2020-MBPT-NM.csv} +0 -0
- /nucleardatapy/data/matter/micro/{2023-MBPT-SM.csv → 2020-MBPT-SM.csv} +0 -0
- /nucleardatapy/data/nuclei/{nskin → rnp}/208Pb.dat +0 -0
- /nucleardatapy/data/nuclei/{nskin → rnp}/48Ca.dat +0 -0
- /nucleardatapy/hnuc/{setup_be1L_exp.py → setup_re1L_exp.py} +0 -0
- /nucleardatapy/hnuc/{setup_be1Xi_exp.py → setup_re1Xi_exp.py} +0 -0
- /nucleardatapy/hnuc/{setup_be2L_exp.py → setup_re2L_exp.py} +0 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-0.2.1.dist-info/licenses}/LICENSE +0 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-0.2.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
from matplotlib.ticker import AutoMinorLocator # Import para minor ticks
|
|
4
|
+
|
|
5
|
+
import nucleardatapy as nuda
|
|
6
|
+
|
|
7
|
+
# Dictionary to map sources to LaTeX names
|
|
8
|
+
SOURCE_LABELS_LATEX = {
|
|
9
|
+
"48Ca": r"$^{48}\mathrm{Ca}$",
|
|
10
|
+
"208Pb": r"$^{208}\mathrm{Pb}$"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
def nuc_setupRnpExp_fig( pname ):
|
|
14
|
+
"""
|
|
15
|
+
Generates neutron skin (R_skin) plots for each nucleus using data from the `SetupNeutronSkinExp` class.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
print(f'Plot name: {pname}')
|
|
19
|
+
#
|
|
20
|
+
# Retrieve available sources (e.g., '48Ca', '208Pb')
|
|
21
|
+
sources, _ = nuda.nskin_exp()
|
|
22
|
+
|
|
23
|
+
# Labels for the subplots
|
|
24
|
+
subplot_labels = ["(a)", "(b)"] # Adjust this list based on the number of sources
|
|
25
|
+
|
|
26
|
+
# Iterate over each source to create individual plots
|
|
27
|
+
for idx, source in enumerate(sources):
|
|
28
|
+
# Lists to store data for the plot
|
|
29
|
+
labels = [] # Labels for references (e.g., 'Brissaud 1972')
|
|
30
|
+
rskin_values = [] # R_skin values
|
|
31
|
+
error_lower = [] # Lower errors
|
|
32
|
+
error_upper = [] # Upper errors
|
|
33
|
+
markers = [] # Marker types to customize the points
|
|
34
|
+
|
|
35
|
+
# Retrieve available calculations for the source
|
|
36
|
+
cals = nuda.nuc.rnp_exp_source(source)
|
|
37
|
+
|
|
38
|
+
for cal in cals:
|
|
39
|
+
# Instantiate the object for the specific calculation
|
|
40
|
+
neutron_skin_calc = nuda.nuc.setupRnpExp(source=source, cal=cal)
|
|
41
|
+
|
|
42
|
+
# Store data only if R_skin is available
|
|
43
|
+
if neutron_skin_calc.nskin is not None:
|
|
44
|
+
labels.append(neutron_skin_calc.label) # Use `self.label` as label
|
|
45
|
+
rskin_values.append(neutron_skin_calc.nskin)
|
|
46
|
+
|
|
47
|
+
# Replace `None` error values with 0.0
|
|
48
|
+
err_down = neutron_skin_calc.nskin_sig_do if neutron_skin_calc.nskin_sig_do is not None else 0.0
|
|
49
|
+
err_up = neutron_skin_calc.nskin_sig_up if neutron_skin_calc.nskin_sig_up is not None else 0.0
|
|
50
|
+
error_lower.append(err_down)
|
|
51
|
+
error_upper.append(err_up)
|
|
52
|
+
|
|
53
|
+
# Ensure the marker is valid
|
|
54
|
+
marker = neutron_skin_calc.marker if neutron_skin_calc.marker else 'o'
|
|
55
|
+
markers.append(marker)
|
|
56
|
+
|
|
57
|
+
# Check if there is data to plot
|
|
58
|
+
if not rskin_values:
|
|
59
|
+
print(f"No data available for {source}.")
|
|
60
|
+
continue
|
|
61
|
+
|
|
62
|
+
# Plot configuration
|
|
63
|
+
fig, ax = plt.subplots(figsize=(10, 8))
|
|
64
|
+
x_positions = range(len(labels)+1) # X-axis positions
|
|
65
|
+
|
|
66
|
+
# Add each point to the plot with vertical error bars
|
|
67
|
+
for i, (x, y, err_down, err_up, marker) in enumerate(zip(x_positions, rskin_values, error_lower, error_upper, markers)):
|
|
68
|
+
# Handle large errors (>= 1000) by limiting the bar to 0.1
|
|
69
|
+
adjusted_err_down = min(err_down, 0.2)
|
|
70
|
+
adjusted_err_up = min(err_up, 0.2)
|
|
71
|
+
|
|
72
|
+
# Add adjusted error bars
|
|
73
|
+
ax.errorbar(x, y, yerr=[[adjusted_err_down], [adjusted_err_up]], fmt=marker, markersize=8, capsize=0, label=labels[i])
|
|
74
|
+
|
|
75
|
+
# Add arrow as cap for err_down >= 1000
|
|
76
|
+
if err_down >= 1000:
|
|
77
|
+
ax.plot([x], [y - adjusted_err_down], marker="v", color="grey", markersize=8)
|
|
78
|
+
|
|
79
|
+
# Add arrow as cap for err_up >= 1000
|
|
80
|
+
if err_up >= 1000:
|
|
81
|
+
ax.plot([x], [y + adjusted_err_up], marker="^", color="grey", markersize=8)
|
|
82
|
+
|
|
83
|
+
nsav = nuda.nuc.setupRnpAverage(source=source)
|
|
84
|
+
# print('label:', nsav.label)
|
|
85
|
+
if nsav.nskin_cen is not None:
|
|
86
|
+
ax.errorbar(len(labels), nsav.nskin_cen, yerr=nsav.sig_std, label=nsav.label,
|
|
87
|
+
color='red', marker='o', markersize=10, linestyle='solid', linewidth=3)
|
|
88
|
+
labels.append(nsav.label)
|
|
89
|
+
# Fixed y-axis configuration
|
|
90
|
+
ax.set_ylim([0, 0.5]) # Fixed scale from 0 to 0.5 on the y-axis
|
|
91
|
+
|
|
92
|
+
# X-axis configuration
|
|
93
|
+
ax.set_xticks(x_positions)
|
|
94
|
+
ax.set_xticklabels(labels, rotation=45, ha="right", fontsize=15)
|
|
95
|
+
|
|
96
|
+
# Y-axis configuration and layout
|
|
97
|
+
# Increase font size for y-axis numbers
|
|
98
|
+
ax.tick_params(axis='y', labelsize=15) # Adjust the font size as desired
|
|
99
|
+
ax.set_ylabel(rf"$R_{{\rm{{skin}}}}$ {SOURCE_LABELS_LATEX[source]} (fm)", fontsize=15)
|
|
100
|
+
# ax.set_xlabel(f"References for {SOURCE_LABELS_LATEX[source]}", fontsize=14)
|
|
101
|
+
# ax.grid(True, linestyle="--", alpha=0.5)
|
|
102
|
+
|
|
103
|
+
# Adjust the legend (only if there are valid labels)
|
|
104
|
+
# ax.legend(loc="upper left", bbox_to_anchor=(1, 1), fontsize=10)
|
|
105
|
+
|
|
106
|
+
# Add subplot label (e.g., "(a)", "(b)") in the top right corner
|
|
107
|
+
ax.text(0.95, 0.95, subplot_labels[idx], transform=ax.transAxes, fontsize=15,
|
|
108
|
+
verticalalignment='top', horizontalalignment='right')
|
|
109
|
+
|
|
110
|
+
# Add minor ticks on y-axis
|
|
111
|
+
ax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
112
|
+
ax.tick_params(axis='y', which='minor', length=4, color='gray') # Style for minor ticks
|
|
113
|
+
|
|
114
|
+
# Final adjustments and save the plot
|
|
115
|
+
#plt.tight_layout()
|
|
116
|
+
if pname is not None:
|
|
117
|
+
plt.savefig(pname, dpi=200)
|
|
118
|
+
plt.close()
|
|
119
|
+
|
|
120
|
+
print(f"Plot saved: {pname}")
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
from matplotlib.ticker import AutoMinorLocator # Import para minor ticks
|
|
4
|
+
|
|
5
|
+
import nucleardatapy as nuda
|
|
6
|
+
|
|
7
|
+
# Dictionary to map sources to LaTeX names
|
|
8
|
+
SOURCE_LABELS_LATEX = {
|
|
9
|
+
"48Ca": r"$^{48}\mathrm{Ca}$",
|
|
10
|
+
"208Pb": r"$^{208}\mathrm{Pb}$"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Directory containing the model data tables
|
|
14
|
+
MODEL_TABLES_DIR = nuda.param.path_data + '/NeutronSkin/'
|
|
15
|
+
|
|
16
|
+
# Define markers and colors for each model
|
|
17
|
+
MODEL_STYLES = {
|
|
18
|
+
"skyrme": {"color": "blue", "marker": "s", "label": "Skyrme"},
|
|
19
|
+
"nlrh": {"color": "red", "marker": "^", "label": "NLRH"},
|
|
20
|
+
"ddrh": {"color": "green", "marker": "D", "label": "DDRH"}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
def read_model_data(directory, source):
|
|
24
|
+
model_data = {}
|
|
25
|
+
for filename in os.listdir(directory):
|
|
26
|
+
if filename.endswith(".dat") and source in filename:
|
|
27
|
+
model_name = filename.split("Nskin")[0].lower()
|
|
28
|
+
filepath = os.path.join(directory, filename)
|
|
29
|
+
data = []
|
|
30
|
+
with open(filepath, 'r') as file:
|
|
31
|
+
for line in file:
|
|
32
|
+
if line.startswith("#") or not line.strip():
|
|
33
|
+
continue
|
|
34
|
+
parts = line.split()
|
|
35
|
+
param = parts[0]
|
|
36
|
+
rn, rp, rskin = map(float, parts[1:4])
|
|
37
|
+
data.append((param, rn, rp, rskin))
|
|
38
|
+
model_data[model_name] = np.array(data, dtype=object)
|
|
39
|
+
if nuda.env.verb:
|
|
40
|
+
print(f"Loaded model data for {model_name}: {model_data[model_name]}")
|
|
41
|
+
return model_data
|
|
42
|
+
|
|
43
|
+
def nuc_setupRnpExp_fig( pname ):
|
|
44
|
+
|
|
45
|
+
print(f'Plot name: {pname}')
|
|
46
|
+
|
|
47
|
+
sources, _ = nuda.nuc.rnp_exp()
|
|
48
|
+
subplot_labels = ["(a)", "(b)"]
|
|
49
|
+
|
|
50
|
+
for idx, source in enumerate(sources):
|
|
51
|
+
labels = []
|
|
52
|
+
rskin_values = []
|
|
53
|
+
error_lower = []
|
|
54
|
+
error_upper = []
|
|
55
|
+
xexp = []
|
|
56
|
+
|
|
57
|
+
cals = nuda.nuc.rnp_exp_source(source)
|
|
58
|
+
for i, cal in enumerate(cals):
|
|
59
|
+
neutron_skin_calc = nuda.nuc.setupRnpExp(source=source, cal=cal)
|
|
60
|
+
if neutron_skin_calc.nskin is not None:
|
|
61
|
+
labels.append(neutron_skin_calc.label)
|
|
62
|
+
rskin_values.append(neutron_skin_calc.nskin)
|
|
63
|
+
xexp.append(i)
|
|
64
|
+
err_down = neutron_skin_calc.nskin_sig_do if neutron_skin_calc.nskin_sig_do is not None else 0.0
|
|
65
|
+
err_up = neutron_skin_calc.nskin_sig_up if neutron_skin_calc.nskin_sig_up is not None else 0.0
|
|
66
|
+
error_lower.append(err_down)
|
|
67
|
+
error_upper.append(err_up)
|
|
68
|
+
|
|
69
|
+
model_data = read_model_data(MODEL_TABLES_DIR, source)
|
|
70
|
+
combined_rskin = []
|
|
71
|
+
combined_errors = []
|
|
72
|
+
combined_markers = []
|
|
73
|
+
combined_colors = []
|
|
74
|
+
xtheo = []
|
|
75
|
+
|
|
76
|
+
for model_name, data in model_data.items():
|
|
77
|
+
for j, (_, _, _, rskin) in enumerate(data):
|
|
78
|
+
x_position = xexp[j % len(xexp)] + 0.5 # Cycle through xexp and offset by 0.5
|
|
79
|
+
xtheo.append(x_position)
|
|
80
|
+
combined_rskin.append(rskin)
|
|
81
|
+
combined_errors.append((0.0, 0.0))
|
|
82
|
+
combined_markers.append(MODEL_STYLES[model_name]["marker"])
|
|
83
|
+
combined_colors.append(MODEL_STYLES[model_name]["color"])
|
|
84
|
+
|
|
85
|
+
if nuda.env.verb:
|
|
86
|
+
print(f"Experimental positions for {source}: {xexp}")
|
|
87
|
+
print(f"Theoretical positions for {source}: {xtheo}")
|
|
88
|
+
|
|
89
|
+
fig, ax = plt.subplots(figsize=(10, 8))
|
|
90
|
+
for i, (x, y, err_down, err_up) in enumerate(zip(xexp, rskin_values, error_lower, error_upper)):
|
|
91
|
+
adjusted_err_down = min(err_down, 0.2)
|
|
92
|
+
adjusted_err_up = min(err_up, 0.2)
|
|
93
|
+
ax.errorbar(x, y, yerr=[[adjusted_err_down], [adjusted_err_up]], fmt='o', markersize=8, capsize=0, color='black', markerfacecolor='none')
|
|
94
|
+
if err_down >= 1000:
|
|
95
|
+
ax.plot([x], [y - adjusted_err_down], marker="v", color="black", markersize=8)
|
|
96
|
+
if err_up >= 1000:
|
|
97
|
+
ax.plot([x], [y + adjusted_err_up], marker="^", color="black", markersize=8)
|
|
98
|
+
|
|
99
|
+
nsav = nuda.nuc.setupRnpAverage(source=source)
|
|
100
|
+
if nsav.nskin_cen is not None:
|
|
101
|
+
ax.errorbar(len(labels), nsav.nskin_cen, yerr=nsav.sig_std, label=nsav.label,
|
|
102
|
+
color='k', marker='o', markersize=10, linestyle='solid', linewidth=3)
|
|
103
|
+
# labels.append(nsav.label)
|
|
104
|
+
|
|
105
|
+
for i, (x, y, marker, color) in enumerate(zip(xtheo, combined_rskin, combined_markers, combined_colors)):
|
|
106
|
+
ax.plot(x, y, marker=marker, markersize=8, color=color)
|
|
107
|
+
|
|
108
|
+
# Add legend for experimental points
|
|
109
|
+
ax.scatter([], [], color='black', marker='o', facecolors='none', label='Experimental/Analysis')
|
|
110
|
+
|
|
111
|
+
# Add legend for theoretical models
|
|
112
|
+
for model_name, style in MODEL_STYLES.items():
|
|
113
|
+
ax.scatter([], [], color=style["color"], marker=style["marker"], label=style["label"])
|
|
114
|
+
|
|
115
|
+
ax.set_ylim([0, 0.5])
|
|
116
|
+
ax.set_xticks(xexp)
|
|
117
|
+
ax.set_xticklabels(labels, rotation=45, ha="right", fontsize=15)
|
|
118
|
+
ax.set_ylabel(rf"$R_{{\rm{{skin}}}}$ {SOURCE_LABELS_LATEX[source]} (fm)", fontsize=15)
|
|
119
|
+
ax.text(0.95, 0.95, subplot_labels[idx], transform=ax.transAxes, fontsize=15, verticalalignment='top', horizontalalignment='right')
|
|
120
|
+
|
|
121
|
+
# Add minor ticks on y-axis
|
|
122
|
+
ax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
123
|
+
ax.tick_params(axis='y', which='minor', length=4, color='gray') # Style for minor ticks
|
|
124
|
+
|
|
125
|
+
ax.legend(loc="upper right", bbox_to_anchor=(0.5, 1), fontsize=12)
|
|
126
|
+
|
|
127
|
+
output_dir = "figs/"
|
|
128
|
+
os.makedirs(output_dir, exist_ok=True)
|
|
129
|
+
fig_name = f"{output_dir}plot_nuc_setup_nskin_theo-{source.replace(' ', '_')}.png"
|
|
130
|
+
plt.tight_layout()
|
|
131
|
+
plt.savefig(fig_name, dpi=200)
|
|
132
|
+
plt.close()
|
|
133
|
+
|
|
134
|
+
print(f"Plot saved: {fig_name}")
|
nucleardatapy/hnuc/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
This module provides microscopic, phenomenological and experimental data constraints.
|
|
3
3
|
"""
|
|
4
4
|
#
|
|
5
|
-
from nucleardatapy.hnuc.
|
|
6
|
-
from nucleardatapy.hnuc.
|
|
7
|
-
from nucleardatapy.hnuc.
|
|
5
|
+
from nucleardatapy.hnuc.setup_re1L_exp import *
|
|
6
|
+
from nucleardatapy.hnuc.setup_re2L_exp import *
|
|
7
|
+
from nucleardatapy.hnuc.setup_re1Xi_exp import *
|
|
8
8
|
#
|
nucleardatapy/matter/__init__.py
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
|
|
2
|
+
import numpy as np # 1.15.0
|
|
3
|
+
from scipy.interpolate import CubicSpline
|
|
4
|
+
|
|
5
|
+
import nucleardatapy as nuda
|
|
6
|
+
|
|
7
|
+
class setupCheck():
|
|
8
|
+
"""
|
|
9
|
+
Instantiate a flag reflecting if e2a from `eos` passes through the reference `band` or not.
|
|
10
|
+
|
|
11
|
+
:param eos: object containing the eos to check.
|
|
12
|
+
:type eos: object.
|
|
13
|
+
:param band: object containing the band employed to check the eos.
|
|
14
|
+
:type band: object.
|
|
15
|
+
|
|
16
|
+
**Attributes:**
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
#
|
|
20
|
+
def __init__( self, eos, band ):
|
|
21
|
+
"""
|
|
22
|
+
Parameters
|
|
23
|
+
----------
|
|
24
|
+
eos : object.
|
|
25
|
+
Object containing the eos to check.
|
|
26
|
+
band: object.
|
|
27
|
+
Object containing the band employed to check the eos.
|
|
28
|
+
matter: string which can be: 'nm' (default), 'sm', or 'esym'.
|
|
29
|
+
"""
|
|
30
|
+
#
|
|
31
|
+
if nuda.env.verb: print("Enter setupCheck()")
|
|
32
|
+
#
|
|
33
|
+
#: Attribute the object `eos`.
|
|
34
|
+
self.eos = eos
|
|
35
|
+
#: Attribute the object `band`.
|
|
36
|
+
self.band = band
|
|
37
|
+
#: Attribute the value for the variable `matter`.
|
|
38
|
+
self.matter = band.matter
|
|
39
|
+
#
|
|
40
|
+
if 'fit' in eos.model:
|
|
41
|
+
if self.matter.lower() == 'nm' or self.matter.lower() == 'sm':
|
|
42
|
+
self.x = np.insert( eos.den, 0, 0.0 )
|
|
43
|
+
self.y = np.insert( eos.e2a, 0, 0.0 )
|
|
44
|
+
elif self.matter.lower() == 'esym':
|
|
45
|
+
self.x = np.insert( eos.den, 0, 0.0 )
|
|
46
|
+
self.y = np.insert( eos.esym, 0, 0.0 )
|
|
47
|
+
else:
|
|
48
|
+
if self.matter.lower() == 'nm':
|
|
49
|
+
self.x = np.insert( eos.nm_den, 0, 0.0 )
|
|
50
|
+
self.y = np.insert( eos.nm_e2a, 0, 0.0 )
|
|
51
|
+
elif self.matter.lower() == 'sm':
|
|
52
|
+
self.x = np.insert( eos.sm_den, 0, 0.0 )
|
|
53
|
+
self.y = np.insert( eos.sm_e2a, 0, 0.0 )
|
|
54
|
+
elif self.matter.lower() == 'esym':
|
|
55
|
+
self.x = np.insert( eos.den, 0, 0.0 )
|
|
56
|
+
self.y = np.insert( eos.esym, 0, 0.0 )
|
|
57
|
+
else:
|
|
58
|
+
print('setup_check: issue with matter:',self.matter)
|
|
59
|
+
exit()
|
|
60
|
+
cs_e2a = CubicSpline( self.x, self.y )
|
|
61
|
+
self.eos_e2a = cs_e2a(band.den)
|
|
62
|
+
flag = True
|
|
63
|
+
for ind,den in enumerate(band.den):
|
|
64
|
+
#if abs(cs_e2a(den)-band.e2a[ind]) > band.e2a_std[ind]:
|
|
65
|
+
if abs(self.eos_e2a[ind]-band.e2a[ind]) > band.e2a_std[ind]:
|
|
66
|
+
flag = False
|
|
67
|
+
#: Attribute is eos is inside the band.
|
|
68
|
+
self.isInside = flag
|
|
69
|
+
#: Attribute is eos is outside the band.
|
|
70
|
+
self.isOutside = not flag
|
|
71
|
+
#
|
|
72
|
+
self.den_unit = 'fm$^{-3}$'
|
|
73
|
+
self.e2a_unit = 'MeV'
|
|
74
|
+
#
|
|
75
|
+
if nuda.env.verb: print("Exit setupCheck()")
|
|
76
|
+
#
|
|
77
|
+
def print_outputs( self ):
|
|
78
|
+
"""
|
|
79
|
+
Method which print outputs on terminal's screen.
|
|
80
|
+
"""
|
|
81
|
+
print("")
|
|
82
|
+
#
|
|
83
|
+
if nuda.env.verb: print("Enter print_outputs()")
|
|
84
|
+
#
|
|
85
|
+
print("- Print output:")
|
|
86
|
+
print('For matter:',self.matter)
|
|
87
|
+
print('EOS:')
|
|
88
|
+
if self.x is not None: print(f" den: {np.round(self.x,2)} in {self.den_unit}")
|
|
89
|
+
if self.y is not None: print(f" e2a: {np.round(self.y,2)} in {self.e2a_unit}")
|
|
90
|
+
print('BAND:')
|
|
91
|
+
if self.band.den is not None: print(f" den: {np.round(self.band.den,2)} in {self.den_unit}")
|
|
92
|
+
if self.band.e2a is not None: print(f" e2a: {np.round(self.band.e2a,2)} in {self.e2a_unit}")
|
|
93
|
+
if self.band.e2a_std is not None: print(f" e2a_std: {np.round(self.band.e2a_std,2)} in {self.e2a_unit}")
|
|
94
|
+
#
|
|
95
|
+
if nuda.env.verb: print("Exit print_outputs()")
|
|
96
|
+
#
|
|
97
|
+
|
|
@@ -358,19 +358,26 @@ class setupFFGLep():
|
|
|
358
358
|
#: Attribute muon Fermi energy (degeneracy = 2)
|
|
359
359
|
self.eF_mu = np.sqrt( nuda.cst.mmuc2**2 + (nuda.cst.hbc*self.kf_mu)**2 )
|
|
360
360
|
#: Attribute FFG energy per particle (degeneracy = 2)
|
|
361
|
-
|
|
362
|
-
self.
|
|
361
|
+
# energy
|
|
362
|
+
self.e2v_el, self.e2n_el = feden( 2.0, self.kf_el, nuda.cst.mec2 )
|
|
363
|
+
self.e2v_mu, self.e2n_mu = feden( 2.0, self.kf_mu, nuda.cst.mmuc2 )
|
|
363
364
|
self.e2v_lep = self.e2v_el + self.e2v_mu
|
|
365
|
+
self.e2n_lep = self.e2v_lep / self.den_lep
|
|
364
366
|
#self.e2a_el = self.e2v_el / self.den_e
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
self.
|
|
368
|
-
self.
|
|
369
|
-
self.
|
|
367
|
+
# internal energy
|
|
368
|
+
self.e2v_el_int = self.e2v_el - nuda.cst.mec2*self.den_el
|
|
369
|
+
self.e2n_el_int = self.e2v_el_int / self.den_el
|
|
370
|
+
self.e2v_mu_int = self.e2v_mu - nuda.cst.mmuc2*self.den_mu
|
|
371
|
+
self.e2n_mu_int = np.zeros( np.size(self.den_mu) )
|
|
372
|
+
for k,n_mu in enumerate(self.den_mu):
|
|
373
|
+
if n_mu > 0.0:
|
|
374
|
+
self.e2n_mu_int[k] = self.e2v_mu_int[k] / self.den_mu[k]
|
|
375
|
+
self.e2v_lep_int = self.e2v_el_int + self.e2v_mu_int
|
|
376
|
+
self.e2n_lep_int = self.e2v_lep_int / self.den_lep
|
|
370
377
|
#: Attribute FFG pressure (degeneracy = 2)
|
|
371
378
|
self.pre_el = fpres( 2.0, self.kf_el, nuda.cst.mec2)
|
|
372
379
|
self.pre_mu = fpres( 2.0, self.kf_mu, nuda.cst.mmuc2)
|
|
373
|
-
self.pre_lep = self.pre_el + self.pre_mu
|
|
380
|
+
self.pre_lep = self.x_el * self.pre_el + self.x_mu * self.pre_mu
|
|
374
381
|
#: Attribute enthalpy
|
|
375
382
|
self.h2v_el = self.e2v_el + self.pre_el
|
|
376
383
|
self.h2v_mu = self.e2v_mu + self.pre_mu
|