2018-07-11 (code examples may oudated if your current date is later) To use the data base get the python codes from https://2sn.org/python3 and put the target directory in your python search path (or cd into it) In [1]: import stardb In [3]: d = stardb.load('/m/web/starfit/data/znuc2012.S4.star.deciso.y.stardb.gz') In [7]: d.data.shape Out[7]: (17640, 287) so there 17640 models of 287 (stable) isotopes each. What models would you like to select? In [15]: d.fieldnames Out[15]: array(['mass', 'energy', 'mixing', 'remnant'], dtype=object) In [24]: d.fieldunits Out[24]: array(['solar masses', 'B', 'He core fraction', 'M_sun'], dtype=object) In [22]: d.nvalues Out[22]: array([126, 10, 14, 941], dtype=uint64) In [23]: d.fieldflags Out[23]: array([0, 0, 0, 1], dtype=uint64) so there is 126 masses, 10 energies, ... remnant is not a parameter (flag 1) For mass, e.g., the possible values are In [41]: d.values[0, :d.nvalues[0]] Out[41]: array([ 9.6, 9.7, 9.8, 9.9, 10. , 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11. , 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12. , 12.2, 12.4, 12.6, 12.8, 13. , 13.2, 13.4, 13.6, 13.8, 14. , 14.2, 14.4, 14.6, 14.8, 15. , 15.2, 15.4, 15.6, 15.8, 16. , 16.2, 16.4, 16.6, 16.8, 17. , 17.1, 17.2, 17.3, 17.4, 17.5, 17.6, 17.7, 17.8, 17.9, 18. , 18.1, 18.2, 18.3, 18.4, 18.5, 18.6, 18.7, 18.8, 18.9, 19. , 19.2, 19.4, 19.6, 19.8, 20. , 20.5, 21. , 21.5, 22. , 22.5, 23. , 23.5, 24. , 24.5, 25. , 25.5, 26. , 26.5, 27. , 27.5, 28. , 28.5, 29. , 29.5, 30. , 30.5, 31. , 31.5, 32. , 32.5, 33. , 33.5, 34. , 34.5, 35. , 36. , 37. , 38. , 39. , 40. , 41. , 42. , 43. , 44. , 45. , 50. , 55. , 60. , 65. , 70. , 75. , 80. , 85. , 90. , 95. , 100. ]) To get all stars with, say 1.2 B explosion energy and 0.01 mixing, do In [56]: d.get_star_slice(energy=1.2, mixing = 0.01) Out[56]: array([7938, 7939, 7940, 7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7983, 7984, 7985, 7986, 7987, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 7997, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 8040, 8041, 8042, 8043, 8044, 8045, 8046, 8047, 8048, 8049, 8050, 8051, 8052, 8053, 8054, 8055, 8056, 8057, 8058, 8059, 8060, 8061, 8062, 8063]) to learn, say, about the first model found, use In [59]: d.index_info(7938) --------------------------------- index: 7938 mass: 9.6 solar masses energy: 1.2 B mixing: 0.01000 He core fraction remnant: 1.367 M_sun --------------------------------- To get the abundance data (mol/g for this set) of the first model use In [60]: d.data[7938] Out[60]: array([6.18874446e-01, 2.96694603e-10, 2.34605015e-06, 9.43663911e-02, ... and the corresponding isotopes are In [61]: d.ions Out[61]: array([Isotope('H1'), Isotope('H2'), Isotope('He3'), Isotope('He4'), Isotope('Li6'), Isotope('Li7'), Isotope('Be9'), Isotope('B10'), ... To get an abundance set object from that use In [62]: from abuset import AbuSet In [64]: s = AbuSet(d.ions, d.data[7938], molfrac = True) In [66]: s.XYZ() Out[66]: array([0.61887445, 0.3774726 , 0.00365294]) X, Y, Z add up to 1.0, good. In [67]: s.C12 Out[67]: 0.0026368200066184256 In [68]: s.C Out[68]: 0.002693036448468266 And what are values relative to solar in [] notation? In [8]: from abuset import AbuRat In [9]: r = AbuRat(s, 'As09') [SolAbu] Loading /home/alex/kepler/local_data/solas09.dat (7.1 kiB) [SolAbu] 287 isotopes loaded in 41 ms. (you may have to provide you own solar abundance file, e.g., solas09.dat from this directory) In [10]: r['C12'] Out[10]: 0.021082925039987863 In [11]: r['CNO/Fe'] Out[11]: 1.136789641674883 Good Luck! -Alexander