nucleardatapy 0.2.1__py3-none-any.whl → 1.0.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.
Files changed (172) hide show
  1. nucleardatapy/__init__.py +3 -1
  2. nucleardatapy/astro/setup_gw.py +18 -18
  3. nucleardatapy/astro/setup_mr.py +123 -33
  4. nucleardatapy/astro/setup_mup.py +10 -10
  5. nucleardatapy/corr/setup_EsymDen.py +0 -5
  6. nucleardatapy/corr/setup_EsymLsym.py +50 -17
  7. nucleardatapy/corr/setup_KsatQsat.py +170 -69
  8. nucleardatapy/create_folder.py +2 -2
  9. nucleardatapy/crust/setup_crust.py +364 -126
  10. nucleardatapy/data/astro/HESS/J1731-347.dat +4 -0
  11. nucleardatapy/data/astro/NICER/J0030+0451.dat +6 -6
  12. nucleardatapy/data/astro/NICER/J0437-4715.dat +4 -3
  13. nucleardatapy/data/astro/NICER/J0614-3329.dat +4 -0
  14. nucleardatapy/data/astro/NICER/J0740+6620.dat +5 -4
  15. nucleardatapy/data/hnuclei/1991-2L-Yamamoto.csv +6 -0
  16. nucleardatapy/data/hnuclei/2013-2L-Ahn.csv +1 -1
  17. nucleardatapy/data/hnuclei/2019-2L-Ekawa.csv +7 -0
  18. nucleardatapy/data/matter/micro/2006-BHF/2006-BHF-Av18-E2A-NM.dat +8 -8
  19. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-414-E2A.dat +21 -0
  20. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-414-TD.dat +22 -0
  21. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-450-E2A.dat +20 -0
  22. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-450-TD.dat +22 -0
  23. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-500-E2A.dat +23 -0
  24. nucleardatapy/data/matter/micro/2020-SCGF-NM-N3LO-500-TD.dat +22 -0
  25. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-414-E2A.dat +15 -0
  26. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-414-TD.dat +21 -0
  27. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-450-E2A.dat +15 -0
  28. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-450-TD.dat +21 -0
  29. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-500-E2A.dat +20 -0
  30. nucleardatapy/data/matter/micro/2020-SCGF-SM-N3LO-500-TD.dat +20 -0
  31. nucleardatapy/data/matter/micro/2024-ABI-NM-DeltaNNLO450.dat +28 -0
  32. nucleardatapy/data/matter/micro/2024-ABI-NM-DeltaNNLO500.dat +28 -0
  33. nucleardatapy/data/matter/micro/2024-ABI-NM-DeltaNNLOgo394.dat +28 -0
  34. nucleardatapy/data/matter/micro/2024-ABI-NM-DeltaNNLOgo450.dat +28 -0
  35. nucleardatapy/data/matter/micro/2024-ABI-NM-NNLOsat.dat +28 -0
  36. nucleardatapy/data/matter/micro/2024-ABI-SM-DeltaNNLO450.dat +28 -0
  37. nucleardatapy/data/matter/micro/2024-ABI-SM-DeltaNNLO500.dat +28 -0
  38. nucleardatapy/data/matter/micro/2024-ABI-SM-DeltaNNLOgo394.dat +28 -0
  39. nucleardatapy/data/matter/micro/2024-ABI-SM-DeltaNNLOgo450.dat +28 -0
  40. nucleardatapy/data/matter/micro/2024-ABI-SM-NNLOsat.dat +28 -0
  41. nucleardatapy/data/matter/nep/NEPESkyrme.dat +2 -3
  42. nucleardatapy/data/matter/nep/NEPGSkyrme.dat +7 -0
  43. nucleardatapy/data/matter/nep/NEPSkyrme.dat +4 -2
  44. nucleardatapy/data/matter/nep/NEPxEFT.dat +8 -0
  45. nucleardatapy/data/matter/nep/best67DDSkyrme.dat +28 -0
  46. nucleardatapy/data/matter/nep/best90DDSkyrme.dat +46 -0
  47. nucleardatapy/data/matter/nep/best95DDSkyrme.dat +54 -0
  48. nucleardatapy/data/matter/pheno/ESkyrme/BSk31-NM.dat +996 -996
  49. nucleardatapy/data/matter/pheno/ESkyrme/BSk31-SM.dat +991 -991
  50. nucleardatapy/data/matter/pheno/ESkyrme/BSkG4-NM.dat +1002 -0
  51. nucleardatapy/data/matter/pheno/ESkyrme/BSkG4-SM.dat +1002 -0
  52. nucleardatapy/data/matter/pheno/Skyrme/BSkG1-NM.dat +102 -0
  53. nucleardatapy/data/matter/pheno/Skyrme/BSkG1-SM.dat +102 -0
  54. nucleardatapy/data/matter/pheno/Skyrme/BSkG2-NM.dat +102 -0
  55. nucleardatapy/data/matter/pheno/Skyrme/BSkG2-SM.dat +102 -0
  56. nucleardatapy/env.py +1 -1
  57. nucleardatapy/eos/__init__.py +4 -3
  58. nucleardatapy/eos/setupCC.py +429 -0
  59. nucleardatapy/eos/setup_am.py +39 -14
  60. nucleardatapy/eos/setup_am_Beq.py +40 -15
  61. nucleardatapy/eos/setup_am_Leq.py +40 -15
  62. nucleardatapy/fig/__init__.py +24 -15
  63. nucleardatapy/fig/astro_setupGW_fig.py +9 -7
  64. nucleardatapy/fig/astro_setupMR_fig.py +26 -18
  65. nucleardatapy/fig/astro_setupMasses_fig.py +8 -6
  66. nucleardatapy/fig/astro_setupMtov_fig.py +10 -6
  67. nucleardatapy/fig/astro_setupMup_fig.py +9 -7
  68. nucleardatapy/fig/corr_setupEsymDen_fig.py +22 -9
  69. nucleardatapy/fig/corr_setupEsymLsym_fig.py +25 -8
  70. nucleardatapy/fig/corr_setupKsatQsat_fig.py +23 -17
  71. nucleardatapy/fig/crust_setupCrust_fig.py +11 -9
  72. nucleardatapy/fig/eos_setupAMBeq_fig.py +641 -156
  73. nucleardatapy/fig/eos_setupAMLeq_fig.py +53 -50
  74. nucleardatapy/fig/eos_setupAM_asy_lep_fig.py +373 -0
  75. nucleardatapy/fig/eos_setupAM_asy_nuc_fig.py +346 -0
  76. nucleardatapy/fig/eos_setupAM_asy_tot_fig.py +352 -0
  77. nucleardatapy/fig/eos_setupAM_fig.py +519 -0
  78. nucleardatapy/fig/eos_setupCC_fig.py +270 -0
  79. nucleardatapy/fig/hnuc_setupChart_fig.py +19 -16
  80. nucleardatapy/fig/hnuc_setupRE1LExp_fig.py +15 -5
  81. nucleardatapy/fig/matter_all_fig.py +971 -0
  82. nucleardatapy/fig/matter_setupCheck_fig.py +106 -0
  83. nucleardatapy/fig/matter_setupFFGLep_fig.py +74 -0
  84. nucleardatapy/fig/matter_setupFFGNuc_fig.py +286 -115
  85. nucleardatapy/fig/matter_setupHIC_fig.py +107 -67
  86. nucleardatapy/fig/matter_setupMicroEsym_fig.py +259 -73
  87. nucleardatapy/fig/matter_setupMicro_LP_fig.py +185 -82
  88. nucleardatapy/fig/matter_setupMicro_band_fig.py +126 -53
  89. nucleardatapy/fig/matter_setupMicro_effmass_fig.py +253 -77
  90. nucleardatapy/fig/matter_setupMicro_err_NM_fig.py +45 -20
  91. nucleardatapy/fig/matter_setupMicro_fig.py +317 -77
  92. nucleardatapy/fig/matter_setupMicro_gap_fig.py +237 -100
  93. nucleardatapy/fig/matter_setupNEPStats_fig.py +106 -0
  94. nucleardatapy/fig/matter_setupPhenoEsym_fig.py +204 -65
  95. nucleardatapy/fig/matter_setupPheno_fig.py +395 -93
  96. nucleardatapy/fig/nuc_setupBEExp_chart_fig.py +93 -73
  97. nucleardatapy/fig/nuc_setupBEExp_fig.py +97 -87
  98. nucleardatapy/fig/nuc_setupBETheo_fig.py +114 -81
  99. nucleardatapy/fig/nuc_setupISGMRExp_fig.py +12 -15
  100. nucleardatapy/fig/nuc_setupRchExp_fig.py +14 -22
  101. nucleardatapy/fig/nuc_setupRchTheo_fig.py +37 -40
  102. nucleardatapy/fig/nuc_setupRnpExp_fig.py +86 -106
  103. nucleardatapy/fig/nuc_setupRnpTheo_fig.py +105 -94
  104. nucleardatapy/hello.py +6 -0
  105. nucleardatapy/hnuc/setup_re1L_exp.py +6 -6
  106. nucleardatapy/hnuc/setup_re1Xi_exp.py +5 -5
  107. nucleardatapy/hnuc/setup_re2L_exp.py +36 -13
  108. nucleardatapy/matter/__init__.py +14 -14
  109. nucleardatapy/matter/setup_check.py +6 -6
  110. nucleardatapy/matter/setup_ffg.py +66 -39
  111. nucleardatapy/matter/setup_hic.py +91 -74
  112. nucleardatapy/matter/setup_micro.py +2033 -1007
  113. nucleardatapy/matter/setup_micro_band.py +6 -6
  114. nucleardatapy/matter/setup_micro_esym.py +56 -54
  115. nucleardatapy/matter/setup_micro_gap.py +24 -17
  116. nucleardatapy/matter/setup_micro_lp.py +2 -2
  117. nucleardatapy/matter/setup_nep.py +175 -92
  118. nucleardatapy/matter/{setup_nep_model_dist.py → setup_nep_stat_model.py} +13 -8
  119. nucleardatapy/matter/{setup_nep_dist.py → setup_nep_stat_models.py} +12 -8
  120. nucleardatapy/matter/setup_pheno.py +129 -49
  121. nucleardatapy/matter/setup_pheno_esym.py +22 -19
  122. nucleardatapy/nuc/setup_be_exp.py +306 -292
  123. nucleardatapy/nuc/setup_be_theo.py +288 -105
  124. nucleardatapy/nuc/setup_isgmr_exp.py +4 -4
  125. nucleardatapy/nuc/setup_rnp_exp.py +1 -0
  126. nucleardatapy/nuc/setup_rnp_theo.py +2 -1
  127. {nucleardatapy-0.2.1.dist-info → nucleardatapy-1.0.1.dist-info}/METADATA +48 -16
  128. {nucleardatapy-0.2.1.dist-info → nucleardatapy-1.0.1.dist-info}/RECORD +157 -124
  129. {nucleardatapy-0.2.1.dist-info → nucleardatapy-1.0.1.dist-info}/WHEEL +1 -1
  130. tests/test_corr_setupKsatQsat.py +3 -1
  131. tests/test_matter_setupMicro.py +37 -10
  132. nucleardatapy/data/matter/pheno/ESkyrme/BSkG1-NM.dat +0 -1002
  133. nucleardatapy/data/matter/pheno/ESkyrme/BSkG1-SM.dat +0 -1002
  134. nucleardatapy/data/matter/pheno/ESkyrme/BSkG2-NM.dat +0 -1002
  135. nucleardatapy/data/matter/pheno/ESkyrme/BSkG2-SM.dat +0 -1002
  136. nucleardatapy/fig/eos_setupAM_e_asy_lep_fig.py +0 -125
  137. nucleardatapy/fig/eos_setupAM_e_asy_nuc_fig.py +0 -115
  138. nucleardatapy/fig/eos_setupAM_e_asy_tot_fig.py +0 -117
  139. nucleardatapy/fig/eos_setupAM_e_fig.py +0 -173
  140. nucleardatapy/fig/matter_ENM_fig.py +0 -128
  141. nucleardatapy/fig/matter_ESM_fig.py +0 -140
  142. nucleardatapy/fig/matter_Esym_fig.py +0 -134
  143. nucleardatapy/fig/matter_cs2_fig.py +0 -83
  144. nucleardatapy/fig/matter_preNM_fig.py +0 -146
  145. nucleardatapy/fig/matter_preSM_fig.py +0 -144
  146. nucleardatapy/fig/matter_setupNEPModelDist_fig.py +0 -68
  147. /nucleardatapy/data/LandauParameters/micro/{2006-IBHF-NM-AV18.dat → 2006-EBHF-NM-AV18.dat} +0 -0
  148. /nucleardatapy/data/LandauParameters/micro/{2006-IBHF-SM-AV18.dat → 2006-EBHF-SM-AV18.dat} +0 -0
  149. /nucleardatapy/data/crust/{2022-crustGMRS-BSK14.dat → 2022-GMRS-BSK14.dat} +0 -0
  150. /nucleardatapy/data/crust/{2022-crustGMRS-BSK16.dat → 2022-GMRS-BSK16.dat} +0 -0
  151. /nucleardatapy/data/crust/{2022-crustGMRS-DHSL59.dat → 2022-GMRS-DHSL59.dat} +0 -0
  152. /nucleardatapy/data/crust/{2022-crustGMRS-DHSL69.dat → 2022-GMRS-DHSL69.dat} +0 -0
  153. /nucleardatapy/data/crust/{2022-crustGMRS-F0.dat → 2022-GMRS-F0.dat} +0 -0
  154. /nucleardatapy/data/crust/{2022-crustGMRS-H1.dat → 2022-GMRS-H1.dat} +0 -0
  155. /nucleardatapy/data/crust/{2022-crustGMRS-H2.dat → 2022-GMRS-H2.dat} +0 -0
  156. /nucleardatapy/data/crust/{2022-crustGMRS-H3.dat → 2022-GMRS-H3.dat} +0 -0
  157. /nucleardatapy/data/crust/{2022-crustGMRS-H4.dat → 2022-GMRS-H4.dat} +0 -0
  158. /nucleardatapy/data/crust/{2022-crustGMRS-H5.dat → 2022-GMRS-H5.dat} +0 -0
  159. /nucleardatapy/data/crust/{2022-crustGMRS-H7.dat → 2022-GMRS-H7.dat} +0 -0
  160. /nucleardatapy/data/crust/{2022-crustGMRS-LNS5.dat → 2022-GMRS-LNS5.dat} +0 -0
  161. /nucleardatapy/data/crust/{2022-crustGMRS-RATP.dat → 2022-GMRS-RATP.dat} +0 -0
  162. /nucleardatapy/data/crust/{2022-crustGMRS-SGII.dat → 2022-GMRS-SGII.dat} +0 -0
  163. /nucleardatapy/data/crust/{2022-crustGMRS-SLY5.dat → 2022-GMRS-SLY5.dat} +0 -0
  164. /nucleardatapy/data/matter/micro/{2013-QMC-NM.dat → 2013-MBPT-NM.dat} +0 -0
  165. /nucleardatapy/data/{NeutronSkin/ddrhNskin-208Pb.dat → rnp/ddrhrnp-208Pb.dat} +0 -0
  166. /nucleardatapy/data/{NeutronSkin/ddrhNskin-48Ca.dat → rnp/ddrhrnp-48Ca.dat} +0 -0
  167. /nucleardatapy/data/{NeutronSkin/nlrhNskin-208Pb.dat → rnp/nlrhrnp-208Pb.dat} +0 -0
  168. /nucleardatapy/data/{NeutronSkin/nlrhNskin-48Ca.dat → rnp/nlrhrnp-48Ca.dat} +0 -0
  169. /nucleardatapy/data/{NeutronSkin/skyrmeNskin-208Pb.dat → rnp/skyrmernp-208Pb.dat} +0 -0
  170. /nucleardatapy/data/{NeutronSkin/skyrmeNskin-48Ca.dat → rnp/skyrmernp-48Ca.dat} +0 -0
  171. {nucleardatapy-0.2.1.dist-info → nucleardatapy-1.0.1.dist-info}/licenses/LICENSE +0 -0
  172. {nucleardatapy-0.2.1.dist-info → nucleardatapy-1.0.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,429 @@
1
+ import math
2
+ import numpy as np # 1.15.0
3
+ from scipy.interpolate import CubicSpline
4
+
5
+ import nucleardatapy as nuda
6
+
7
+
8
+ def denCC_emp(nsat, Esym, Lsym, Ksym, Qsym, emp):
9
+ varEsym = Esym / 30.0
10
+ varLsym = Lsym / 70.0
11
+ den_cc = 0.0
12
+ pre_cc = 0.0
13
+ x01 = (0.1 - nsat) / (3.0 * nsat)
14
+ if emp == "Simple":
15
+ den_cc = 0.5 * nsat
16
+ elif emp == "Ducoin":
17
+ den_cc = 0.0802 + 0.000323 * (Lsym + 0.426 * Ksym + (Ksym + 0.426 * Qsym) * x01)
18
+ pre_cc = -0.328 + 0.00959 * (Lsym - 0.343 * Ksym + (Ksym - 0.343 * Qsym) * x01)
19
+ elif emp == "Newton":
20
+ den_cc = (varEsym) * (0.135 - 0.098 * varLsym + 0.026 * varLsym**2)
21
+ pre_cc = -0.724 + 0.0157 * (
22
+ Lsym - 0.343 * Ksym**2 + (1 - 2 * 0.343 * Qsym) * x01 * Ksym
23
+ )
24
+ elif emp == "Steiner":
25
+ den_cc = (varEsym) * (0.1327 - 0.0898 * varLsym + 0.0228 * varLsym**2)
26
+ else:
27
+ print("setupCC, denCC_emp: `emp` is badly defined ", emp)
28
+ print("setupCC, denCC_emp: exit")
29
+ exit()
30
+ return den_cc, pre_cc # in fm-3 and MeV fm-3
31
+
32
+
33
+ class setupCC:
34
+ """
35
+ Instantiate the object with a full EoS for the crust and the core of neutron stars.
36
+
37
+ :param crust_model: Fix the name of model for the crust. Default value: '1998-VAR-AM-APR'.
38
+ :type crust_model: str, optional.
39
+ :param core_model: Fix the name of model. Default value: '1998-VAR-AM-APR'.
40
+ :type core_model: str, optional.
41
+ :param core_param: Fix the name of model. Default value: None.
42
+ :type core_param: str, optional.
43
+ :param core_kind: chose between 'micro' (default) and 'pheno'.
44
+ :type core_kind: str, optional.
45
+ :param connect: choose between 'density' in fm-3 (default), 'epsilon' in MeV fm-3 or 'pressure' in MeV fm-3.
46
+ :type connect: str, optional.
47
+ :param boundaries: list [ b_down, b_up ] containing the boundaries for the connection.
48
+ :type boundaries: list, optional.
49
+ :param emp: choose between different empirical formulae to localise the crust-core transition: None (default) in case of no use of empirical relations, 'simple' for the simple one and 'Steiner' for the empirical relation suggested by A. Steiner. note that if `emp' is taken to be another value that None, this choice will be considered above the boundary limits given in `boundary`.
50
+ :type emp: str, optional.
51
+
52
+ **Attributes:**
53
+ """
54
+
55
+ #
56
+ def __init__(
57
+ self,
58
+ crust_model,
59
+ core_model="1998-VAR-AM-APR",
60
+ core_param=None,
61
+ core_kind="micro",
62
+ connect="density",
63
+ boundaries=[0.016, 0.16],
64
+ emp=None,
65
+ ):
66
+ """
67
+ Parameters
68
+ ----------
69
+ core_model : str, optional
70
+ The model to consider. Choose between: 1998-VAR-AM-APR (default), 2008-AFDMC-NM, ...
71
+ core_kind : chose between 'micro' or 'pheno'.
72
+ """
73
+ #
74
+ if nuda.env.verb:
75
+ print("Enter setupCC()")
76
+ #
77
+ #: Attribute models.
78
+ self.crust_model = crust_model
79
+ self.core_model = core_model
80
+ if nuda.env.verb:
81
+ print("crust_model:", crust_model)
82
+ if nuda.env.verb:
83
+ print("core_model:", core_model)
84
+ #
85
+ self = setupCC.init_self(self)
86
+ #
87
+ if core_param is not None:
88
+ self.label = connect
89
+ # self.label = crust_model+' '+core_model+' '+core_param+' '+connect
90
+ else:
91
+ self.label = connect
92
+ # self.label = crust_model+' '+core_model+' '+connect
93
+ self.every = 1
94
+ self.linestyle = "solid"
95
+ self.marker = "o"
96
+ #
97
+ # Fixes the crust EoS
98
+ #
99
+ crust_models, crust_models_lower = nuda.crust.crust_models()
100
+ #
101
+ if crust_model.lower() not in crust_models_lower:
102
+ print(
103
+ "setupCC.py: The crust_model name ",
104
+ crust_model,
105
+ " is not in the list of models.",
106
+ )
107
+ print("setupCC.py: list of models:", crust_models)
108
+ print("setupCC.py: -- Exit the code --")
109
+ exit()
110
+ #
111
+ crust_eos = nuda.crust.setupCrust(model=crust_model)
112
+ if nuda.env.verb_output:
113
+ crust_eos.print_outputs()
114
+ #
115
+ # Fixes the core EoS at beta-equilibrium
116
+ #
117
+ if core_kind == "micro":
118
+ models, models_lower = nuda.matter.micro_esym_models()
119
+ models.remove("1998-VAR-AM-APR-fit")
120
+ models_lower.remove("1998-var-am-apr-fit")
121
+ elif core_kind == "pheno":
122
+ models, models_lower = nuda.matter.pheno_esym_models()
123
+ #
124
+ if core_model.lower() not in models_lower:
125
+ print(
126
+ "setupCC.py: The core_model name ",
127
+ core_model,
128
+ " is not in the list of models.",
129
+ )
130
+ print("setupCC.py: list of models:", models)
131
+ print("setupCC.py: -- Exit the code --")
132
+ exit()
133
+ #
134
+ core_eos = nuda.eos.setupAMBeq(
135
+ model=core_model, param=core_param, kind=core_kind
136
+ )
137
+ if nuda.env.verb_output:
138
+ core_eos.print_outputs()
139
+ #
140
+ print("crust:")
141
+ print("densities:", crust_eos.den)
142
+ print("eps:", crust_eos.eps_tot)
143
+ print("pre:", crust_eos.pre_tot)
144
+ print("cs2", crust_eos.cs2_tot)
145
+ print("core:")
146
+ print("densities:", core_eos.den)
147
+ print("eps:", core_eos.eps_tot)
148
+ print("pre:", core_eos.pre_tot)
149
+ print("cs2", core_eos.cs2_tot)
150
+ #
151
+ # connects crust and core, depending on the variable `connect`:
152
+ #
153
+ eos_den = []
154
+ eos_eps = []
155
+ eos_pre = []
156
+ eos_cs2 = []
157
+ corx_den = []
158
+ corx_eps = []
159
+ corx_pre = []
160
+ corx_cs2 = []
161
+ crux_den = []
162
+ crux_eps = []
163
+ crux_pre = []
164
+ crux_cs2 = []
165
+ #
166
+ print("CC connection:")
167
+ if connect == "density":
168
+ #
169
+ print("density")
170
+ #
171
+ if emp is not None:
172
+ nsat = crust_eos.nsat
173
+ Esym = crust_eos.Esym
174
+ Lsym = crust_eos.Lsym
175
+ Ksym = crust_eos.Ksym
176
+ Qsym = crust_eos.Qsym
177
+ # print('crust NEP:',nsat,Esym,Lsym)
178
+ # opens a small gap -+20% of the empirical density
179
+ b_lo = 0.8 * denCC_emp(nsat, Esym, Lsym, Ksym, Qsym, emp)[0]
180
+ b_up = 1.2 * b_lo / 0.8
181
+ else:
182
+ b_lo = boundaries[0]
183
+ b_up = boundaries[1]
184
+ print("Boundaries:", b_lo, b_up)
185
+ for ind, den in enumerate(crust_eos.den):
186
+ if den < b_lo:
187
+ eos_den.append(den)
188
+ eos_eps.append(crust_eos.eps_tot[ind])
189
+ eos_pre.append(crust_eos.pre_tot[ind])
190
+ eos_cs2.append(crust_eos.cs2_tot[ind])
191
+ else:
192
+ crux_den.append(den)
193
+ crux_eps.append(crust_eos.eps_tot[ind])
194
+ crux_pre.append(crust_eos.pre_tot[ind])
195
+ crux_cs2.append(crust_eos.cs2_tot[ind])
196
+ for ind, den in enumerate(core_eos.den):
197
+ if den > b_up:
198
+ eos_den.append(den)
199
+ eos_eps.append(core_eos.eps_tot[ind])
200
+ eos_pre.append(core_eos.pre_tot[ind])
201
+ eos_cs2.append(core_eos.cs2_tot[ind])
202
+ else:
203
+ corx_den.append(den)
204
+ corx_eps.append(core_eos.eps_tot[ind])
205
+ corx_pre.append(core_eos.pre_tot[ind])
206
+ corx_cs2.append(core_eos.cs2_tot[ind])
207
+ #
208
+ elif connect == "epsilon":
209
+ #
210
+ print("epsilon")
211
+ #
212
+ b_lo = boundaries[0]
213
+ b_up = boundaries[1]
214
+ print("Boundaries:", b_lo, b_up)
215
+ for ind, eps in enumerate(crust_eos.eps_tot):
216
+ if eps < b_lo:
217
+ eos_den.append(crust_eos.den[ind])
218
+ eos_eps.append(eps)
219
+ eos_pre.append(crust_eos.pre_tot[ind])
220
+ eos_cs2.append(crust_eos.cs2_tot[ind])
221
+ else:
222
+ crux_den.append(crust_eos.den[ind])
223
+ crux_eps.append(eps)
224
+ crux_pre.append(crust_eos.pre_tot[ind])
225
+ crux_cs2.append(crust_eos.cs2_tot[ind])
226
+ for ind, eps in enumerate(core_eos.eps_tot):
227
+ if eps > b_up:
228
+ eos_den.append(core_eos.den[ind])
229
+ eos_eps.append(eps)
230
+ eos_pre.append(core_eos.pre_tot[ind])
231
+ eos_cs2.append(core_eos.cs2_tot[ind])
232
+ else:
233
+ corx_den.append(core_eos.den[ind])
234
+ corx_eps.append(eps)
235
+ corx_pre.append(core_eos.pre_tot[ind])
236
+ corx_cs2.append(core_eos.cs2_tot[ind])
237
+ #
238
+ elif connect == "pressure":
239
+ #
240
+ print("pressure")
241
+ #
242
+ b_lo = boundaries[0]
243
+ b_up = boundaries[1]
244
+ print("Boundaries:", b_lo, b_up)
245
+ for ind, pre in enumerate(crust_eos.pre_tot):
246
+ if pre < b_lo:
247
+ eos_den.append(crust_eos.den[ind])
248
+ eos_eps.append(crust_eos.eps_tot[ind])
249
+ eos_pre.append(pre)
250
+ eos_cs2.append(crust_eos.cs2_tot[ind])
251
+ else:
252
+ crux_den.append(crust_eos.den[ind])
253
+ crux_eps.append(crust_eos.eps_tot[ind])
254
+ crux_pre.append(pre)
255
+ crux_cs2.append(crust_eos.cs2_tot[ind])
256
+ for ind, pre in enumerate(core_eos.pre_tot):
257
+ if pre > b_up:
258
+ eos_den.append(core_eos.den[ind])
259
+ eos_eps.append(core_eos.eps_tot[ind])
260
+ eos_pre.append(pre)
261
+ eos_cs2.append(core_eos.cs2_tot[ind])
262
+ else:
263
+ corx_den.append(core_eos.den[ind])
264
+ corx_eps.append(core_eos.eps_tot[ind])
265
+ corx_pre.append(pre)
266
+ corx_cs2.append(core_eos.cs2_tot[ind])
267
+ #
268
+ else:
269
+ print("setupCC.py: Issue with the connection.")
270
+ print("setupCC.py: connect:", connect)
271
+ print("setupCC.py: -- Exit the code --")
272
+ exit()
273
+ self.crust_den = np.array(crust_eos.den)
274
+ self.crust_pre = np.array(crust_eos.pre_tot)
275
+ self.crust_eps = np.array(crust_eos.eps_tot)
276
+ self.crust_cs2 = np.array(crust_eos.cs2_tot)
277
+ self.core_den = np.array(core_eos.den)
278
+ self.core_pre = np.array(core_eos.pre_tot)
279
+ self.core_eps = np.array(core_eos.eps_tot)
280
+ self.core_cs2 = np.array(core_eos.cs2_tot)
281
+ self.crux_den = np.array(crux_den)
282
+ self.crux_pre = np.array(crux_pre)
283
+ self.crux_eps = np.array(crux_eps)
284
+ self.crux_cs2 = np.array(crux_cs2)
285
+ self.corx_den = np.array(corx_den)
286
+ self.corx_pre = np.array(corx_pre)
287
+ self.corx_eps = np.array(corx_eps)
288
+ self.corx_cs2 = np.array(corx_cs2)
289
+ #
290
+ # perform a simple linear interpolation in log-log scale
291
+ #
292
+ log_den = np.log10(eos_den)
293
+ log_eps = np.log10(eos_eps)
294
+ log_pre = np.log10(eos_pre)
295
+ log_cs2 = np.log10(eos_cs2)
296
+ #
297
+ if connect == "density":
298
+ #
299
+ x = log_den
300
+ ye = log_eps
301
+ yp = log_pre
302
+ yc = log_cs2
303
+ # fix the density mesh for the output eos
304
+ print("min(den):", min(eos_den), min(log_den))
305
+ print("max(den):", max(eos_den), max(log_den))
306
+ eos_x = np.logspace(min(log_den), max(log_den), num=100)
307
+ log_x = np.log10(eos_x)
308
+ #
309
+ print("eos_x:", eos_x)
310
+ print("log_x:", log_x)
311
+ # cs_eps = CubicSpline(x, ye)
312
+ # cs_pre = CubicSpline(x, yp)
313
+ # cs_cs2 = CubicSpline(x, yc)
314
+ # cs_cs2_beta = CubicSpline(ye, yp)
315
+ self.den = eos_x
316
+ # self.eps = np.power(10,cs_eps(log_x))
317
+ # self.pre = np.power(10,cs_pre(log_x))
318
+ # self.cs2 = np.power(10,cs_cs2(log_x))
319
+ # self.cs2_beta = self.pre / self.eps * np.power(10,cs_cs2_beta( self.eps, 1 ) ) # to improve...
320
+ # linear interpolation in log-log scale
321
+ self.eps = np.power(10, np.interp(log_x, x, ye))
322
+ self.pre = np.power(10, np.interp(log_x, x, yp))
323
+ self.cs2 = np.power(10, np.interp(log_x, x, yc))
324
+ #
325
+ elif connect == "epsilon":
326
+ #
327
+ yn = log_den
328
+ x = log_eps
329
+ yp = log_pre
330
+ yc = log_cs2
331
+ # fix the density mesh for the output eos
332
+ print("min(eps):", min(eos_eps), min(log_eps))
333
+ print("max(eps):", max(eos_eps), max(log_eps))
334
+ eos_x = np.logspace(min(log_eps), max(log_eps), num=100)
335
+ log_x = np.log10(eos_x)
336
+ self.den = np.power(10, np.interp(log_x, x, yn))
337
+ self.eps = eos_x
338
+ self.pre = np.power(10, np.interp(log_x, x, yp))
339
+ self.cs2 = np.power(10, np.interp(log_x, x, yc))
340
+ #
341
+ elif connect == "pressure":
342
+ #
343
+ yn = log_den
344
+ ye = log_eps
345
+ x = log_pre
346
+ yc = log_cs2
347
+ # fix the density mesh for the output eos
348
+ print("min(pre):", min(eos_pre), min(log_pre))
349
+ print("max(pre):", max(eos_pre), max(log_pre))
350
+ eos_x = np.logspace(min(log_pre), max(log_pre), num=100)
351
+ log_x = np.log10(eos_x)
352
+ self.den = np.power(10, np.interp(log_x, x, yn))
353
+ self.eps = np.power(10, np.interp(log_x, x, ye))
354
+ self.pre = eos_x
355
+ self.cs2 = np.power(10, np.interp(log_x, x, yc))
356
+ #
357
+ self.den_unit = "fm$^{-3}$"
358
+ self.e2a_unit = "MeV"
359
+ self.eps_unit = "MeV fm$^{-3}$"
360
+ self.pre_unit = "MeV fm$^{-3}$"
361
+ #
362
+ if nuda.env.verb:
363
+ print("Exit setupCC()")
364
+ #
365
+
366
+ def print_outputs(self):
367
+ """
368
+ Method which print outputs on terminal's screen.
369
+ """
370
+ #
371
+ if nuda.env.verb:
372
+ print("Enter print_outputs()")
373
+ #
374
+ print("- Print output:")
375
+ print(" model:", self.model)
376
+ print(" ref: ", self.ref)
377
+ print(" label:", self.label)
378
+ print(" note: ", self.note)
379
+ # if any(self.sm_den): print(f" sm_den: {np.round(self.sm_den,3)} in {self.den_unit}")
380
+ if self.den is not None:
381
+ print(f" den: {np.round(self.den,3)} in {self.den_unit}")
382
+ if self.e2a is not None:
383
+ print(f" e2a: {np.round(self.e2a,3)} in {self.e2a_unit}")
384
+ if self.eps is not None:
385
+ print(f" eps: {np.round(self.eps,3)} in {self.eps_unit}")
386
+ if self.pre is not None:
387
+ print(f" pre: {np.round(self.pre,3)} in {self.pre_unit}")
388
+ if self.cs2 is not None:
389
+ print(f" cs2: {np.round(self.cs2,2)}")
390
+ #
391
+ if nuda.env.verb:
392
+ print("Exit print_outputs()")
393
+ #
394
+
395
+ def init_self(self):
396
+ """
397
+ Initialize variables in self.
398
+ """
399
+ #
400
+ if nuda.env.verb:
401
+ print("Enter init_self()")
402
+ #
403
+ #: Attribute providing the full reference to the paper to be citted.
404
+ self.ref = ""
405
+ #: Attribute providing additional notes about the data.
406
+ self.note = ""
407
+ #: Attribute the matter density.
408
+ self.den = None
409
+ #: Attribute the total energy density.
410
+ self.eps = None
411
+ #: Attribute the pressure.
412
+ self.pre = None
413
+ #: Attribute the sound speed.
414
+ self.cs2 = None
415
+ #: Attribute the sound speed at beta-equilibrium
416
+ self.cs2_beta = None
417
+ #: Attribute the plot linestyle.
418
+ self.linestyle = None
419
+ #: Attribute the plot label data.
420
+ self.label = ""
421
+ #: Attribute the plot marker.
422
+ self.marker = None
423
+ #: Attribute the plot every data.
424
+ self.every = 1
425
+ #
426
+ if nuda.env.verb:
427
+ print("Exit init_self()")
428
+ #
429
+ return self
@@ -76,11 +76,11 @@ class setupAM():
76
76
  self.marker = esym.marker
77
77
  #print('type esym:',type(esym.esym))
78
78
  if esym.esym is not None:
79
- self.nm_den = esym.nm_den
80
- self.nm_e2a = esym.nm_e2a
81
- self.sm_den = esym.sm_den
82
- self.sm_e2a = esym.sm_e2a
83
79
  self.den = esym.den
80
+ self.nm_den = esym.den
81
+ self.sm_den = esym.den
82
+ self.nm_e2a_int = esym.esym_nm_e2a_int
83
+ self.sm_e2a_int = esym.esym_sm_e2a_int
84
84
  self.esym = esym.esym
85
85
  #print('esym:',self.esym)
86
86
  self.x_n = ( 1.0 + self.asy ) / 2.0
@@ -95,29 +95,54 @@ class setupAM():
95
95
  self.n_mu = self.x_mu * self.den
96
96
  #
97
97
  # Thermodynamical variables
98
- self.e2a_nuc = esym.esym_sm_e2a + esym.esym * self.asy**2
99
- self.e2v_nuc = self.e2a_nuc * self.den
98
+ # nucleons
99
+ self.rmass = self.x_n * nuda.cst.mnc2 + self.x_p * nuda.cst.mpc2
100
+ self.e2a_int_nuc = esym.esym_sm_e2a_int + esym.esym * self.asy**2
101
+ self.e2a_nuc = self.rmass + self.e2a_int_nuc
102
+ self.eps_int_nuc = self.e2a_int_nuc * self.den
103
+ self.eps_nuc = self.e2a_nuc * self.den
100
104
  self.pre_nuc = esym.esym_sm_pre + esym.esym_sym_pre * self.asy**2
105
+ # leptons
101
106
  lep = nuda.matter.setupFFGLep( den_el = self.n_el, den_mu = self.n_mu )
102
107
  self.e2a_el = self.x_el * lep.e2n_el
108
+ self.e2a_int_el = self.e2a_el - self.x_el * nuda.cst.mec2
103
109
  self.e2a_mu = self.x_mu * lep.e2n_mu
110
+ self.e2a_int_mu = self.e2a_mu - self.x_mu * nuda.cst.mmuc2
104
111
  self.e2a_lep = self.x_lep * lep.e2n_lep
105
- self.e2v_lep = self.e2a_lep / self.den
112
+ self.eps_lep = self.e2a_lep * self.den
106
113
  self.pre_el = lep.pre_el
107
114
  self.pre_mu = lep.pre_mu
108
115
  self.pre_lep = lep.pre_el + lep.pre_mu
109
- # self.h2a
110
- # self.h2v
111
- # self.cs2
112
116
  # total
117
+ self.e2a_int_tot = self.e2a_int_nuc + self.e2a_lep
113
118
  self.e2a_tot = self.e2a_nuc + self.e2a_lep
114
- self.e2v_tot = self.e2v_nuc + self.e2v_lep
119
+ self.eps_int_tot = self.eps_int_nuc + self.eps_lep
120
+ self.eps_tot = self.eps_nuc + self.eps_lep
115
121
  self.pre_tot = self.pre_nuc + self.pre_lep
122
+ # enthalpy self.h2a
123
+ self.h2a_lep = self.e2a_lep + self.pre_lep / self.den
124
+ self.h2a_nuc = self.e2a_nuc + self.pre_nuc / self.den
125
+ self.h2a_tot = self.e2a_tot + self.pre_tot / self.den
126
+ # enthaply density self.h2v
127
+ self.h2v_lep = self.h2a_lep * self.den
128
+ self.h2v_nuc = self.h2a_nuc * self.den
129
+ self.h2v_tot = self.h2a_tot * self.den
130
+ # sound speed self.cs2
131
+ x = np.insert(self.den, 0, 0.0)
132
+ y = np.insert(self.pre_lep, 0, 0.0)
133
+ cs_pre = CubicSpline(x, y)
134
+ self.cs2_lep = cs_pre(self.den, 1) / self.h2a_lep
135
+ y = np.insert(self.pre_nuc, 0, 0.0)
136
+ cs_pre = CubicSpline(x, y)
137
+ self.cs2_nuc = cs_pre(self.den, 1) / self.h2a_nuc
138
+ y = np.insert(self.pre_tot, 0, 0.0)
139
+ cs_pre = CubicSpline(x, y)
140
+ self.cs2_tot = cs_pre(self.den, 1) / self.h2a_tot
116
141
  #
117
142
  self.den_unit = 'fm$^{-3}$'
118
143
  self.kf_unit = 'fm$^{-1}$'
119
144
  self.e2a_unit = 'MeV'
120
- self.e2v_unit = 'MeV fm$^{-3}$'
145
+ self.eps_unit = 'MeV fm$^{-3}$'
121
146
  self.pre_unit = 'MeV fm$^{-3}$'
122
147
  self.gap_unit = 'MeV'
123
148
  #
@@ -140,7 +165,7 @@ class setupAM():
140
165
  if self.kfn is not None: print(f" kfn: {np.round(self.den,3)} in {self.kf_unit}")
141
166
  if self.asy is not None: print(f" asy: {np.round(self.asy,3)}")
142
167
  if self.e2a is not None: print(f" e2a: {np.round(self.e2a,3)} in {self.e2a_unit}")
143
- if self.e2v is not None: print(f" e2v: {np.round(self.e2v,3)} in {self.e2v_unit}")
168
+ if self.eps is not None: print(f" eps: {np.round(self.eps,3)} in {self.eps_unit}")
144
169
  if self.pre is not None: print(f" pre: {np.round(self.pre,3)} in {self.pre_unit}")
145
170
  if self.cs2 is not None: print(f" cs2: {np.round(self.cs2,2)}")
146
171
  #
@@ -177,7 +202,7 @@ class setupAM():
177
202
  #: Attribute the energy per particle.
178
203
  self.e2a = None
179
204
  #: Attribute the energy per unit volume.
180
- self.e2v = None
205
+ self.eps = None
181
206
  #: Attribute the enthalpy per particle.
182
207
  self.h2a = None
183
208
  #: Attribute the enthalpy per unit volume.
@@ -89,11 +89,11 @@ class setupAMBeq():
89
89
  #
90
90
  #if isinstance(esym.esym, np.ndarray ):
91
91
  if esym.esym is not None:
92
- self.nm_den = esym.nm_den
93
- self.nm_e2a = esym.nm_e2a
94
- self.sm_den = esym.sm_den
95
- self.sm_e2a = esym.sm_e2a
96
92
  self.den = esym.den
93
+ self.nm_den = esym.den
94
+ self.sm_den = esym.den
95
+ self.nm_e2a_int = esym.esym_nm_e2a_int
96
+ self.sm_e2a_int = esym.esym_sm_e2a_int
97
97
  self.esym = esym.esym
98
98
  self.x_el = []
99
99
  self.x_mu = []
@@ -123,29 +123,54 @@ class setupAMBeq():
123
123
  self.x_lep = self.x_el + self.x_mu
124
124
  #
125
125
  # Thermodynamical variables
126
- self.e2a_nuc = esym.esym_sm_e2a + esym.esym * self.asy**2
127
- self.e2v_nuc = self.e2a_nuc * self.den
126
+ # nucleons
127
+ self.rmass = self.x_n * nuda.cst.mnc2 + self.x_p * nuda.cst.mpc2
128
+ self.e2a_int_nuc = esym.esym_sm_e2a_int + esym.esym * self.asy**2
129
+ self.e2a_nuc = self.rmass + self.e2a_int_nuc
130
+ self.eps_int_nuc = self.e2a_int_nuc * self.den
131
+ self.eps_nuc = self.e2a_nuc * self.den
128
132
  self.pre_nuc = esym.esym_sm_pre + esym.esym_sym_pre * self.asy**2
133
+ # leptons
129
134
  lep = nuda.matter.setupFFGLep( den_el = self.n_el, den_mu = self.n_mu )
130
135
  self.e2a_el = self.x_el * lep.e2n_el
136
+ self.e2a_int_el = self.e2a_el - self.x_el * nuda.cst.mec2
131
137
  self.e2a_mu = self.x_mu * lep.e2n_mu
138
+ self.e2a_int_mu = self.e2a_mu - self.x_mu * nuda.cst.mmuc2
132
139
  self.e2a_lep = self.x_lep * lep.e2n_lep
133
- self.e2v_lep = self.e2a_lep / self.den
140
+ self.eps_lep = self.e2a_lep / self.den
134
141
  self.pre_el = lep.pre_el
135
142
  self.pre_mu = lep.pre_mu
136
143
  self.pre_lep = lep.pre_el + lep.pre_mu
137
- # self.h2a
138
- # self.h2v
139
- # self.cs2
140
144
  # total
145
+ self.e2a_int_tot = self.e2a_int_nuc + self.e2a_lep
141
146
  self.e2a_tot = self.e2a_nuc + self.e2a_lep
142
- self.e2v_tot = self.e2v_nuc + self.e2v_lep
147
+ self.eps_int_tot = self.eps_int_nuc + self.eps_lep
148
+ self.eps_tot = self.eps_nuc + self.eps_lep
143
149
  self.pre_tot = self.pre_nuc + self.pre_lep
144
- #
150
+ # enthalpy self.h2a
151
+ self.h2a_lep = self.e2a_lep + self.pre_lep / self.den
152
+ self.h2a_nuc = self.e2a_nuc + self.pre_nuc / self.den
153
+ self.h2a_tot = self.e2a_tot + self.pre_tot / self.den
154
+ # enthaply density self.h2v
155
+ self.h2v_lep = self.h2a_lep * self.den
156
+ self.h2v_nuc = self.h2a_nuc * self.den
157
+ self.h2v_tot = self.h2a_tot * self.den
158
+ # sound speed self.cs2
159
+ x = np.insert(self.den, 0, 0.0)
160
+ y = np.insert(self.pre_lep, 0, 0.0)
161
+ cs_pre = CubicSpline(x, y)
162
+ self.cs2_lep = cs_pre(self.den, 1) / self.h2a_lep
163
+ y = np.insert(self.pre_nuc, 0, 0.0)
164
+ cs_pre = CubicSpline(x, y)
165
+ self.cs2_nuc = cs_pre(self.den, 1) / self.h2a_nuc
166
+ y = np.insert(self.pre_tot, 0, 0.0)
167
+ cs_pre = CubicSpline(x, y)
168
+ self.cs2_tot = cs_pre(self.den, 1) / self.h2a_tot
169
+ # #
145
170
  self.den_unit = 'fm$^{-3}$'
146
171
  self.kf_unit = 'fm$^{-1}$'
147
172
  self.e2a_unit = 'MeV'
148
- self.e2v_unit = 'MeV fm$^{-3}$'
173
+ self.eps_unit = 'MeV fm$^{-3}$'
149
174
  self.pre_unit = 'MeV fm$^{-3}$'
150
175
  self.gap_unit = 'MeV'
151
176
  #
@@ -168,7 +193,7 @@ class setupAMBeq():
168
193
  if self.kfn is not None: print(f" kfn: {np.round(self.den,3)} in {self.kf_unit}")
169
194
  if self.asy is not None: print(f" asy: {np.round(self.asy,3)}")
170
195
  if self.e2a is not None: print(f" e2a: {np.round(self.e2a,3)} in {self.e2a_unit}")
171
- if self.e2v is not None: print(f" e2v: {np.round(self.e2v,3)} in {self.e2v_unit}")
196
+ if self.eps is not None: print(f" eps: {np.round(self.eps,3)} in {self.eps_unit}")
172
197
  if self.pre is not None: print(f" pre: {np.round(self.pre,3)} in {self.pre_unit}")
173
198
  if self.cs2 is not None: print(f" cs2: {np.round(self.cs2,2)}")
174
199
  #
@@ -213,7 +238,7 @@ class setupAMBeq():
213
238
  #: Attribute the energy per particle (total).
214
239
  self.e2a = None
215
240
  #: Attribute the energy per unit volume.
216
- self.e2v = None
241
+ self.eps = None
217
242
  #: Attribute the enthalpy per particle.
218
243
  self.h2a = None
219
244
  #: Attribute the enthalpy per unit volume.