lfit-python 0.1.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.
Files changed (81) hide show
  1. lfit_python/__init__.py +27 -0
  2. lfit_python/chains.py +157 -0
  3. lfit_python/cli/__init__.py +1 -0
  4. lfit_python/cli/limbdark.py +64 -0
  5. lfit_python/cli/mcmcfit.py +168 -0
  6. lfit_python/cli/physparams.py +154 -0
  7. lfit_python/cli/reddening.py +50 -0
  8. lfit_python/cli/summary.py +78 -0
  9. lfit_python/cli/update_input.py +65 -0
  10. lfit_python/cli/watch.py +39 -0
  11. lfit_python/cli/wdparams.py +223 -0
  12. lfit_python/cv_model.py +864 -0
  13. lfit_python/data/Bergeron/README +7 -0
  14. lfit_python/data/Bergeron/Table_DA +257 -0
  15. lfit_python/data/Bergeron/Table_DA_sdss +307 -0
  16. lfit_python/data/Bergeron/Table_DB +312 -0
  17. lfit_python/data/Bergeron/color_correction_tables/color_corrections_HCAM-GTC-super_minus_ntt_ucam.csv +1067 -0
  18. lfit_python/data/Bergeron/color_correction_tables/color_corrections_HCAM-GTC-super_minus_tnt_uspec.csv +1067 -0
  19. lfit_python/data/Gianninas13/ld_coeffs_g.txt +654 -0
  20. lfit_python/data/Gianninas13/ld_coeffs_i.txt +654 -0
  21. lfit_python/data/Gianninas13/ld_coeffs_r.txt +654 -0
  22. lfit_python/data/Gianninas13/ld_coeffs_u.txt +654 -0
  23. lfit_python/data/Gianninas13/ld_coeffs_z.txt +654 -0
  24. lfit_python/data/Gianninas13/radial_bright_profiles.txt +6925 -0
  25. lfit_python/data/Hamada/mr_hamada.dat +1307 -0
  26. lfit_python/data/Panei/12C-MR-H-He/12C-MR-H-He.dat +387 -0
  27. lfit_python/data/Panei/12C-MR-H-He/12C-MR-H-He.saver +750 -0
  28. lfit_python/data/Panei/12C-MR-He/12C-MR-He.dat +431 -0
  29. lfit_python/data/Panei/HS/04He-H-S.dat +158 -0
  30. lfit_python/data/Panei/HS/12C-H-S.dat +158 -0
  31. lfit_python/data/Panei/HS/16O-H-S.dat +158 -0
  32. lfit_python/data/Panei/HS/28Si-H-S.dat +158 -0
  33. lfit_python/data/Panei/HS/56Fe-H-S.dat +158 -0
  34. lfit_python/data/Panei/othercores/04He-MR-H.dat +91 -0
  35. lfit_python/data/Panei/othercores/16O-MR-H-He.dat +602 -0
  36. lfit_python/data/Panei/othercores/28Si-MR-H-He.dat +386 -0
  37. lfit_python/data/Panei/othercores/56Fe-MR-H-He.dat +390 -0
  38. lfit_python/data/Panei/othercores/old/04He-MR-H.save +120 -0
  39. lfit_python/data/Panei/othercores/old/04He-MR.save +130 -0
  40. lfit_python/data/Panei/othercores/old/16O-MR-H-He.save +602 -0
  41. lfit_python/data/Panei/othercores/old/16O-MR-He.save +469 -0
  42. lfit_python/data/Panei/othercores/old/28Si-MR-H-He.save +386 -0
  43. lfit_python/data/Panei/othercores/old/28Si-MR-He.save +402 -0
  44. lfit_python/data/Panei/othercores/old/56Fe-MR-H-He.save +633 -0
  45. lfit_python/data/Panei/othercores/old/56Fe-MR-He.save +537 -0
  46. lfit_python/data/Wood95/co040.2.04dt1 +80 -0
  47. lfit_python/data/Wood95/co050.2.04dt1 +82 -0
  48. lfit_python/data/Wood95/co060.2.04dt1 +85 -0
  49. lfit_python/data/Wood95/co070.2.04dt1 +91 -0
  50. lfit_python/data/Wood95/co080.2.04dt1 +100 -0
  51. lfit_python/data/Wood95/co090.2.04dt1 +99 -0
  52. lfit_python/data/Wood95/co100.2.04dt1 +100 -0
  53. lfit_python/data/althaus/readme.tex +12 -0
  54. lfit_python/data/althaus/t106.one +1132 -0
  55. lfit_python/data/althaus/t108.one +679 -0
  56. lfit_python/data/althaus/t110.one +821 -0
  57. lfit_python/data/althaus/t112.one +239 -0
  58. lfit_python/data/althaus/t114.one +355 -0
  59. lfit_python/data/althaus/t116.one +353 -0
  60. lfit_python/data/althaus/t118.one +356 -0
  61. lfit_python/data/althaus/t120.one +882 -0
  62. lfit_python/data/althaus/t122.one +901 -0
  63. lfit_python/data/althaus/t124.one +913 -0
  64. lfit_python/data/althaus/t126.one +739 -0
  65. lfit_python/data/althaus/t128.one +665 -0
  66. lfit_python/data/althaus/t130.one +626 -0
  67. lfit_python/likelihood.py +26 -0
  68. lfit_python/limbdark.py +47 -0
  69. lfit_python/model.py +801 -0
  70. lfit_python/physical_params.py +279 -0
  71. lfit_python/plotting.py +364 -0
  72. lfit_python/priors.py +51 -0
  73. lfit_python/sampling.py +472 -0
  74. lfit_python/summary.py +327 -0
  75. lfit_python/watch_app.py +1001 -0
  76. lfit_python/wdparams.py +587 -0
  77. lfit_python-0.1.0.dist-info/METADATA +222 -0
  78. lfit_python-0.1.0.dist-info/RECORD +81 -0
  79. lfit_python-0.1.0.dist-info/WHEEL +5 -0
  80. lfit_python-0.1.0.dist-info/entry_points.txt +9 -0
  81. lfit_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,47 @@
1
+ """Uses the output fluxes of a White Dwarf from an MCMC chain, and uses them
2
+ to calculate the limb darkening coefficient that should be used when fitting
3
+ that body. Data is typically not sensitive enough to this to fit it
4
+ independantly, so a few iterations through this script should aid in the
5
+ science.
6
+ """
7
+
8
+ import numpy as np
9
+ from scipy.interpolate import RectBivariateSpline
10
+
11
+ from . import DATA_DIR
12
+
13
+
14
+ def ld(band, logg, teff, law="linear"):
15
+ assert band in ["u", "g", "r", "i", "z"]
16
+ assert law in ["linear", "quad", "sqr"]
17
+
18
+ filename = DATA_DIR / "Gianninas13" / f"ld_coeffs_{band}.txt"
19
+ data = np.loadtxt(filename)
20
+ x = data[
21
+ :, 0
22
+ ] # logg (grid increments through all teffs at a single logg, then +logg)
23
+ y = data[:, 1] # teff
24
+ t1 = np.unique(y) # unique temps
25
+ g1 = np.unique(x) # unique loggs
26
+ nt = len(t1)
27
+ ng = len(g1)
28
+
29
+ z0 = data[:, 2] # linear ld coefficient
30
+ z1 = data[:, 3] # first quad term
31
+ z2 = data[:, 4] # 2nd quad term
32
+ z3 = data[:, 5] # first square-root term
33
+ z4 = data[:, 6] # second square-root term
34
+
35
+ # func = SmoothBivariateSpline(x,y,z)
36
+ # return func(logg,teff)[0]
37
+ if law == "linear":
38
+ func = RectBivariateSpline(g1, t1, z0.reshape((ng, nt)), kx=3, ky=3)
39
+ return func(logg, teff)[0, 0]
40
+ elif law == "quad":
41
+ funca = RectBivariateSpline(g1, t1, z1.reshape((ng, nt)), kx=3, ky=3)
42
+ funcb = RectBivariateSpline(g1, t1, z2.reshape((ng, nt)), kx=3, ky=3)
43
+ return (funca(logg, teff)[0, 0], funcb(logg, teff)[0, 0])
44
+ elif law == "sqr":
45
+ funca = RectBivariateSpline(g1, t1, z3.reshape((ng, nt)), kx=3, ky=3)
46
+ funcb = RectBivariateSpline(g1, t1, z4.reshape((ng, nt)), kx=3, ky=3)
47
+ return (funca(logg, teff)[0, 0], funcb(logg, teff)[0, 0])