GALAHProject / oracle

3 stars 1 forks source link

Abundance differences found in Castelli/Kurucz & MARCS atmospheres #14

Closed andycasey closed 9 years ago

andycasey commented 9 years ago

Consider the code below:

import numpy as np

import oracle
from oracle.atmospheres import marcs, castelli_kurucz

# The equivalent width of line was measured in a HERMES Solar spectrum using SMH
# The atomic data for this line may be incorrect, but it does not affect the conclusions.
line = np.core.records.fromarrays(np.array([[4800.648, 26.0, 4.120, -1.028, 63.87]]).T,
    names=("wavelength", "species", "excitation_potential", "loggf", "equivalent_width"))

m = marcs.Interpolator()
ck = castelli_kurucz.Interpolator()

dwarf_ck = ck.interpolate(5777.0, 4.45, 0.0)
giant_ck = ck.interpolate(5777.0, 2.1, 0.0)
dwarf_marcs = m.interpolate(5777.0, 4.45, 0.0)
giant_marcs = m.interpolate(5777.0, 2.1, 0.0)

print("dwarfs")
dwarfs = [oracle.synthesis.moog.atomic_abundances(line, _, microturbulence=1.06) for _ in (dwarf_ck, dwarf_marcs)]

print("giants")
giants = [oracle.synthesis.moog.atomic_abundances(line, _, microturbulence=1.06) for _ in (giant_ck, giant_marcs)]

This outputs:

Models Dwarf/Giant Abundance
Castelli/Kurucz Dwarf 7.45
MARCS Dwarf 6.14
Castelli/Kurucz Giant 10.94
MARCS Giant 7.92

It is not clear whether this is a problem with:

andycasey commented 9 years ago

If I compile the February 2013 version of MOOG and provide these inputs:

abfind.in:

abfind
terminal 'x11'
standard_out 'sun.std.out'
summary_out 'sun.sum.out'
model_in 'sun.marcs'
lines_in 'lines.in'
atmosphere 1
molecules 1
lines 1
freeform 1
flux/int 0
damping 0
plot 0

lines.in


4800.648 26.0 4.120 -1.028 0 0 63.87

sun.marcs:

WEBMARCS
  Sun.
          56
5000.0
  1 -5.00 -4.9174 -6.931E+07  4066.8  2.117E-02  2.670E+02  1.488E+00  0.000E+00
  2 -4.80 -4.7204 -6.672E+07  4102.6  2.730E-02  3.459E+02  1.489E+00  0.000E+00
  3 -4.60 -4.5278 -6.411E+07  4145.9  3.532E-02  4.469E+02  1.489E+00  0.000E+00
  4 -4.40 -4.3377 -6.149E+07  4190.4  4.569E-02  5.771E+02  1.489E+00  0.000E+00
  5 -4.20 -4.1484 -5.884E+07  4235.5  5.905E-02  7.444E+02  1.490E+00  0.000E+00
  6 -4.00 -3.9593 -5.618E+07  4280.8  7.622E-02  9.596E+02  1.490E+00  0.000E+00
  7 -3.80 -3.7697 -5.349E+07  4326.1  9.828E-02  1.236E+03  1.491E+00  0.000E+00
  8 -3.60 -3.5795 -5.078E+07  4371.3  1.266E-01  1.591E+03  1.492E+00  0.000E+00
  9 -3.40 -3.3887 -4.805E+07  4416.3  1.628E-01  2.047E+03  1.493E+00  0.000E+00
 10 -3.20 -3.1971 -4.530E+07  4461.0  2.092E-01  2.632E+03  1.495E+00  0.000E+00
 11 -3.00 -3.0049 -4.253E+07  4504.9  2.683E-01  3.382E+03  1.497E+00  0.000E+00
 12 -2.90 -2.9086 -4.118E+07  4527.4  3.039E-01  3.833E+03  1.498E+00  0.000E+00
 13 -2.80 -2.8122 -3.981E+07  4549.5  3.440E-01  4.343E+03  1.500E+00  0.000E+00
 14 -2.70 -2.7157 -3.844E+07  4571.5  3.894E-01  4.921E+03  1.502E+00  0.000E+00
 15 -2.60 -2.6191 -3.707E+07  4593.5  4.406E-01  5.575E+03  1.504E+00  0.000E+00
 16 -2.50 -2.5223 -3.569E+07  4615.6  4.984E-01  6.316E+03  1.507E+00  0.000E+00
 17 -2.40 -2.4256 -3.431E+07  4637.8  5.637E-01  7.154E+03  1.510E+00  0.000E+00
 18 -2.30 -2.3287 -3.292E+07  4660.2  6.376E-01  8.102E+03  1.514E+00  0.000E+00
 19 -2.20 -2.2318 -3.152E+07  4682.9  7.211E-01  9.175E+03  1.519E+00  0.000E+00
 20 -2.10 -2.1349 -3.012E+07  4706.0  8.157E-01  1.039E+04  1.525E+00  0.000E+00
 21 -2.00 -2.0379 -2.871E+07  4729.9  9.230E-01  1.176E+04  1.532E+00  0.000E+00
 22 -1.90 -1.9409 -2.730E+07  4754.7  1.045E+00  1.332E+04  1.540E+00  0.000E+00
 23 -1.80 -1.8440 -2.588E+07  4780.9  1.184E+00  1.507E+04  1.551E+00  0.000E+00
 24 -1.70 -1.7471 -2.445E+07  4808.6  1.343E+00  1.706E+04  1.563E+00  0.000E+00
 25 -1.60 -1.6502 -2.302E+07  4838.3  1.525E+00  1.931E+04  1.578E+00  0.000E+00
 26 -1.50 -1.5534 -2.158E+07  4870.5  1.735E+00  2.185E+04  1.597E+00  0.000E+00
 27 -1.40 -1.4568 -2.013E+07  4905.9  1.979E+00  2.471E+04  1.620E+00  0.000E+00
 28 -1.30 -1.3602 -1.868E+07  4944.1  2.261E+00  2.795E+04  1.648E+00  0.000E+00
 29 -1.20 -1.2637 -1.721E+07  4988.1  2.595E+00  3.161E+04  1.682E+00  0.000E+00
 30 -1.10 -1.1673 -1.573E+07  5034.4  2.983E+00  3.574E+04  1.724E+00  0.000E+00
 31 -1.00 -1.0711 -1.425E+07  5088.6  3.453E+00  4.039E+04  1.776E+00  0.000E+00
 32 -0.90 -0.9750 -1.275E+07  5148.5  4.017E+00  4.562E+04  1.840E+00  0.000E+00
 33 -0.80 -0.8789 -1.124E+07  5216.8  4.714E+00  5.150E+04  1.919E+00  0.000E+00
 34 -0.70 -0.7829 -9.728E+06  5294.4  5.594E+00  5.807E+04  2.016E+00  0.000E+00
 35 -0.60 -0.6868 -8.210E+06  5382.5  6.737E+00  6.537E+04  2.136E+00  0.000E+00
 36 -0.50 -0.5907 -6.700E+06  5483.1  8.287E+00  7.339E+04  2.284E+00  0.000E+00
 37 -0.40 -0.4944 -5.215E+06  5597.1  1.047E+01  8.206E+04  2.468E+00  0.000E+00
 38 -0.30 -0.3980 -3.776E+06  5727.4  1.372E+01  9.121E+04  2.696E+00  0.000E+00
 39 -0.20 -0.3012 -2.411E+06  5875.7  1.874E+01  1.006E+05  2.980E+00  0.000E+00
 40 -0.10 -0.2043 -1.146E+06  6044.3  2.680E+01  1.098E+05  3.334E+00  0.000E+00
 41  0.00 -0.1071  0.000E+00  6235.2  4.006E+01  1.187E+05  3.777E+00  0.000E+00
 42  0.10 -0.0099  1.015E+06  6451.9  6.254E+01  1.268E+05  4.331E+00  0.000E+00
 43  0.20  0.0872  1.898E+06  6694.8  1.010E+02  1.340E+05  5.028E+00  0.000E+00
 44  0.30  0.1838  2.648E+06  6983.3  1.724E+02  1.402E+05  5.907E+00  0.000E+00
 45  0.40  0.2791  3.266E+06  7314.8  3.048E+02  1.452E+05  6.990E+00  0.000E+00
 46  0.50  0.3729  3.778E+06  7618.2  4.949E+02  1.494E+05  8.208E+00  0.000E+00
 47  0.60  0.4654  4.229E+06  7876.9  7.295E+02  1.530E+05  9.460E+00  0.000E+00
 48  0.70  0.5569  4.651E+06  8097.7  9.992E+02  1.563E+05  1.067E+01  0.000E+00
 49  0.80  0.6480  5.063E+06  8290.4  1.300E+03  1.596E+05  1.180E+01  0.000E+00
 50  0.90  0.7390  5.478E+06  8462.6  1.631E+03  1.629E+05  1.287E+01  0.000E+00
 51  1.00  0.8301  5.907E+06  8620.2  1.994E+03  1.663E+05  1.389E+01  0.000E+00
 52  1.20  1.0136  6.851E+06  8903.8  2.826E+03  1.737E+05  1.584E+01  0.000E+00
 53  1.40  1.1991  7.926E+06  9168.5  3.858E+03  1.822E+05  1.781E+01  0.000E+00
 54  1.60  1.3869  9.171E+06  9424.6  5.151E+03  1.922E+05  1.989E+01  0.000E+00
 55  1.80  1.5774  1.063E+07  9678.4  6.792E+03  2.043E+05  2.212E+01  0.000E+00
 56  2.00  1.7707  1.234E+07  9934.3  8.892E+03  2.189E+05  2.456E+01  0.000E+00
1.0
NATOM     0 0

Then in sun.sum.out I find:

Abundance Results for Species Fe I         (input abundance =   7.52)
wavelength        EP     logGF        EW     logRW     abund     del avg
   4800.65      4.12    -1.028      63.9     -4.88      7.43        0.00
average abundance =  7.43     std. deviation =  0.00     #lines =   1
andycasey commented 9 years ago

This shows the difference between the exact photosphere quantities (black) and the interpolated quantities provided to Oracle (blue):

sun-marcs-interpolated

andycasey commented 9 years ago

When I supply the interpolated MARCS model atmosphere to the compiled version of MOOG with the same line list and settings I also get:

Abundance Results for Species Fe I         (input abundance =   7.52)
wavelength        EP     logGF        EW     logRW     abund     del avg
   4800.65      4.12    -1.028      63.9     -4.88      7.43        0.00

So it is not the interpolator that is causing this problem. The interpolated atmosphere is:

WEBMARCS
  Sun (interpolated)
          56
5000.0
  1 -5.00 -4.8323 -7.233E+07  4080.3  2.370E-02  3.024E+02  1.488E+00  0.000E+00
  2 -4.80 -4.6377 -6.955E+07  4120.2  3.063E-02  3.913E+02  1.489E+00  0.000E+00
  3 -4.60 -4.4504 -6.681E+07  4163.6  3.945E-02  5.028E+02  1.489E+00  0.000E+00
  4 -4.40 -4.2669 -6.409E+07  4206.9  5.062E-02  6.438E+02  1.489E+00  0.000E+00
  5 -4.20 -4.0847 -6.135E+07  4250.5  6.480E-02  8.227E+02  1.490E+00  0.000E+00
  6 -4.00 -3.9029 -5.859E+07  4294.1  8.283E-02  1.050E+03  1.490E+00  0.000E+00
  7 -3.80 -3.7204 -5.581E+07  4337.6  1.058E-01  1.339E+03  1.491E+00  0.000E+00
  8 -3.60 -3.5368 -5.302E+07  4381.1  1.350E-01  1.708E+03  1.492E+00  0.000E+00
  9 -3.40 -3.3519 -5.019E+07  4424.6  1.723E-01  2.179E+03  1.493E+00  0.000E+00
 10 -3.20 -3.1657 -4.733E+07  4467.9  2.197E-01  2.780E+03  1.495E+00  0.000E+00
 11 -3.00 -2.9781 -4.445E+07  4510.9  2.802E-01  3.551E+03  1.497E+00  0.000E+00
 12 -2.90 -2.8839 -4.304E+07  4532.8  3.165E-01  4.013E+03  1.498E+00  0.000E+00
 13 -2.80 -2.7894 -4.161E+07  4554.4  3.574E-01  4.536E+03  1.500E+00  0.000E+00
 14 -2.70 -2.6946 -4.018E+07  4576.1  4.036E-01  5.127E+03  1.502E+00  0.000E+00
 15 -2.60 -2.5996 -3.874E+07  4597.8  4.557E-01  5.796E+03  1.504E+00  0.000E+00
 16 -2.50 -2.5043 -3.729E+07  4619.5  5.145E-01  6.553E+03  1.507E+00  0.000E+00
 17 -2.40 -2.4088 -3.583E+07  4641.5  5.812E-01  7.409E+03  1.510E+00  0.000E+00
 18 -2.30 -2.3130 -3.436E+07  4663.6  6.565E-01  8.380E+03  1.514E+00  0.000E+00
 19 -2.20 -2.2171 -3.289E+07  4686.2  7.416E-01  9.476E+03  1.519E+00  0.000E+00
 20 -2.10 -2.1211 -3.142E+07  4709.2  8.380E-01  1.071E+04  1.525E+00  0.000E+00
 21 -2.00 -2.0250 -2.994E+07  4733.0  9.473E-01  1.212E+04  1.532E+00  0.000E+00
 22 -1.90 -1.9287 -2.844E+07  4757.9  1.072E+00  1.371E+04  1.540E+00  0.000E+00
 23 -1.80 -1.8324 -2.694E+07  4784.0  1.214E+00  1.550E+04  1.551E+00  0.000E+00
 24 -1.70 -1.7361 -2.544E+07  4811.8  1.377E+00  1.753E+04  1.563E+00  0.000E+00
 25 -1.60 -1.6397 -2.391E+07  4841.6  1.563E+00  1.983E+04  1.578E+00  0.000E+00
 26 -1.50 -1.5434 -2.240E+07  4873.8  1.778E+00  2.242E+04  1.597E+00  0.000E+00
 27 -1.40 -1.4472 -2.086E+07  4908.5  2.026E+00  2.534E+04  1.620E+00  0.000E+00
 28 -1.30 -1.3510 -1.933E+07  4949.0  2.319E+00  2.863E+04  1.648E+00  0.000E+00
 29 -1.20 -1.2549 -1.778E+07  4991.3  2.659E+00  3.235E+04  1.682E+00  0.000E+00
 30 -1.10 -1.1590 -1.622E+07  5039.2  3.061E+00  3.655E+04  1.724E+00  0.000E+00
 31 -1.00 -1.0632 -1.466E+07  5093.1  3.544E+00  4.126E+04  1.776E+00  0.000E+00
 32 -0.90 -0.9675 -1.309E+07  5153.3  4.128E+00  4.656E+04  1.840E+00  0.000E+00
 33 -0.80 -0.8718 -1.151E+07  5222.0  4.850E+00  5.251E+04  1.919E+00  0.000E+00
 34 -0.70 -0.7762 -9.934E+06  5299.9  5.761E+00  5.915E+04  2.016E+00  0.000E+00
 35 -0.60 -0.6805 -8.361E+06  5388.4  6.946E+00  6.650E+04  2.136E+00  0.000E+00
 36 -0.50 -0.5846 -6.800E+06  5489.8  8.555E+00  7.460E+04  2.284E+00  0.000E+00
 37 -0.40 -0.4885 -5.270E+06  5604.5  1.082E+01  8.334E+04  2.468E+00  0.000E+00
 38 -0.30 -0.3920 -3.792E+06  5736.0  1.418E+01  9.259E+04  2.696E+00  0.000E+00
 39 -0.20 -0.2953 -2.393E+06  5885.7  1.939E+01  1.021E+05  2.980E+00  0.000E+00
 40 -0.10 -0.1985 -1.101E+06  6055.6  2.773E+01  1.114E+05  3.334E+00  0.000E+00
 41 +0.00 -0.1017 +6.723E+04  6247.8  4.146E+01  1.203E+05  3.777E+00  0.000E+00
 42 +0.10 -0.0051 +1.097E+06  6464.6  6.459E+01  1.285E+05  4.331E+00  0.000E+00
 43 +0.20 +0.0909 +1.989E+06  6706.8  1.039E+02  1.357E+05  5.028E+00  0.000E+00
 44 +0.30 +0.1861 +2.745E+06  6994.3  1.766E+02  1.419E+05  5.907E+00  0.000E+00
 45 +0.40 +0.2797 +3.365E+06  7320.6  3.089E+02  1.469E+05  6.990E+00  0.000E+00
 46 +0.50 +0.3715 +3.877E+06  7616.2  4.951E+02  1.510E+05  8.208E+00  0.000E+00
 47 +0.60 +0.4616 +4.326E+06  7867.3  7.218E+02  1.546E+05  9.460E+00  0.000E+00
 48 +0.70 +0.5508 +4.746E+06  8082.7  9.820E+02  1.580E+05  1.067E+01  0.000E+00
 49 +0.80 +0.6396 +5.157E+06  8271.6  1.273E+03  1.612E+05  1.180E+01  0.000E+00
 50 +0.90 +0.7285 +5.572E+06  8441.1  1.592E+03  1.645E+05  1.287E+01  0.000E+00
 51 +1.00 +0.8175 +5.999E+06  8596.5  1.944E+03  1.679E+05  1.389E+01  0.000E+00
 52 +1.20 +0.9975 +6.942E+06  8877.2  2.751E+03  1.752E+05  1.584E+01  0.000E+00
 53 +1.40 +1.1800 +8.018E+06  9139.2  3.749E+03  1.837E+05  1.781E+01  0.000E+00
 54 +1.60 +1.3654 +9.269E+06  9393.6  5.004E+03  1.936E+05  1.989E+01  0.000E+00
 55 +1.80 +1.5537 +1.074E+07  9645.6  6.594E+03  2.055E+05  2.212E+01  0.000E+00
 56 +2.00 +1.7452 +1.247E+07  9900.4  8.634E+03  2.199E+05  2.456E+01  0.000E+00
1.0
NATOM     0 0
andycasey commented 9 years ago

It's not the photospheric quantities being given to MOOG, because if oracle.synthesis.moog.atomic_abundances(line, dwarf_marcs, microturbulence=1.0) is given first then the result is 7.43 as expected.

It has to be something to do with memory copies or something...

andycasey commented 9 years ago

As of 0808d49 the output for dwarfs is:

Model Abundance
Castelli/Kurucz 7.45
MARCS 7.43

The issue seemed to be fixed when the params subroutine was removed, and the necessary bits of it were moved to abundances. The synth routine might still require updating, but the results from synthesis seem to suggest that the problem is solved.