nucleardatapy 0.2.0__py3-none-any.whl → 1.0.0__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/__init__.py +3 -1
- nucleardatapy/astro/setup_gw.py +18 -18
- nucleardatapy/astro/setup_mr.py +9 -1
- nucleardatapy/astro/setup_mup.py +10 -10
- nucleardatapy/corr/setup_EsymDen.py +0 -5
- nucleardatapy/corr/setup_EsymLsym.py +50 -17
- nucleardatapy/corr/setup_KsatQsat.py +170 -69
- nucleardatapy/crust/setup_crust.py +403 -120
- nucleardatapy/data/astro/NICER/J0740+6620.dat +1 -0
- 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-E2A-NM.dat → 2006-BHF-Av18-E2A-NM.dat} +8 -8
- 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/matter/nep/NEPESkyrme.dat +2 -3
- nucleardatapy/data/matter/nep/NEPGSkyrme.dat +7 -0
- nucleardatapy/data/matter/nep/NEPSkyrme.dat +4 -2
- nucleardatapy/data/matter/nep/NEPxEFT.dat +8 -0
- nucleardatapy/data/matter/nep/best67DDSkyrme.dat +28 -0
- nucleardatapy/data/matter/nep/best90DDSkyrme.dat +46 -0
- nucleardatapy/data/matter/nep/best95DDSkyrme.dat +54 -0
- nucleardatapy/data/matter/pheno/ESkyrme/BSk31-NM.dat +996 -996
- nucleardatapy/data/matter/pheno/ESkyrme/BSk31-SM.dat +991 -991
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG4-NM.dat +1002 -0
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG4-SM.dat +1002 -0
- nucleardatapy/data/matter/pheno/Skyrme/BSkG1-NM.dat +102 -0
- nucleardatapy/data/matter/pheno/Skyrme/BSkG1-SM.dat +102 -0
- nucleardatapy/data/matter/pheno/Skyrme/BSkG2-NM.dat +102 -0
- nucleardatapy/data/matter/pheno/Skyrme/BSkG2-SM.dat +102 -0
- nucleardatapy/data/nuclei/masses/Theory/2023-BSkG3.txt +0 -4
- nucleardatapy/data/nuclei/masses/Theory/2025-BSkG4.txt +0 -1
- nucleardatapy/env.py +1 -1
- nucleardatapy/eos/__init__.py +4 -3
- nucleardatapy/eos/setupCC.py +429 -0
- nucleardatapy/eos/setup_am.py +71 -34
- nucleardatapy/eos/setup_am_Beq.py +48 -17
- nucleardatapy/eos/setup_am_Leq.py +81 -50
- nucleardatapy/fig/__init__.py +29 -7
- nucleardatapy/fig/astro_setupGW_fig.py +5 -5
- nucleardatapy/fig/astro_setupMR_fig.py +12 -10
- nucleardatapy/fig/astro_setupMasses_fig.py +4 -4
- nucleardatapy/fig/astro_setupMtov_fig.py +4 -4
- nucleardatapy/fig/astro_setupMup_fig.py +5 -5
- nucleardatapy/fig/corr_setupEsymDen_fig.py +12 -5
- nucleardatapy/fig/corr_setupEsymLsym_fig.py +18 -5
- nucleardatapy/fig/corr_setupKsatQsat_fig.py +19 -15
- nucleardatapy/fig/crust_setupCrust_fig.py +7 -7
- nucleardatapy/fig/eos_setupAMBeq_fig.py +1338 -64
- nucleardatapy/fig/eos_setupAMLeq_fig.py +200 -68
- nucleardatapy/fig/eos_setupAM_asy_lep_fig.py +364 -0
- nucleardatapy/fig/eos_setupAM_asy_nuc_fig.py +337 -0
- nucleardatapy/fig/eos_setupAM_asy_tot_fig.py +343 -0
- nucleardatapy/fig/eos_setupAM_fig.py +470 -47
- nucleardatapy/fig/eos_setupCC_fig.py +240 -0
- nucleardatapy/fig/hnuc_setupChart_fig.py +2 -2
- nucleardatapy/fig/hnuc_setupRE1LExp_fig.py +4 -4
- nucleardatapy/fig/matter_all_fig.py +954 -0
- nucleardatapy/fig/matter_setupCheck_fig.py +103 -0
- nucleardatapy/fig/matter_setupFFGLep_fig.py +70 -0
- nucleardatapy/fig/matter_setupFFGNuc_fig.py +268 -104
- nucleardatapy/fig/matter_setupHIC_fig.py +98 -58
- nucleardatapy/fig/matter_setupMicroEsym_fig.py +267 -51
- nucleardatapy/fig/matter_setupMicro_LP_fig.py +175 -78
- nucleardatapy/fig/matter_setupMicro_band_fig.py +116 -47
- nucleardatapy/fig/matter_setupMicro_effmass_fig.py +264 -34
- nucleardatapy/fig/matter_setupMicro_err_NM_fig.py +41 -18
- nucleardatapy/fig/matter_setupMicro_fig.py +332 -98
- nucleardatapy/fig/matter_setupMicro_gap_fig.py +219 -92
- nucleardatapy/fig/matter_setupNEPStats_fig.py +96 -0
- nucleardatapy/fig/matter_setupPhenoEsym_fig.py +201 -61
- nucleardatapy/fig/matter_setupPheno_fig.py +392 -85
- nucleardatapy/fig/nuc_setupBEExp_chart_fig.py +286 -0
- nucleardatapy/fig/nuc_setupBEExp_fig.py +232 -70
- nucleardatapy/fig/nuc_setupBETheo_fig.py +344 -0
- nucleardatapy/fig/nuc_setupISGMRExp_fig.py +59 -0
- nucleardatapy/fig/nuc_setupRchExp_fig.py +139 -0
- nucleardatapy/fig/nuc_setupRchTheo_fig.py +143 -0
- nucleardatapy/fig/nuc_setupRnpExp_fig.py +88 -0
- nucleardatapy/fig/nuc_setupRnpTheo_fig.py +133 -0
- nucleardatapy/hello.py +6 -0
- nucleardatapy/hnuc/__init__.py +3 -3
- nucleardatapy/hnuc/{setup_be1L_exp.py → setup_re1L_exp.py} +6 -6
- nucleardatapy/hnuc/{setup_be1Xi_exp.py → setup_re1Xi_exp.py} +5 -5
- nucleardatapy/hnuc/{setup_be2L_exp.py → setup_re2L_exp.py} +6 -6
- nucleardatapy/matter/__init__.py +14 -13
- nucleardatapy/matter/setup_check.py +97 -0
- nucleardatapy/matter/setup_ffg.py +72 -38
- nucleardatapy/matter/setup_hic.py +91 -74
- nucleardatapy/matter/setup_micro.py +1698 -1019
- nucleardatapy/matter/setup_micro_band.py +11 -6
- nucleardatapy/matter/setup_micro_effmass.py +55 -2
- nucleardatapy/matter/setup_micro_esym.py +39 -34
- nucleardatapy/matter/setup_micro_gap.py +26 -19
- nucleardatapy/matter/setup_micro_lp.py +20 -19
- nucleardatapy/matter/setup_nep.py +175 -92
- nucleardatapy/matter/{setup_nep_model_dist.py → setup_nep_stat_model.py} +13 -8
- nucleardatapy/matter/{setup_nep_dist.py → setup_nep_stat_models.py} +12 -8
- nucleardatapy/matter/setup_pheno.py +121 -45
- nucleardatapy/matter/setup_pheno_esym.py +14 -19
- nucleardatapy/nuc/__init__.py +2 -2
- nucleardatapy/nuc/setup_be_exp.py +345 -333
- nucleardatapy/nuc/setup_be_theo.py +366 -178
- nucleardatapy/nuc/setup_isgmr_exp.py +4 -4
- 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} +59 -65
- nucleardatapy/nuc/{setup_nskin_theo.py → setup_rnp_theo.py} +35 -39
- nucleardatapy-1.0.0.dist-info/METADATA +553 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-1.0.0.dist-info}/RECORD +156 -128
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-1.0.0.dist-info}/WHEEL +1 -1
- tests/test_corr_setupKsatQsat.py +3 -1
- tests/test_matter_setupMicro.py +37 -10
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG1-NM.dat +0 -1002
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG1-SM.dat +0 -1002
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG2-NM.dat +0 -1002
- nucleardatapy/data/matter/pheno/ESkyrme/BSkG2-SM.dat +0 -1002
- nucleardatapy/fig/matter_ENM_fig.py +0 -119
- nucleardatapy/fig/matter_ESM_fig.py +0 -119
- nucleardatapy/fig/matter_Esym_fig.py +0 -122
- nucleardatapy/fig/matter_setupNEPModelDist_fig.py +0 -68
- nucleardatapy-0.2.0.dist-info/METADATA +0 -115
- /nucleardatapy/data/LandauParameters/micro/{2006-IBHF-NM-AV18.dat → 2006-EBHF-NM-AV18.dat} +0 -0
- /nucleardatapy/data/LandauParameters/micro/{2006-IBHF-SM-AV18.dat → 2006-EBHF-SM-AV18.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-BSK14.dat → 2022-GMRS-BSK14.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-BSK16.dat → 2022-GMRS-BSK16.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-DHSL59.dat → 2022-GMRS-DHSL59.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-DHSL69.dat → 2022-GMRS-DHSL69.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-F0.dat → 2022-GMRS-F0.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H1.dat → 2022-GMRS-H1.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H2.dat → 2022-GMRS-H2.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H3.dat → 2022-GMRS-H3.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H4.dat → 2022-GMRS-H4.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H5.dat → 2022-GMRS-H5.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-H7.dat → 2022-GMRS-H7.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-LNS5.dat → 2022-GMRS-LNS5.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-RATP.dat → 2022-GMRS-RATP.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-SGII.dat → 2022-GMRS-SGII.dat} +0 -0
- /nucleardatapy/data/crust/{2022-crustGMRS-SLY5.dat → 2022-GMRS-SLY5.dat} +0 -0
- /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-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/{2013-QMC-NM.dat → 2013-MBPT-NM.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/data/{NeutronSkin/ddrhNskin-208Pb.dat → rnp/ddrhrnp-208Pb.dat} +0 -0
- /nucleardatapy/data/{NeutronSkin/ddrhNskin-48Ca.dat → rnp/ddrhrnp-48Ca.dat} +0 -0
- /nucleardatapy/data/{NeutronSkin/nlrhNskin-208Pb.dat → rnp/nlrhrnp-208Pb.dat} +0 -0
- /nucleardatapy/data/{NeutronSkin/nlrhNskin-48Ca.dat → rnp/nlrhrnp-48Ca.dat} +0 -0
- /nucleardatapy/data/{NeutronSkin/skyrmeNskin-208Pb.dat → rnp/skyrmernp-208Pb.dat} +0 -0
- /nucleardatapy/data/{NeutronSkin/skyrmeNskin-48Ca.dat → rnp/skyrmernp-48Ca.dat} +0 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-1.0.0.dist-info/licenses}/LICENSE +0 -0
- {nucleardatapy-0.2.0.dist-info → nucleardatapy-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import numpy as np
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
from matplotlib.ticker import AutoMinorLocator
|
|
5
|
+
|
|
6
|
+
import nucleardatapy as nuda
|
|
7
|
+
|
|
8
|
+
SOURCE_LABELS_LATEX = {
|
|
9
|
+
"48Ca": r"$^{48}\mathrm{Ca}$",
|
|
10
|
+
"208Pb": r"$^{208}\mathrm{Pb}$"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
def nuc_setupRnpExp_fig(pname=None, source=None):
|
|
14
|
+
print(f"Using source: {source}")
|
|
15
|
+
|
|
16
|
+
# subplot_label = "(a)"
|
|
17
|
+
subplot_label = " "
|
|
18
|
+
|
|
19
|
+
if source is None:
|
|
20
|
+
print("Erro: nenhum source fornecido.")
|
|
21
|
+
return
|
|
22
|
+
|
|
23
|
+
labels = []
|
|
24
|
+
rskin_values = []
|
|
25
|
+
error_lower = []
|
|
26
|
+
error_upper = []
|
|
27
|
+
markers = []
|
|
28
|
+
|
|
29
|
+
cals = nuda.nuc.rnp_exp_source(source)
|
|
30
|
+
|
|
31
|
+
for cal in cals:
|
|
32
|
+
neutron_skin_calc = nuda.nuc.setupRnpExp(source=source, cal=cal)
|
|
33
|
+
|
|
34
|
+
if neutron_skin_calc.rnp is not None:
|
|
35
|
+
labels.append(neutron_skin_calc.label)
|
|
36
|
+
rskin_values.append(neutron_skin_calc.rnp)
|
|
37
|
+
|
|
38
|
+
err_down = neutron_skin_calc.rnp_sig_lo if neutron_skin_calc.rnp_sig_lo is not None else 0.0
|
|
39
|
+
err_up = neutron_skin_calc.rnp_sig_up if neutron_skin_calc.rnp_sig_up is not None else 0.0
|
|
40
|
+
error_lower.append(err_down)
|
|
41
|
+
error_upper.append(err_up)
|
|
42
|
+
|
|
43
|
+
marker = getattr(neutron_skin_calc, "marker", 'o')
|
|
44
|
+
markers.append(marker)
|
|
45
|
+
|
|
46
|
+
if not rskin_values:
|
|
47
|
+
print(f"Nenhum dado disponível para {source}.")
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
fig, ax = plt.subplots(figsize=(10, 8))
|
|
51
|
+
x_positions = range(len(labels) + 1)
|
|
52
|
+
|
|
53
|
+
for i, (x, y, err_down, err_up, marker) in enumerate(zip(x_positions, rskin_values, error_lower, error_upper, markers)):
|
|
54
|
+
adjusted_err_down = min(err_down, 0.2)
|
|
55
|
+
adjusted_err_up = min(err_up, 0.2)
|
|
56
|
+
|
|
57
|
+
ax.errorbar(x, y, yerr=[[adjusted_err_down], [adjusted_err_up]], fmt=marker, markersize=8, capsize=0, label=labels[i])
|
|
58
|
+
|
|
59
|
+
if err_down >= 1000:
|
|
60
|
+
ax.plot([x], [y - adjusted_err_down], marker="v", color="grey", markersize=8)
|
|
61
|
+
if err_up >= 1000:
|
|
62
|
+
ax.plot([x], [y + adjusted_err_up], marker="^", color="grey", markersize=8)
|
|
63
|
+
|
|
64
|
+
nsav = nuda.nuc.setupRnpAverage(source=source)
|
|
65
|
+
if nsav.rnp_cen is not None:
|
|
66
|
+
ax.errorbar(len(labels), nsav.rnp_cen, yerr=nsav.sig_std, label=nsav.label,
|
|
67
|
+
color='red', marker='o', markersize=10, linestyle='solid', linewidth=3)
|
|
68
|
+
labels.append(nsav.label)
|
|
69
|
+
|
|
70
|
+
ax.set_ylim([0, 0.5])
|
|
71
|
+
ax.set_xticks(x_positions)
|
|
72
|
+
ax.set_xticklabels(labels, rotation=45, ha="right", fontsize=15)
|
|
73
|
+
ax.tick_params(axis='y', labelsize=15)
|
|
74
|
+
ax.set_ylabel(rf"$R_{{\rm{{skin}}}}$ {SOURCE_LABELS_LATEX[source]} (fm)", fontsize=15)
|
|
75
|
+
ax.text(0.95, 0.95, subplot_label, transform=ax.transAxes, fontsize=15,
|
|
76
|
+
verticalalignment='top', horizontalalignment='right')
|
|
77
|
+
ax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
78
|
+
ax.tick_params(axis='y', which='minor', length=4, color='gray')
|
|
79
|
+
|
|
80
|
+
if pname is None:
|
|
81
|
+
output_dir = os.path.abspath("figs/")
|
|
82
|
+
os.makedirs(output_dir, exist_ok=True)
|
|
83
|
+
pname = os.path.join(output_dir, f"plot_nuc_setupRnp_Exp_{source.replace(' ', '_')}.png")
|
|
84
|
+
|
|
85
|
+
plt.tight_layout()
|
|
86
|
+
plt.savefig(pname, dpi=200)
|
|
87
|
+
plt.close()
|
|
88
|
+
print(f"Plot saved: {pname}")
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
from matplotlib.ticker import AutoMinorLocator # Import para minor ticks
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
import nucleardatapy as nuda
|
|
7
|
+
|
|
8
|
+
# Dictionary to map sources to LaTeX names
|
|
9
|
+
SOURCE_LABELS_LATEX = {
|
|
10
|
+
"48Ca": r"$^{48}\mathrm{Ca}$",
|
|
11
|
+
"208Pb": r"$^{208}\mathrm{Pb}$"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
# Directory containing the model data tables
|
|
15
|
+
MODEL_TABLES_DIR = nuda.param.path_data + '/rnp/'
|
|
16
|
+
|
|
17
|
+
# Define markers and colors for each model
|
|
18
|
+
MODEL_STYLES = {
|
|
19
|
+
"skyrme": {"color": "blue", "marker": "s", "label": "Skyrme"},
|
|
20
|
+
"nlrh": {"color": "red", "marker": "^", "label": "NLRH"},
|
|
21
|
+
"ddrh": {"color": "green", "marker": "D", "label": "DDRH"}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def read_model_data(directory, source):
|
|
25
|
+
model_data = {}
|
|
26
|
+
for filename in os.listdir(directory):
|
|
27
|
+
if filename.endswith(".dat") and source in filename:
|
|
28
|
+
model_name = filename.split("rnp")[0].lower()
|
|
29
|
+
filepath = os.path.join(directory, filename)
|
|
30
|
+
data = []
|
|
31
|
+
with open(filepath, 'r') as file:
|
|
32
|
+
for line in file:
|
|
33
|
+
if line.startswith("#") or not line.strip():
|
|
34
|
+
continue
|
|
35
|
+
parts = line.split()
|
|
36
|
+
param = parts[0]
|
|
37
|
+
rn, rp, rskin = map(float, parts[1:4])
|
|
38
|
+
data.append((param, rn, rp, rskin))
|
|
39
|
+
model_data[model_name] = np.array(data, dtype=object)
|
|
40
|
+
if nuda.env.verb:
|
|
41
|
+
print(f"Loaded model data for {model_name}: {model_data[model_name]}")
|
|
42
|
+
return model_data
|
|
43
|
+
|
|
44
|
+
def nuc_setupRnpTheo_fig(pname, source):
|
|
45
|
+
print(f'Plot name: {pname}')
|
|
46
|
+
print(f'Using source: {source}')
|
|
47
|
+
|
|
48
|
+
# subplot_label = "(a)" # remove this if you don't want any labels
|
|
49
|
+
subplot_label = " "
|
|
50
|
+
|
|
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.rnp is not None:
|
|
61
|
+
labels.append(neutron_skin_calc.label)
|
|
62
|
+
rskin_values.append(neutron_skin_calc.rnp)
|
|
63
|
+
xexp.append(i)
|
|
64
|
+
err_down = neutron_skin_calc.rnp_sig_lo if neutron_skin_calc.rnp_sig_lo is not None else 0.0
|
|
65
|
+
err_up = neutron_skin_calc.rnp_sig_up if neutron_skin_calc.rnp_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.rnp_cen is not None:
|
|
101
|
+
ax.errorbar(len(labels), nsav.rnp_cen, yerr=nsav.sig_std, label=nsav.label,
|
|
102
|
+
color='k', marker='o', markersize=10, linestyle='solid', linewidth=3)
|
|
103
|
+
|
|
104
|
+
for i, (x, y, marker, color) in enumerate(zip(xtheo, combined_rskin, combined_markers, combined_colors)):
|
|
105
|
+
ax.plot(x, y, marker=marker, markersize=8, color=color)
|
|
106
|
+
|
|
107
|
+
# Add legend for experimental points
|
|
108
|
+
ax.scatter([], [], color='black', marker='o', facecolors='none', label='Experimental/Analysis')
|
|
109
|
+
|
|
110
|
+
# Add legend for theoretical models
|
|
111
|
+
for model_name, style in MODEL_STYLES.items():
|
|
112
|
+
ax.scatter([], [], color=style["color"], marker=style["marker"], label=style["label"])
|
|
113
|
+
|
|
114
|
+
ax.set_ylim([0, 0.5])
|
|
115
|
+
ax.set_xticks(xexp)
|
|
116
|
+
ax.set_xticklabels(labels, rotation=45, ha="right", fontsize=15)
|
|
117
|
+
ax.set_ylabel(rf"$R_{{\rm{{skin}}}}$ {SOURCE_LABELS_LATEX[source]} (fm)", fontsize=15)
|
|
118
|
+
ax.text(0.95, 0.95, subplot_label, transform=ax.transAxes, fontsize=15, verticalalignment='top', horizontalalignment='right')
|
|
119
|
+
|
|
120
|
+
# Add minor ticks on y-axis
|
|
121
|
+
ax.yaxis.set_minor_locator(AutoMinorLocator())
|
|
122
|
+
ax.tick_params(axis='y', which='minor', length=4, color='gray')
|
|
123
|
+
|
|
124
|
+
ax.legend(loc="upper right", bbox_to_anchor=(0.5, 1), fontsize=12)
|
|
125
|
+
|
|
126
|
+
output_dir = "figs/"
|
|
127
|
+
os.makedirs(output_dir, exist_ok=True)
|
|
128
|
+
fig_name = os.path.join(output_dir, f"plot_nuc_setupRnpTheo_source{source.replace(' ', '_')}.png")
|
|
129
|
+
plt.tight_layout()
|
|
130
|
+
plt.savefig(fig_name, dpi=200)
|
|
131
|
+
plt.close()
|
|
132
|
+
|
|
133
|
+
print(f"Plot saved: {fig_name}")
|
nucleardatapy/hello.py
ADDED
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
|
#
|
|
@@ -150,16 +150,16 @@ class setupRE1LExp():
|
|
|
150
150
|
#: Attribute A (mass of the nucleus).
|
|
151
151
|
self.A = self.Z + self.N + np.ones(len(self.N),dtype=int)
|
|
152
152
|
#: charge of the hypernuclei (=Z, since Lamnda is charged 0)
|
|
153
|
-
self.
|
|
153
|
+
self.Q = self.Z
|
|
154
154
|
#: Strangness number
|
|
155
|
-
self.S = -
|
|
155
|
+
self.S = -1*np.ones(len(self.N),dtype=int)
|
|
156
156
|
#: symbol representing the nucleus
|
|
157
157
|
self.symb = nucSymb
|
|
158
|
-
#: Attribute the
|
|
158
|
+
#: Attribute the s.p. state.
|
|
159
159
|
self.sps = nucsps
|
|
160
160
|
#: Attribute the angular momentum of the state.
|
|
161
161
|
self.ell = np.array( nucell, dtype = int )
|
|
162
|
-
#: Attribute 1L
|
|
162
|
+
#: Attribute 1L removal energy in MeV.
|
|
163
163
|
self.lre = np.array( nuclre, dtype = float )
|
|
164
164
|
#: Attribute 1L binding energy error in MeV.
|
|
165
165
|
self.lre_err = np.array( nuclre_err, dtype = float )
|
|
@@ -204,7 +204,7 @@ class setupRE1LExp():
|
|
|
204
204
|
if any(self.Z): print(f" Z: {self.Z}")
|
|
205
205
|
if any(self.N): print(f" N: {self.N}")
|
|
206
206
|
if any(self.S): print(f" S: {self.S}")
|
|
207
|
-
if any(self.
|
|
207
|
+
if any(self.Q): print(f" Q: {self.Q}")
|
|
208
208
|
if any(self.symb): print(f" symb: {self.symb}")
|
|
209
209
|
if any(self.ell): print(f" ell: {self.ell}")
|
|
210
210
|
if any(self.lre): print(f" re: {self.lre}")
|
|
@@ -225,7 +225,7 @@ class setupRE1LExp():
|
|
|
225
225
|
print(rf" index & Z & N & S & ch & symb & $RE$ & Ref. \\\\")
|
|
226
226
|
print(rf" & & & & & & (MeV) & \\\\")
|
|
227
227
|
for ind,A in enumerate(self.A):
|
|
228
|
-
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.
|
|
228
|
+
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.Q[ind]} & {self.symb[ind]} & ${self.lre[ind]:.3f}\pm {self.lre_err[ind]:.3f}$ & \cite{{"+self.keyref+"} \\\\")
|
|
229
229
|
else:
|
|
230
230
|
print(f"- No table for source {self.table} (average). To get table, write 'verb_latex = True' in env.py.")
|
|
231
231
|
#
|
|
@@ -117,12 +117,12 @@ class setupRE1XiExp():
|
|
|
117
117
|
#: Strangness number (to be checked)
|
|
118
118
|
self.S = -2*np.ones(len(self.N),dtype=int)
|
|
119
119
|
#: charge of the hypernuclei (=Z-1, since Xi is charged -1)
|
|
120
|
-
self.
|
|
120
|
+
self.Q = self.Z - np.ones(len(self.N),dtype=int)
|
|
121
121
|
#: symbol representing the nucleus
|
|
122
122
|
self.symb = nucSymb
|
|
123
|
-
#: Attribute
|
|
123
|
+
#: Attribute 1Xi removal energy in MeV.
|
|
124
124
|
self.xire = np.array( nucxire, dtype = float )
|
|
125
|
-
#: Attribute
|
|
125
|
+
#: Attribute 1Xi removal energy error in MeV.
|
|
126
126
|
self.xire_err = np.array( nucxire_err, dtype = float )
|
|
127
127
|
#: Attribute the probe.
|
|
128
128
|
self.probe = probe
|
|
@@ -162,7 +162,7 @@ class setupRE1XiExp():
|
|
|
162
162
|
if any(self.Z): print(f" Z: {self.Z}")
|
|
163
163
|
if any(self.N): print(f" N: {self.N}")
|
|
164
164
|
if any(self.S): print(f" S: {self.S}")
|
|
165
|
-
if any(self.
|
|
165
|
+
if any(self.Q): print(f" Q: {self.Q}")
|
|
166
166
|
if any(self.symb): print(f" symb: {self.symb}")
|
|
167
167
|
if any(self.xire): print(f" xibe: {self.xire}")
|
|
168
168
|
if any(self.xire_err): print(f" xibe_err: {self.xire_err}")
|
|
@@ -183,7 +183,7 @@ class setupRE1XiExp():
|
|
|
183
183
|
print(rf" index & Z & N & S & ch & symb & RE & & Ref. \\\\")
|
|
184
184
|
print(rf" & & & & & & (MeV) & & \\\\")
|
|
185
185
|
for ind,A in enumerate(self.A):
|
|
186
|
-
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.
|
|
186
|
+
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.Q[ind]} & {self.symb[ind]} & ${self.xire[ind]:.3f}\pm {self.xire_err[ind]:.3f}$ & & \\cite{{"+self.keyref+"} \\\\")
|
|
187
187
|
else:
|
|
188
188
|
print(f"- No table for source {self.table} (average). To get table, write 'verb_latex = True' in env.py.")
|
|
189
189
|
#
|
|
@@ -119,14 +119,14 @@ class setupRE2LExp():
|
|
|
119
119
|
#: Attribute A (mass of the nucleus).
|
|
120
120
|
self.A = self.Z + self.N + 2*np.ones(len(self.N),dtype=int)
|
|
121
121
|
#: charge of the hypernuclei (=Z, since Lamnda is charged 0)
|
|
122
|
-
self.
|
|
122
|
+
self.Q = self.Z
|
|
123
123
|
#: Strangness number
|
|
124
|
-
self.S = -2*
|
|
124
|
+
self.S = -2*np.ones(len(self.N),dtype=int)
|
|
125
125
|
#: symbol representing the nucleus
|
|
126
126
|
self.symb = nucSymb
|
|
127
|
-
#: Attribute 2L
|
|
127
|
+
#: Attribute 2L removal energy in MeV.
|
|
128
128
|
self.llre = np.array( nuclre, dtype = float )
|
|
129
|
-
#: Attribute 2L
|
|
129
|
+
#: Attribute 2L removal energy error in MeV.
|
|
130
130
|
self.llre_err = np.array( nuclre_err, dtype = float )
|
|
131
131
|
#: Attribute 2L bond energy in MeV.
|
|
132
132
|
self.lldre = np.array( nucldre, dtype = float )
|
|
@@ -171,7 +171,7 @@ class setupRE2LExp():
|
|
|
171
171
|
if any(self.Z): print(f" Z: {self.Z}")
|
|
172
172
|
if any(self.N): print(f" N: {self.N}")
|
|
173
173
|
if any(self.S): print(f" S: {self.S}")
|
|
174
|
-
if any(self.
|
|
174
|
+
if any(self.Q): print(f" Q: {self.Q}")
|
|
175
175
|
if any(self.symb): print(f" symb: {self.symb}")
|
|
176
176
|
if any(self.llre): print(f" be: {self.llre}")
|
|
177
177
|
if any(self.llre_err): print(f" be_err: {self.llre_err}")
|
|
@@ -193,7 +193,7 @@ class setupRE2LExp():
|
|
|
193
193
|
print(rf" index & Z & N & S & ch & symb & $RE$ & $\Delta RE$ & Ref. \\\\")
|
|
194
194
|
print(rf" & & & & & & (MeV) & (MeV) & \\\\")
|
|
195
195
|
for ind,A in enumerate(self.A):
|
|
196
|
-
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.
|
|
196
|
+
print(rf" {ind} & {self.Z[ind]} & {self.N[ind]} & {self.S[ind]} & {self.Q[ind]} & {self.symb[ind]} & ${self.llre[ind]:.3f}\pm {self.llre_err[ind]:.3f}$ & ${self.lldre[ind]:.3f}\pm {self.lldre_err[ind]:.3f}$ & \\cite{{"+self.keyref+"} \\\\")
|
|
197
197
|
else:
|
|
198
198
|
print(f"- No table for source {self.table} (average). To get table, write 'verb_latex = True' in env.py.")
|
|
199
199
|
#
|
nucleardatapy/matter/__init__.py
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
This module provides microscopic, phenomenological and experimental data constraints.
|
|
3
3
|
"""
|
|
4
4
|
#
|
|
5
|
-
from nucleardatapy.matter.setup_ffg
|
|
6
|
-
from nucleardatapy.matter.setup_micro
|
|
7
|
-
from nucleardatapy.matter.setup_micro_effmass
|
|
8
|
-
from nucleardatapy.matter.setup_micro_gap
|
|
9
|
-
from nucleardatapy.matter.setup_micro_band
|
|
10
|
-
from nucleardatapy.matter.setup_micro_esym
|
|
11
|
-
from nucleardatapy.matter.setup_micro_lp
|
|
12
|
-
from nucleardatapy.matter.setup_pheno
|
|
13
|
-
from nucleardatapy.matter.setup_pheno_esym
|
|
14
|
-
from nucleardatapy.matter.setup_hic
|
|
15
|
-
from nucleardatapy.matter.setup_nep
|
|
16
|
-
from nucleardatapy.matter.
|
|
17
|
-
from nucleardatapy.matter.
|
|
5
|
+
from nucleardatapy.matter.setup_ffg import *
|
|
6
|
+
from nucleardatapy.matter.setup_micro import *
|
|
7
|
+
from nucleardatapy.matter.setup_micro_effmass import *
|
|
8
|
+
from nucleardatapy.matter.setup_micro_gap import *
|
|
9
|
+
from nucleardatapy.matter.setup_micro_band import *
|
|
10
|
+
from nucleardatapy.matter.setup_micro_esym import *
|
|
11
|
+
from nucleardatapy.matter.setup_micro_lp import *
|
|
12
|
+
from nucleardatapy.matter.setup_pheno import *
|
|
13
|
+
from nucleardatapy.matter.setup_pheno_esym import *
|
|
14
|
+
from nucleardatapy.matter.setup_hic import *
|
|
15
|
+
from nucleardatapy.matter.setup_nep import *
|
|
16
|
+
from nucleardatapy.matter.setup_nep_stat_model import *
|
|
17
|
+
from nucleardatapy.matter.setup_nep_stat_models import *
|
|
18
|
+
from nucleardatapy.matter.setup_check import *
|
|
@@ -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_int, 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_int, 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_int, 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_int = 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_int[ind]-band.e2a_int[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_int is not None: print(f" e2a_int: {np.round(self.band.e2a_int,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
|
+
|