diff --git a/.gitignore b/.gitignore index c32668e2..902e920d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ __pycache__ fort.20 screenlog.0 *.log +*.zip +.nfs* spectraltools/output diff --git a/data/continua/mt_ckd4p3_s260 b/data/continua/mt_ckd4p3_s260 deleted file mode 100644 index 64ac09d7..00000000 --- a/data/continua/mt_ckd4p3_s260 +++ /dev/null @@ -1,508 +0,0 @@ -*BEGIN_DATA - - Start of table = -2.00000E+01 cm-1 - End of table = 1.99000E+04 cm-1 - Increment in table = 1.00000E+01 cm-1 - Number of points in table = 1993 - - Continuum coefficients (cm^3.molec-1 * 1.0E-20) - 0.00000e+00 2.04559e-03 0.00000e+00 2.04507e-03 - 7.67932e-03 1.52792e-02 2.29310e-02 2.96717e-02 - 3.54211e-02 4.04213e-02 4.52308e-02 4.97608e-02 - 5.37409e-02 5.69451e-02 5.92161e-02 6.05297e-02 - 6.08575e-02 6.03835e-02 5.91468e-02 5.72685e-02 - 5.48899e-02 5.21436e-02 4.91398e-02 4.59777e-02 - 4.27453e-02 3.95413e-02 3.64287e-02 3.34490e-02 - 3.06342e-02 2.79923e-02 2.55636e-02 2.33332e-02 - 2.12939e-02 1.94459e-02 1.78856e-02 1.64925e-02 - 1.52512e-02 1.41185e-02 1.30742e-02 1.21654e-02 - 1.13658e-02 1.06170e-02 9.93021e-03 9.28832e-03 - 8.69191e-03 8.13359e-03 7.61410e-03 7.14342e-03 - 6.66632e-03 6.23962e-03 5.83784e-03 5.45032e-03 - 5.08744e-03 4.74230e-03 4.41990e-03 4.11685e-03 - 3.83575e-03 3.56437e-03 3.31438e-03 3.08131e-03 - 2.86253e-03 2.65963e-03 2.47299e-03 2.29852e-03 - 2.14262e-03 1.99109e-03 1.84708e-03 1.71381e-03 - 1.59138e-03 1.48018e-03 1.38152e-03 1.29428e-03 - 1.21894e-03 1.15618e-03 1.09765e-03 1.04618e-03 - 9.94989e-04 9.44843e-04 8.87180e-04 8.89728e-04 - 8.83427e-04 8.26173e-04 7.83342e-04 7.39088e-04 - 6.94462e-04 6.61412e-04 6.36294e-04 6.14249e-04 - 5.92123e-04 5.73575e-04 5.54878e-04 5.36028e-04 - 5.15183e-04 4.89188e-04 4.58499e-04 4.32811e-04 - 4.10567e-04 3.92334e-04 3.73753e-04 3.54570e-04 - 3.40729e-04 3.24727e-04 3.09177e-04 2.94162e-04 - 2.81554e-04 2.70207e-04 2.59222e-04 2.49264e-04 - 2.40284e-04 2.31752e-04 2.23948e-04 2.17152e-04 - 2.11384e-04 2.05305e-04 2.02190e-04 1.97883e-04 - 1.96779e-04 1.95593e-04 1.95934e-04 1.97609e-04 - 2.00290e-04 2.02956e-04 2.08888e-04 2.18679e-04 - 2.32075e-04 2.42936e-04 2.55971e-04 2.78676e-04 - 2.77968e-04 3.06260e-04 3.37672e-04 3.58857e-04 - 4.00307e-04 4.47473e-04 5.12245e-04 5.74288e-04 - 6.46360e-04 7.49228e-04 8.38178e-04 9.82937e-04 - 1.13229e-03 1.29795e-03 1.55938e-03 1.74233e-03 - 2.17495e-03 2.36292e-03 2.77793e-03 3.12358e-03 - 3.72209e-03 4.08873e-03 4.81915e-03 5.37332e-03 - 6.07060e-03 6.95346e-03 7.39387e-03 8.33939e-03 - 8.94313e-03 9.63138e-03 1.02782e-02 1.07245e-02 - 1.10378e-02 1.12910e-02 1.14807e-02 1.15316e-02 - 1.16442e-02 1.16112e-02 1.15054e-02 1.10420e-02 - 1.08999e-02 1.04953e-02 9.74100e-03 9.12882e-03 - 8.38978e-03 7.82863e-03 7.25680e-03 6.26424e-03 - 5.76117e-03 5.03025e-03 4.46835e-03 3.90198e-03 - 3.50322e-03 3.05207e-03 2.80703e-03 2.40267e-03 - 2.13346e-03 1.86732e-03 1.65654e-03 1.51222e-03 - 1.32093e-03 1.23003e-03 1.03418e-03 9.46790e-04 - 8.11266e-04 7.18987e-04 6.49147e-04 5.73959e-04 - 5.03416e-04 4.58419e-04 4.07991e-04 3.68711e-04 - 3.29091e-04 2.93050e-04 2.65608e-04 2.47584e-04 - 2.30331e-04 2.08117e-04 1.87001e-04 1.66192e-04 - 1.49277e-04 1.32359e-04 1.19123e-04 1.05104e-04 - 9.52511e-05 8.45060e-05 7.61313e-05 6.85562e-05 - 6.46663e-05 6.08731e-05 5.77668e-05 5.48170e-05 - 5.21964e-05 4.96394e-05 4.72675e-05 4.52493e-05 - 4.33087e-05 4.16101e-05 3.99449e-05 3.85508e-05 - 3.71121e-05 3.59473e-05 3.47673e-05 3.37412e-05 - 3.27773e-05 3.16943e-05 3.07086e-05 3.01259e-05 - 2.92812e-05 2.84872e-05 2.78460e-05 2.71151e-05 - 2.65703e-05 2.59078e-05 2.54801e-05 2.49935e-05 - 2.45469e-05 2.40954e-05 2.36726e-05 2.32342e-05 - 2.28783e-05 2.24889e-05 2.21531e-05 2.18041e-05 - 2.15030e-05 2.11615e-05 2.08567e-05 2.05312e-05 - 2.02904e-05 1.99823e-05 1.97642e-05 1.95603e-05 - 1.93335e-05 1.91061e-05 1.89886e-05 1.88170e-05 - 1.86989e-05 1.87450e-05 1.88138e-05 1.89557e-05 - 1.91950e-05 1.95630e-05 1.98912e-05 1.99648e-05 - 1.98728e-05 1.96333e-05 1.93004e-05 1.89956e-05 - 1.86299e-05 1.81985e-05 1.78508e-05 1.75777e-05 - 1.73740e-05 1.72405e-05 1.70751e-05 1.69641e-05 - 1.69101e-05 1.68631e-05 1.68441e-05 1.68322e-05 - 1.68433e-05 1.69394e-05 1.70251e-05 1.73255e-05 - 1.75355e-05 1.79285e-05 1.84768e-05 1.89827e-05 - 1.99057e-05 2.09968e-05 2.21425e-05 2.35900e-05 - 2.53310e-05 2.74783e-05 2.96382e-05 3.13921e-05 - 3.47560e-05 3.62508e-05 4.14928e-05 4.52325e-05 - 4.90762e-05 5.30974e-05 5.82678e-05 6.15160e-05 - 6.59032e-05 6.98221e-05 7.36819e-05 7.47689e-05 - 7.67661e-05 7.66529e-05 7.66229e-05 7.65970e-05 - 7.76105e-05 7.69441e-05 7.88452e-05 7.89669e-05 - 7.91629e-05 7.78831e-05 7.70722e-05 7.74155e-05 - 7.63643e-05 7.59100e-05 7.73401e-05 7.73213e-05 - 7.87087e-05 7.99049e-05 8.24057e-05 8.57125e-05 - 9.14748e-05 9.80331e-05 1.06837e-04 1.18492e-04 - 1.30196e-04 1.44321e-04 1.62591e-04 1.81462e-04 - 2.00535e-04 2.29213e-04 2.57105e-04 2.95625e-04 - 3.29524e-04 3.73997e-04 4.18972e-04 4.82548e-04 - 5.44817e-04 6.30350e-04 7.09155e-04 8.20353e-04 - 9.25915e-04 1.05788e-03 1.19871e-03 1.42423e-03 - 1.61102e-03 1.89973e-03 2.16235e-03 2.53829e-03 - 2.98257e-03 3.54897e-03 3.80661e-03 4.48480e-03 - 4.97811e-03 5.33019e-03 6.23853e-03 6.83745e-03 - 7.24814e-03 7.75375e-03 8.22847e-03 8.55128e-03 - 8.86157e-03 9.39939e-03 9.45556e-03 9.53947e-03 - 9.55040e-03 9.29388e-03 8.81099e-03 8.71560e-03 - 8.11745e-03 7.61772e-03 7.05157e-03 6.07634e-03 - 5.59770e-03 4.83260e-03 4.20547e-03 3.59899e-03 - 3.17385e-03 2.71250e-03 2.30117e-03 1.99806e-03 - 1.72381e-03 1.51233e-03 1.32877e-03 1.17119e-03 - 1.04580e-03 9.33855e-04 8.38754e-04 7.53134e-04 - 6.75302e-04 6.05933e-04 5.43071e-04 4.87226e-04 - 4.34645e-04 3.89591e-04 3.49782e-04 3.13422e-04 - 2.80048e-04 2.51289e-04 2.25207e-04 2.02038e-04 - 1.82223e-04 1.63406e-04 1.46717e-04 1.31847e-04 - 1.18664e-04 1.06955e-04 9.62944e-05 8.68399e-05 - 7.82681e-05 7.06695e-05 6.38597e-05 5.74061e-05 - 5.19060e-05 4.79900e-05 4.55108e-05 4.40556e-05 - 4.25139e-05 4.07366e-05 3.90483e-05 3.74450e-05 - 3.59567e-05 3.45550e-05 3.32207e-05 3.19658e-05 - 3.07497e-05 2.96236e-05 2.85599e-05 2.75549e-05 - 2.65843e-05 2.56614e-05 2.47875e-05 2.39660e-05 - 2.31480e-05 2.24047e-05 2.16689e-05 2.09474e-05 - 2.02600e-05 1.95772e-05 1.89350e-05 1.83147e-05 - 1.77486e-05 1.72181e-05 1.67099e-05 1.62960e-05 - 1.59561e-05 1.56550e-05 1.53851e-05 1.51739e-05 - 1.49115e-05 1.46335e-05 1.43360e-05 1.40115e-05 - 1.36146e-05 1.32060e-05 1.29086e-05 1.26308e-05 - 1.23937e-05 1.21472e-05 1.19141e-05 1.17246e-05 - 1.15328e-05 1.13806e-05 1.12536e-05 1.11435e-05 - 1.10537e-05 1.09810e-05 1.09478e-05 1.09116e-05 - 1.09052e-05 1.08911e-05 1.09115e-05 1.09657e-05 - 1.10470e-05 1.11399e-05 1.12663e-05 1.14170e-05 - 1.16170e-05 1.18695e-05 1.21353e-05 1.23200e-05 - 1.25406e-05 1.31678e-05 1.43937e-05 1.61960e-05 - 1.82933e-05 2.05721e-05 2.30683e-05 2.58848e-05 - 2.91154e-05 3.27270e-05 3.68401e-05 4.12789e-05 - 4.64354e-05 5.20392e-05 5.83830e-05 6.51811e-05 - 7.37762e-05 8.29111e-05 9.44895e-05 1.06171e-04 - 1.21024e-04 1.38668e-04 1.63676e-04 1.85889e-04 - 2.19574e-04 2.60961e-04 3.00632e-04 3.63080e-04 - 4.08148e-04 4.67805e-04 5.33065e-04 6.11737e-04 - 6.62078e-04 7.54385e-04 7.99078e-04 8.45765e-04 - 9.16984e-04 9.66831e-04 9.89349e-04 1.01251e-03 - 1.05178e-03 1.06074e-03 1.05715e-03 1.03012e-03 - 1.00806e-03 9.62259e-04 9.18100e-04 8.33862e-04 - 7.75939e-04 6.99731e-04 5.98572e-04 5.60694e-04 - 4.60525e-04 4.14230e-04 3.52865e-04 3.03379e-04 - 2.62652e-04 2.26030e-04 1.92352e-04 1.66185e-04 - 1.45337e-04 1.26152e-04 1.11347e-04 9.78997e-05 - 8.75467e-05 7.81191e-05 7.01292e-05 6.30718e-05 - 5.65067e-05 5.10257e-05 4.60079e-05 4.12961e-05 - 3.70040e-05 3.32731e-05 2.98624e-05 2.67490e-05 - 2.40296e-05 2.15799e-05 1.92795e-05 1.73545e-05 - 1.55575e-05 1.39666e-05 1.25623e-05 1.12708e-05 - 1.01481e-05 9.12763e-06 8.23599e-06 7.45576e-06 - 6.69784e-06 6.04989e-06 5.48630e-06 4.93108e-06 - 4.45128e-06 4.07189e-06 3.81130e-06 3.61595e-06 - 3.44040e-06 3.25332e-06 3.08615e-06 2.92273e-06 - 2.76700e-06 2.62288e-06 2.48319e-06 2.35268e-06 - 2.22571e-06 2.10415e-06 1.99088e-06 1.88386e-06 - 1.78473e-06 1.68685e-06 1.59892e-06 1.51644e-06 - 1.43842e-06 1.36639e-06 1.29773e-06 1.23008e-06 - 1.16513e-06 1.10203e-06 1.04229e-06 9.84384e-07 - 9.29820e-07 8.79379e-07 8.33742e-07 7.90748e-07 - 7.51213e-07 7.13861e-07 6.78983e-07 6.47135e-07 - 6.17622e-07 5.90558e-07 5.65728e-07 5.44169e-07 - 5.24491e-07 5.08010e-07 4.93778e-07 4.81390e-07 - 4.70906e-07 4.63700e-07 4.57992e-07 4.53329e-07 - 4.51187e-07 4.50956e-07 4.52727e-07 4.57138e-07 - 4.63536e-07 4.72322e-07 4.83210e-07 4.97431e-07 - 5.13689e-07 5.32738e-07 5.54530e-07 5.79672e-07 - 6.07298e-07 6.39919e-07 6.74392e-07 7.14426e-07 - 7.57507e-07 8.04962e-07 8.60823e-07 9.15188e-07 - 9.83373e-07 1.06371e-06 1.15096e-06 1.23711e-06 - 1.34370e-06 1.48342e-06 1.62031e-06 1.80157e-06 - 1.98668e-06 2.24201e-06 2.47769e-06 2.85583e-06 - 3.24481e-06 3.70890e-06 4.31495e-06 5.16311e-06 - 6.07704e-06 7.31915e-06 8.69458e-06 1.04835e-05 - 1.22708e-05 1.47483e-05 1.72588e-05 2.06775e-05 - 2.55283e-05 2.94513e-05 3.40324e-05 3.65749e-05 - 4.00720e-05 4.28902e-05 4.58447e-05 4.91059e-05 - 5.13549e-05 5.27191e-05 5.51339e-05 5.62838e-05 - 5.90173e-05 5.92846e-05 6.13128e-05 5.94576e-05 - 6.11489e-05 6.02677e-05 6.06333e-05 5.90747e-05 - 5.95814e-05 6.24134e-05 6.35171e-05 6.67578e-05 - 7.03313e-05 7.69524e-05 8.36905e-05 9.46950e-05 - 1.05443e-04 1.17595e-04 1.35558e-04 1.56927e-04 - 1.82281e-04 2.10261e-04 2.47710e-04 2.72851e-04 - 3.26344e-04 3.53197e-04 3.71687e-04 4.38454e-04 - 4.54576e-04 5.13331e-04 5.45449e-04 5.84080e-04 - 6.27181e-04 6.28348e-04 6.55636e-04 6.93665e-04 - 7.04293e-04 7.18581e-04 7.12017e-04 6.94887e-04 - 6.95085e-04 6.37971e-04 5.90515e-04 5.39098e-04 - 4.65702e-04 4.12783e-04 3.40127e-04 2.90467e-04 - 2.30864e-04 1.83857e-04 1.53670e-04 1.22175e-04 - 9.83471e-05 7.89869e-05 6.36018e-05 5.17534e-05 - 4.26345e-05 3.52952e-05 2.94160e-05 2.47567e-05 - 2.11515e-05 1.82385e-05 1.60892e-05 1.44255e-05 - 1.30585e-05 1.18894e-05 1.09510e-05 1.00349e-05 - 9.28248e-06 8.56485e-06 7.90591e-06 7.29432e-06 - 6.76571e-06 6.26071e-06 5.84703e-06 5.42141e-06 - 5.07007e-06 4.72073e-06 4.42380e-06 4.15408e-06 - 3.89002e-06 3.66442e-06 3.45304e-06 3.25349e-06 - 3.07159e-06 2.90918e-06 2.75190e-06 2.59835e-06 - 2.45489e-06 2.32478e-06 2.19962e-06 2.07842e-06 - 1.96584e-06 1.85315e-06 1.75513e-06 1.66256e-06 - 1.57515e-06 1.49004e-06 1.41026e-06 1.33558e-06 - 1.26627e-06 1.19852e-06 1.13513e-06 1.07620e-06 - 1.01975e-06 9.66859e-07 9.16399e-07 8.68384e-07 - 8.23125e-07 7.80151e-07 7.39818e-07 7.01635e-07 - 6.65978e-07 6.32447e-07 6.01186e-07 5.71255e-07 - 5.43544e-07 5.18144e-07 4.93985e-07 4.72295e-07 - 4.52275e-07 4.36442e-07 4.22448e-07 4.14107e-07 - 4.09625e-07 4.21928e-07 4.22063e-07 4.48292e-07 - 4.97428e-07 5.31046e-07 5.71797e-07 6.26792e-07 - 6.93996e-07 7.53022e-07 8.40503e-07 9.01327e-07 - 9.75554e-07 1.03390e-06 1.14654e-06 1.24343e-06 - 1.34924e-06 1.46211e-06 1.51860e-06 1.58080e-06 - 1.59421e-06 1.63659e-06 1.67519e-06 1.70135e-06 - 1.71587e-06 1.75360e-06 1.80398e-06 1.82818e-06 - 1.84477e-06 1.83986e-06 1.83790e-06 1.83492e-06 - 1.81720e-06 1.84532e-06 1.85066e-06 1.82996e-06 - 1.91376e-06 1.97394e-06 2.07453e-06 2.19152e-06 - 2.33031e-06 2.47638e-06 2.71375e-06 2.93994e-06 - 3.27453e-06 3.64267e-06 4.09455e-06 4.70642e-06 - 5.42839e-06 6.28176e-06 7.27377e-06 8.34074e-06 - 9.77505e-06 1.13643e-05 1.30161e-05 1.55797e-05 - 1.81503e-05 2.01219e-05 2.19627e-05 2.49358e-05 - 2.88072e-05 3.05378e-05 3.24710e-05 3.47275e-05 - 3.65235e-05 3.83335e-05 3.83771e-05 3.88850e-05 - 4.13856e-05 4.18033e-05 4.15326e-05 3.99089e-05 - 3.92544e-05 3.83033e-05 3.56427e-05 3.30070e-05 - 3.04628e-05 2.75496e-05 2.36880e-05 2.08052e-05 - 1.76595e-05 1.51145e-05 1.34413e-05 1.16425e-05 - 1.00221e-05 8.71462e-06 7.63546e-06 6.74865e-06 - 6.00898e-06 5.42143e-06 4.93919e-06 4.45905e-06 - 4.05274e-06 3.67253e-06 3.30104e-06 2.95808e-06 - 2.66700e-06 2.39484e-06 2.13342e-06 1.90923e-06 - 1.70788e-06 1.51229e-06 1.36769e-06 1.21107e-06 - 1.08696e-06 9.66457e-07 8.58925e-07 7.69089e-07 - 6.80951e-07 6.12863e-07 5.37411e-07 4.78693e-07 - 4.27133e-07 3.80099e-07 3.35506e-07 3.05908e-07 - 2.72995e-07 2.47418e-07 2.23751e-07 2.02440e-07 - 1.84465e-07 1.67485e-07 1.54375e-07 1.41528e-07 - 1.29308e-07 1.18120e-07 1.09061e-07 1.02350e-07 - 9.67322e-08 9.18150e-08 8.72163e-08 8.28744e-08 - 7.86562e-08 7.45620e-08 7.17320e-08 6.89417e-08 - 6.59374e-08 6.30095e-08 6.01791e-08 5.73498e-08 - 5.48287e-08 5.23806e-08 4.99955e-08 4.77725e-08 - 4.57175e-08 4.37662e-08 4.19569e-08 4.02429e-08 - 3.87041e-08 3.72602e-08 3.58756e-08 3.45524e-08 - 3.34983e-08 3.23880e-08 3.16034e-08 3.07688e-08 - 3.02318e-08 2.96905e-08 2.95996e-08 2.99599e-08 - 2.99684e-08 3.08731e-08 3.21974e-08 3.43511e-08 - 3.56495e-08 3.70552e-08 3.84965e-08 4.07254e-08 - 4.20045e-08 4.39544e-08 4.57016e-08 4.72350e-08 - 4.88417e-08 4.97346e-08 5.08255e-08 5.15251e-08 - 5.19594e-08 5.38541e-08 5.47608e-08 5.60552e-08 - 5.72609e-08 5.72837e-08 5.80516e-08 6.07470e-08 - 6.22348e-08 6.89463e-08 7.36219e-08 7.84507e-08 - 8.36436e-08 9.06092e-08 9.74125e-08 1.05766e-07 - 1.14655e-07 1.22992e-07 1.35572e-07 1.48056e-07 - 1.62542e-07 1.76927e-07 1.94445e-07 2.19441e-07 - 2.45670e-07 2.70274e-07 3.27211e-07 3.81310e-07 - 4.55597e-07 5.39395e-07 6.74542e-07 7.90694e-07 - 1.05280e-06 1.31350e-06 1.67980e-06 2.01746e-06 - 2.29699e-06 2.46702e-06 2.61262e-06 2.79367e-06 - 3.02585e-06 3.23327e-06 3.41504e-06 3.61475e-06 - 3.76109e-06 4.00171e-06 4.11205e-06 4.27316e-06 - 4.42043e-06 4.56123e-06 4.77327e-06 5.02790e-06 - 5.15620e-06 5.57487e-06 5.99775e-06 6.29014e-06 - 7.00630e-06 7.96093e-06 9.03334e-06 9.93690e-06 - 1.17198e-05 1.28801e-05 1.39348e-05 1.62964e-05 - 1.72965e-05 1.91193e-05 2.05605e-05 2.22714e-05 - 2.35742e-05 2.56676e-05 2.50974e-05 2.63234e-05 - 2.66955e-05 2.70075e-05 2.67158e-05 2.56487e-05 - 2.46991e-05 2.40808e-05 2.23412e-05 2.10526e-05 - 1.85671e-05 1.64839e-05 1.42043e-05 1.21804e-05 - 1.09420e-05 9.46010e-06 8.14149e-06 7.07614e-06 - 6.28113e-06 5.65266e-06 5.13927e-06 4.68150e-06 - 4.29785e-06 3.97150e-06 3.67553e-06 3.43734e-06 - 3.23492e-06 3.04801e-06 2.94245e-06 2.85520e-06 - 2.85337e-06 2.79620e-06 2.85928e-06 2.81207e-06 - 2.77848e-06 2.90562e-06 2.88862e-06 2.96584e-06 - 3.04831e-06 3.07016e-06 3.06840e-06 3.12099e-06 - 3.16845e-06 3.16662e-06 3.13076e-06 3.14696e-06 - 2.77315e-06 2.46324e-06 2.13647e-06 1.80510e-06 - 1.42328e-06 1.16856e-06 9.82987e-07 7.91893e-07 - 6.91038e-07 5.55700e-07 4.78240e-07 4.00711e-07 - 3.35870e-07 2.79927e-07 2.42468e-07 2.09052e-07 - 1.87538e-07 1.68180e-07 1.53683e-07 1.40035e-07 - 1.31013e-07 1.18626e-07 1.09427e-07 1.01676e-07 - 9.37436e-08 8.67486e-08 7.99540e-08 7.47078e-08 - 6.98715e-08 6.51611e-08 6.06227e-08 5.68072e-08 - 5.33571e-08 5.02097e-08 4.72561e-08 4.43897e-08 - 4.19593e-08 3.96333e-08 3.74452e-08 3.54238e-08 - 3.35700e-08 3.18417e-08 3.01788e-08 2.87484e-08 - 2.73581e-08 2.60682e-08 2.48938e-08 2.38135e-08 - 2.28076e-08 2.18661e-08 2.10152e-08 2.02421e-08 - 1.94685e-08 1.88761e-08 1.82727e-08 1.76109e-08 - 1.73610e-08 1.69099e-08 1.69405e-08 1.68542e-08 - 1.67902e-08 1.78055e-08 1.86892e-08 2.04086e-08 - 2.23790e-08 2.57225e-08 3.06646e-08 3.64387e-08 - 4.16620e-08 4.56542e-08 4.91319e-08 5.35788e-08 - 5.90900e-08 6.37688e-08 6.82870e-08 7.31127e-08 - 7.87583e-08 8.42216e-08 8.98039e-08 9.54303e-08 - 1.03067e-07 1.08204e-07 1.16702e-07 1.24818e-07 - 1.30722e-07 1.40326e-07 1.49955e-07 1.63145e-07 - 1.82523e-07 2.01275e-07 2.24155e-07 2.56582e-07 - 2.91295e-07 3.46161e-07 3.86006e-07 4.41173e-07 - 5.30368e-07 6.02226e-07 7.06938e-07 7.81009e-07 - 8.73727e-07 9.68340e-07 1.10855e-06 1.22093e-06 - 1.31063e-06 1.41609e-06 1.48126e-06 1.56338e-06 - 1.57717e-06 1.67780e-06 1.71284e-06 1.72438e-06 - 1.71359e-06 1.65086e-06 1.61570e-06 1.56750e-06 - 1.47166e-06 1.36377e-06 1.22877e-06 1.15454e-06 - 9.91416e-07 8.55659e-07 7.28844e-07 6.29909e-07 - 5.51966e-07 4.81829e-07 4.20201e-07 3.74654e-07 - 3.40488e-07 3.07832e-07 2.84905e-07 2.64218e-07 - 2.45419e-07 2.29308e-07 2.15573e-07 2.03805e-07 - 1.94280e-07 1.90338e-07 1.84094e-07 1.78679e-07 - 1.77286e-07 1.76019e-07 1.74593e-07 1.72608e-07 - 1.73755e-07 1.69314e-07 1.66562e-07 1.67840e-07 - 1.64674e-07 1.63212e-07 1.64365e-07 1.62930e-07 - 1.63681e-07 1.50506e-07 1.31191e-07 1.17789e-07 - 9.24723e-08 7.74297e-08 5.83833e-08 4.84141e-08 - 3.92577e-08 3.69599e-08 3.25666e-08 2.64318e-08 - 2.27423e-08 2.02048e-08 1.65693e-08 1.44913e-08 - 1.22735e-08 1.09776e-08 9.84488e-09 8.96079e-09 - 8.20864e-09 7.59182e-09 7.01692e-09 6.48861e-09 - 6.04989e-09 5.63773e-09 5.27187e-09 4.94765e-09 - 4.65615e-09 4.38206e-09 4.12197e-09 3.90030e-09 - 3.69758e-09 3.50768e-09 3.33527e-09 3.17599e-09 - 3.03435e-09 2.90418e-09 2.78290e-09 2.67483e-09 - 2.57692e-09 2.48926e-09 2.40873e-09 2.33877e-09 - 2.27913e-09 2.22518e-09 2.18195e-09 2.14741e-09 - 2.12195e-09 2.10522e-09 2.09918e-09 2.10082e-09 - 2.11442e-09 2.13526e-09 2.16864e-09 2.21415e-09 - 2.26865e-09 2.33670e-09 2.41705e-09 2.50979e-09 - 2.61637e-09 2.74118e-09 2.87971e-09 3.04307e-09 - 3.23072e-09 3.42903e-09 3.65098e-09 3.91549e-09 - 4.11920e-09 4.38219e-09 4.73628e-09 5.19123e-09 - 5.82726e-09 6.52641e-09 7.27563e-09 8.16109e-09 - 9.10217e-09 1.01555e-08 1.13866e-08 1.27368e-08 - 1.42250e-08 1.59673e-08 1.77725e-08 1.99458e-08 - 2.24633e-08 2.52594e-08 2.86095e-08 3.23543e-08 - 3.67381e-08 4.20264e-08 4.81070e-08 5.46707e-08 - 6.45358e-08 7.31703e-08 8.52619e-08 9.82666e-08 - 1.13624e-07 1.28924e-07 1.45060e-07 1.64811e-07 - 1.83152e-07 2.06983e-07 2.25384e-07 2.48621e-07 - 2.76441e-07 3.05428e-07 3.40258e-07 3.76506e-07 - 4.10787e-07 4.55697e-07 5.17029e-07 5.83386e-07 - 6.25889e-07 6.90106e-07 7.85908e-07 8.37720e-07 - 9.27347e-07 1.00130e-06 1.11117e-06 1.16956e-06 - 1.23055e-06 1.32742e-06 1.36529e-06 1.45533e-06 - 1.49619e-06 1.51289e-06 1.54509e-06 1.52801e-06 - 1.50700e-06 1.44982e-06 1.40471e-06 1.35280e-06 - 1.23017e-06 1.14590e-06 1.00036e-06 9.23442e-07 - 7.95387e-07 6.83740e-07 5.85115e-07 5.05479e-07 - 4.39813e-07 3.90936e-07 3.48053e-07 3.11393e-07 - 2.78643e-07 2.50645e-07 2.25502e-07 2.05173e-07 - 1.86734e-07 1.72160e-07 1.59072e-07 1.49718e-07 - 1.42185e-07 1.36354e-07 1.30974e-07 1.30469e-07 - 1.30914e-07 1.32873e-07 1.35323e-07 1.38546e-07 - 1.49002e-07 1.52386e-07 1.57828e-07 1.74848e-07 - 1.83992e-07 1.99347e-07 2.12266e-07 2.30645e-07 - 2.41980e-07 2.48899e-07 2.62741e-07 2.71015e-07 - 2.76005e-07 2.87420e-07 2.90660e-07 2.87093e-07 - 2.81054e-07 2.48698e-07 2.14472e-07 1.76215e-07 - 1.46724e-07 1.26991e-07 8.79299e-08 8.24092e-08 - 6.89393e-08 5.84331e-08 4.85423e-08 3.93296e-08 - 3.30490e-08 2.93441e-08 2.63958e-08 2.36103e-08 - 2.12387e-08 1.97731e-08 1.80543e-08 1.56812e-08 - 1.35557e-08 1.17756e-08 1.06580e-08 1.00009e-08 - 9.30167e-09 8.73022e-09 7.94419e-09 7.12684e-09 - 6.67676e-09 5.95069e-09 5.42252e-09 4.91633e-09 - 4.51695e-09 4.12829e-09 3.85129e-09 3.56347e-09 - 3.30071e-09 3.10018e-09 2.91004e-09 2.74483e-09 - 2.60987e-09 2.48822e-09 2.37305e-09 2.26806e-09 - 2.17091e-09 2.08238e-09 2.00033e-09 1.93019e-09 - 1.86662e-09 1.80952e-09 1.76118e-09 1.71767e-09 - 1.68111e-09 1.65052e-09 1.62603e-09 1.60949e-09 - 1.60001e-09 1.60005e-09 1.61368e-09 1.64136e-09 - 1.68515e-09 1.74258e-09 1.86147e-09 1.96382e-09 - 2.10036e-09 2.32866e-09 2.65005e-09 2.98602e-09 - 3.41185e-09 4.08309e-09 5.00049e-09 6.22032e-09 - 7.36042e-09 8.19044e-09 8.80185e-09 9.67397e-09 - 1.05720e-08 1.14745e-08 1.27846e-08 1.40163e-08 - 1.55490e-08 1.81369e-08 1.94525e-08 2.23743e-08 - 2.58572e-08 2.89461e-08 3.25285e-08 3.72178e-08 - 4.40845e-08 4.85349e-08 5.60701e-08 6.23540e-08 - 7.06277e-08 7.80643e-08 8.57588e-08 9.21907e-08 - 9.86116e-08 1.05942e-07 1.11480e-07 1.15974e-07 - 1.15384e-07 1.23990e-07 1.24967e-07 1.24987e-07 - 1.24031e-07 1.18607e-07 1.15953e-07 1.10051e-07 - 1.03451e-07 9.59861e-08 8.87258e-08 7.50812e-08 - 6.61664e-08 5.70221e-08 5.03239e-08 4.34936e-08 - 3.72963e-08 3.28052e-08 2.91953e-08 2.58325e-08 - 2.26600e-08 2.07316e-08 1.84582e-08 1.65967e-08 - 1.50405e-08 1.36733e-08 1.25775e-08 1.15994e-08 - 1.10114e-08 1.03324e-08 9.99488e-09 9.82926e-09 - 9.68857e-09 9.81196e-09 9.97172e-09 1.00639e-08 - 1.12327e-08 1.17112e-08 1.24037e-08 1.33440e-08 - 1.45144e-08 1.51603e-08 1.67514e-08 1.82085e-08 - 1.92717e-08 2.05203e-08 2.13707e-08 2.26222e-08 - 2.32740e-08 2.36363e-08 2.39668e-08 2.38629e-08 - 2.34431e-08 2.07885e-08 1.80917e-08 1.45777e-08 - 1.14550e-08 8.89342e-09 7.16652e-09 6.25290e-09 - 5.57089e-09 4.16988e-09 3.66177e-09 2.99082e-09 - 2.43223e-09 2.06917e-09 1.77951e-09 1.55934e-09 - 1.37976e-09 1.23315e-09 1.10952e-09 1.01017e-09 - 9.26301e-10 8.55575e-10 7.93748e-10 7.40451e-10 - 6.94184e-10 6.53558e-10 6.18248e-10 5.87353e-10 - 5.60659e-10 5.37652e-10 5.17156e-10 5.00780e-10 - 4.86411e-10 4.75217e-10 4.66353e-10 4.60153e-10 - 4.55960e-10 4.54185e-10 4.54659e-10 4.57916e-10 - 4.62848e-10 4.70784e-10 4.81183e-10 4.93760e-10 - 5.09259e-10 5.27559e-10 5.48634e-10 5.72404e-10 - 5.99989e-10 6.30513e-10 6.60235e-10 6.92349e-10 - 7.37859e-10 8.06669e-10 9.00866e-10 1.01010e-09 - 1.12973e-09 1.26319e-09 1.41180e-09 1.57737e-09 - 1.75784e-09 1.95812e-09 2.17987e-09 2.43211e-09 - 2.70325e-09 3.00256e-09 3.33992e-09 3.73413e-09 - 4.19356e-09 4.69475e-09 5.26049e-09 5.97390e-09 - 6.81143e-09 7.78654e-09 8.84765e-09 1.02507e-08 - 1.19909e-08 1.36478e-08 1.59172e-08 1.84325e-08 - 2.11776e-08 2.52997e-08 2.85503e-08 3.32087e-08 - 3.84237e-08 4.39945e-08 5.00197e-08 5.76655e-08 - 6.45694e-08 7.16620e-08 8.41523e-08 9.31766e-08 - 1.05677e-07 1.15849e-07 1.26155e-07 1.33274e-07 - 1.48621e-07 1.63372e-07 1.70381e-07 1.77041e-07 - 1.84883e-07 1.89361e-07 1.93589e-07 1.95476e-07 - 1.93432e-07 1.90408e-07 1.86146e-07 1.79432e-07 - 1.65784e-07 1.63601e-07 1.50291e-07 1.39514e-07 - 1.22429e-07 1.09282e-07 9.81912e-08 8.39930e-08 - 7.24953e-08 6.34508e-08 5.49549e-08 4.81846e-08 - 4.22024e-08 3.74461e-08 3.30600e-08 2.91929e-08 - 2.57944e-08 2.28613e-08 2.02764e-08 1.80467e-08 - 1.61853e-08 1.45422e-08 1.31931e-08 1.19900e-08 - 1.10149e-08 1.02049e-08 9.50651e-09 8.90871e-09 - 8.41693e-09 8.07919e-09 7.81832e-09 7.68693e-09 - 7.64996e-09 7.64717e-09 7.83457e-09 8.02512e-09 - 8.41671e-09 8.91189e-09 9.55234e-09 1.02098e-08 - 1.09842e-08 1.17915e-08 1.30259e-08 1.40293e-08 - 1.55007e-08 1.65964e-08 1.85017e-08 1.94655e-08 - 2.09274e-08 2.23820e-08 2.40611e-08 2.55845e-08 - 2.69274e-08 2.73690e-08 2.89156e-08 2.91770e-08 - 2.92983e-08 2.93175e-08 2.89118e-08 2.78521e-08 - 2.62500e-08 2.57533e-08 2.34819e-08 2.19913e-08 - 2.00193e-08 1.80694e-08 1.53973e-08 1.29879e-08 - 1.15638e-08 9.84982e-09 8.62317e-09 7.64939e-09 - 6.75886e-09 6.00650e-09 5.34234e-09 4.70926e-09 - 4.21797e-09 3.74855e-09 3.33114e-09 2.98475e-09 - 2.67282e-09 2.36839e-09 2.13908e-09 1.92361e-09 - 1.72148e-09 1.53993e-09 1.37378e-09 1.22863e-09 - 1.10189e-09 9.88348e-10 8.91007e-10 8.05948e-10 - 7.33674e-10 6.72115e-10 6.20115e-10 5.76314e-10 - 5.39214e-10 5.08853e-10 4.84873e-10 4.66681e-10 - 4.54373e-10 4.48493e-10 4.49057e-10 4.56053e-10 - 4.69645e-10 4.91176e-10 5.20275e-10 5.58070e-10 - 6.05518e-10 6.64094e-10 7.36766e-10 8.23487e-10 - 9.22595e-10 1.04760e-09 1.19367e-09 1.33491e-09 - 1.55581e-09 1.75812e-09 1.99418e-09 2.26194e-09 - 2.64354e-09 3.02119e-09 3.42668e-09 3.81616e-09 - 4.32537e-09 4.94519e-09 5.61470e-09 6.23358e-09 - 6.96288e-09 7.76314e-09 8.51707e-09 9.49853e-09 - 1.04701e-08 1.15372e-08 1.27324e-08 1.37692e-08 - 1.46566e-08 1.57992e-08 1.69129e-08 1.79775e-08 - 1.85360e-08 1.91177e-08 1.95249e-08 2.02313e-08 - 1.98665e-08 1.99909e-08 2.01502e-08 1.96362e-08 - 1.92390e-08 1.85252e-08 1.77198e-08 1.69780e-08 - 1.59469e-08 1.51469e-08 1.31228e-08 1.25355e-08 - 1.08682e-08 9.56835e-09 8.20311e-09 7.24150e-09 - 6.24960e-09 5.44568e-09 4.64236e-09 4.10121e-09 - 3.58242e-09 3.14979e-09 2.78110e-09 2.44207e-09 - 2.15607e-09 1.90675e-09 1.69247e-09 1.49982e-09 - 1.35188e-09 1.21118e-09 1.08833e-09 9.80726e-10 - 8.88757e-10 8.10075e-10 7.43596e-10 6.87839e-10 - 6.42594e-10 6.07964e-10 5.81641e-10 5.61701e-10 - 5.75566e-10 5.56964e-10 5.69676e-10 5.92460e-10 - 6.27096e-10 6.67245e-10 6.96233e-10 7.93693e-10 - 8.70301e-10 9.29671e-10 1.05477e-09 1.15377e-09 - 1.27951e-09 1.39625e-09 1.49417e-09 1.64057e-09 - 1.74746e-09 1.89898e-09 1.97405e-09 2.05047e-09 - 2.08067e-09 2.21080e-09 2.23424e-09 2.19309e-09 - 2.14830e-09 2.00279e-09 2.01612e-09 2.01839e-09 - 1.92663e-09 1.78912e-09 1.65551e-09 1.40344e-09 - 1.25902e-09 1.06750e-09 9.15078e-10 7.89963e-10 - 6.90186e-10 6.07747e-10 5.37780e-10 4.79048e-10 - 4.29395e-10 3.87514e-10 3.52233e-10 3.23203e-10 - 2.99453e-10 2.80628e-10 2.66482e-10 2.56564e-10 - 2.51115e-10 2.49712e-10 2.52543e-10 2.59427e-10 - 2.71045e-10 2.87162e-10 3.08446e-10 3.35208e-10 - 3.67552e-10 4.06550e-10 4.53003e-10 5.07136e-10 - 5.70421e-10 6.43917e-10 7.29219e-10 8.26796e-10 - 9.39286e-10 1.07003e-09 1.22133e-09 1.39937e-09 - 1.61547e-09 1.85732e-09 2.11737e-09 2.50505e-09 - 2.89983e-09 3.22193e-09 3.67438e-09 4.18871e-09 - 4.90903e-09 5.53594e-09 6.44465e-09 7.35226e-09 - 8.36632e-09 9.45805e-09 1.12149e-08 1.26638e-08 - 1.44801e-08 1.62325e-08 1.90552e-08 2.11896e-08 - 2.45492e-08 2.80739e-08 3.08033e-08 3.56924e-08 - 3.91610e-08 4.37188e-08 4.65527e-08 5.14417e-08 - 5.40519e-08 5.62337e-08 5.87578e-08 6.00178e-08 - 6.14815e-08 6.24925e-08 6.21354e-08 6.16172e-08 - 5.92864e-08 5.91423e-08 5.51430e-08 5.22474e-08 - 4.98196e-08 4.37843e-08 3.87678e-08 3.35098e-08 - 3.01322e-08 -*END diff --git a/data/continua/mt_ckd4p3_s296 b/data/continua/mt_ckd4p3_s296 deleted file mode 100644 index 93c0b4d4..00000000 --- a/data/continua/mt_ckd4p3_s296 +++ /dev/null @@ -1,508 +0,0 @@ -*BEGIN_DATA - - Start of table = -2.00000E+01 cm-1 - End of table = 1.99000E+04 cm-1 - Increment in table = 1.00000E+01 cm-1 - Number of points in table = 1993 - - Continuum coefficients (cm^3.molec-1 * 1.0E-20) - 0.00000e+00 6.86998e-04 0.00000e+00 6.86863e-04 - 2.62657e-03 5.38298e-03 8.35915e-03 1.11525e-02 - 1.37199e-02 1.61279e-02 1.85704e-02 2.10087e-02 - 2.33217e-02 2.53872e-02 2.70986e-02 2.84099e-02 - 2.92984e-02 2.97701e-02 2.98530e-02 2.95743e-02 - 2.89855e-02 2.81363e-02 2.70745e-02 2.58510e-02 - 2.45172e-02 2.31128e-02 2.16840e-02 2.02605e-02 - 1.88774e-02 1.75331e-02 1.62648e-02 1.50668e-02 - 1.39494e-02 1.29135e-02 1.19578e-02 1.10752e-02 - 1.02668e-02 9.52142e-03 8.83866e-03 8.20903e-03 - 7.62633e-03 7.08922e-03 6.59391e-03 6.13098e-03 - 5.70080e-03 5.29914e-03 4.92692e-03 4.57707e-03 - 4.24808e-03 3.94513e-03 3.65742e-03 3.38995e-03 - 3.14044e-03 2.90677e-03 2.68928e-03 2.48577e-03 - 2.29679e-03 2.12033e-03 1.95635e-03 1.80416e-03 - 1.66232e-03 1.53118e-03 1.40939e-03 1.29701e-03 - 1.19234e-03 1.09626e-03 1.00676e-03 9.24562e-04 - 8.51578e-04 7.87952e-04 7.32851e-04 6.85596e-04 - 6.44492e-04 6.07513e-04 5.70074e-04 5.36859e-04 - 5.05187e-04 4.72338e-04 4.39691e-04 4.12505e-04 - 3.90723e-04 3.67566e-04 3.51049e-04 3.34565e-04 - 3.19114e-04 3.04066e-04 2.91110e-04 2.79888e-04 - 2.68419e-04 2.57719e-04 2.46971e-04 2.36173e-04 - 2.25702e-04 2.14640e-04 2.01816e-04 1.90536e-04 - 1.79801e-04 1.70372e-04 1.61220e-04 1.52144e-04 - 1.45069e-04 1.36904e-04 1.29775e-04 1.23360e-04 - 1.17961e-04 1.13089e-04 1.08233e-04 1.04073e-04 - 1.00080e-04 9.65179e-05 9.32158e-05 9.03297e-05 - 8.79142e-05 8.51705e-05 8.32885e-05 8.09725e-05 - 7.95183e-05 7.88048e-05 7.83570e-05 7.86871e-05 - 7.95837e-05 8.05888e-05 8.27910e-05 8.66032e-05 - 9.18868e-05 9.63750e-05 1.03000e-04 1.13589e-04 - 1.29179e-04 1.50264e-04 1.75267e-04 2.02721e-04 - 2.32522e-04 2.69065e-04 3.16092e-04 3.62400e-04 - 4.17871e-04 4.89273e-04 5.52894e-04 6.49943e-04 - 7.46516e-04 8.51695e-04 1.01393e-03 1.12228e-03 - 1.38656e-03 1.48379e-03 1.72200e-03 1.92185e-03 - 2.26863e-03 2.46745e-03 2.87947e-03 3.20407e-03 - 3.60547e-03 4.08365e-03 4.30936e-03 4.82668e-03 - 5.13417e-03 5.44833e-03 5.74915e-03 5.95866e-03 - 6.06097e-03 6.07757e-03 6.10656e-03 6.11789e-03 - 6.17375e-03 6.15242e-03 6.10437e-03 5.90670e-03 - 5.87863e-03 5.70105e-03 5.32307e-03 5.04718e-03 - 4.68520e-03 4.40320e-03 4.11245e-03 3.59029e-03 - 3.33903e-03 2.92530e-03 2.60937e-03 2.29139e-03 - 2.06126e-03 1.79117e-03 1.64567e-03 1.41693e-03 - 1.26210e-03 1.10712e-03 9.83687e-04 8.99864e-04 - 7.85433e-04 7.33577e-04 6.17102e-04 5.68193e-04 - 4.88637e-04 4.33735e-04 3.92675e-04 3.46386e-04 - 3.04012e-04 2.74695e-04 2.41957e-04 2.17645e-04 - 1.91309e-04 1.69345e-04 1.52853e-04 1.41102e-04 - 1.29966e-04 1.16582e-04 1.04009e-04 9.13279e-05 - 8.15841e-05 7.19171e-05 6.38415e-05 5.61609e-05 - 5.00257e-05 4.40384e-05 3.93564e-05 3.51977e-05 - 3.29475e-05 3.07386e-05 2.87643e-05 2.70068e-05 - 2.53614e-05 2.38948e-05 2.25445e-05 2.13232e-05 - 2.02086e-05 1.91758e-05 1.82349e-05 1.73718e-05 - 1.65853e-05 1.58495e-05 1.51789e-05 1.45562e-05 - 1.39890e-05 1.34620e-05 1.29759e-05 1.25266e-05 - 1.21124e-05 1.17290e-05 1.13747e-05 1.10475e-05 - 1.07430e-05 1.04616e-05 1.02012e-05 9.95973e-06 - 9.73750e-06 9.52992e-06 9.33722e-06 9.15717e-06 - 8.99239e-06 8.83819e-06 8.69718e-06 8.56461e-06 - 8.44306e-06 8.33269e-06 8.22866e-06 8.13607e-06 - 8.05003e-06 7.97316e-06 7.90558e-06 7.84740e-06 - 7.79874e-06 7.75717e-06 7.73049e-06 7.72146e-06 - 7.71991e-06 7.75198e-06 7.81282e-06 7.91064e-06 - 8.05110e-06 8.22676e-06 8.38760e-06 8.48548e-06 - 8.49029e-06 8.43051e-06 8.34581e-06 8.28460e-06 - 8.16845e-06 8.04578e-06 7.96300e-06 7.90958e-06 - 7.88308e-06 7.89486e-06 7.90375e-06 7.94868e-06 - 8.01326e-06 8.09211e-06 8.19381e-06 8.31861e-06 - 8.46672e-06 8.64409e-06 8.85385e-06 9.11351e-06 - 9.40633e-06 9.75281e-06 1.01506e-05 1.05770e-05 - 1.12302e-05 1.19197e-05 1.27045e-05 1.36532e-05 - 1.47849e-05 1.62644e-05 1.76822e-05 1.89362e-05 - 2.12775e-05 2.24940e-05 2.59243e-05 2.82351e-05 - 3.03576e-05 3.31316e-05 3.58012e-05 3.76307e-05 - 3.95326e-05 4.10766e-05 4.27223e-05 4.27663e-05 - 4.32138e-05 4.28212e-05 4.23627e-05 4.19005e-05 - 4.22845e-05 4.17858e-05 4.27406e-05 4.30012e-05 - 4.34221e-05 4.29813e-05 4.26332e-05 4.29901e-05 - 4.28318e-05 4.28985e-05 4.41338e-05 4.47570e-05 - 4.62326e-05 4.79130e-05 5.01615e-05 5.33789e-05 - 5.73752e-05 6.17925e-05 6.76657e-05 7.55747e-05 - 8.30609e-05 9.25033e-05 1.04457e-04 1.17020e-04 - 1.29757e-04 1.48678e-04 1.67334e-04 1.93029e-04 - 2.16198e-04 2.46301e-04 2.77607e-04 3.19732e-04 - 3.62821e-04 4.21200e-04 4.73980e-04 5.48373e-04 - 6.22479e-04 7.09999e-04 8.03995e-04 9.48347e-04 - 1.06124e-03 1.23979e-03 1.38867e-03 1.60806e-03 - 1.85480e-03 2.16901e-03 2.28491e-03 2.63125e-03 - 2.87110e-03 3.03338e-03 3.50911e-03 3.81421e-03 - 4.03703e-03 4.31976e-03 4.58186e-03 4.73820e-03 - 4.91013e-03 5.19801e-03 5.19326e-03 5.17721e-03 - 5.10112e-03 4.93075e-03 4.66910e-03 4.63235e-03 - 4.34194e-03 4.11819e-03 3.87041e-03 3.38876e-03 - 3.17819e-03 2.79406e-03 2.47859e-03 2.16646e-03 - 1.94807e-03 1.69562e-03 1.46010e-03 1.28017e-03 - 1.10632e-03 9.71855e-04 8.50027e-04 7.44866e-04 - 6.53744e-04 5.74006e-04 5.07722e-04 4.49437e-04 - 3.98417e-04 3.52565e-04 3.12160e-04 2.77565e-04 - 2.45851e-04 2.18772e-04 1.94870e-04 1.73238e-04 - 1.53770e-04 1.37176e-04 1.21764e-04 1.08320e-04 - 9.66136e-05 8.58762e-05 7.65274e-05 6.79998e-05 - 6.05065e-05 5.38892e-05 4.80297e-05 4.28503e-05 - 3.81972e-05 3.40577e-05 3.04188e-05 2.70064e-05 - 2.41512e-05 2.20729e-05 2.07220e-05 1.98189e-05 - 1.89157e-05 1.79356e-05 1.70148e-05 1.61625e-05 - 1.53619e-05 1.46220e-05 1.39304e-05 1.32831e-05 - 1.26803e-05 1.21181e-05 1.15925e-05 1.11036e-05 - 1.06474e-05 1.02153e-05 9.81635e-06 9.44192e-06 - 9.08779e-06 8.76296e-06 8.45433e-06 8.16646e-06 - 7.89950e-06 7.64913e-06 7.41548e-06 7.19866e-06 - 6.99878e-06 6.82049e-06 6.64585e-06 6.49301e-06 - 6.36665e-06 6.25785e-06 6.16673e-06 6.07972e-06 - 5.98312e-06 5.87689e-06 5.77013e-06 5.64905e-06 - 5.49972e-06 5.35894e-06 5.25457e-06 5.17293e-06 - 5.10950e-06 5.04109e-06 4.98170e-06 4.94074e-06 - 4.90425e-06 4.87227e-06 4.85425e-06 4.84556e-06 - 4.85099e-06 4.86113e-06 4.88554e-06 4.91953e-06 - 4.96794e-06 5.01650e-06 5.07960e-06 5.16212e-06 - 5.25938e-06 5.37146e-06 5.50328e-06 5.64528e-06 - 5.81692e-06 6.02325e-06 6.24498e-06 6.42364e-06 - 6.62742e-06 7.03781e-06 7.79849e-06 8.89186e-06 - 1.01572e-05 1.15462e-05 1.30940e-05 1.48613e-05 - 1.68642e-05 1.91389e-05 2.17718e-05 2.46750e-05 - 2.80905e-05 3.19410e-05 3.64251e-05 4.14759e-05 - 4.75208e-05 5.41862e-05 6.24538e-05 7.12104e-05 - 8.14257e-05 9.28019e-05 1.08718e-04 1.22135e-04 - 1.42629e-04 1.66594e-04 1.88075e-04 2.22998e-04 - 2.45340e-04 2.75533e-04 3.07084e-04 3.47279e-04 - 3.69814e-04 4.16538e-04 4.36096e-04 4.57820e-04 - 4.94894e-04 5.23218e-04 5.40427e-04 5.56747e-04 - 5.78940e-04 5.80024e-04 5.76863e-04 5.61457e-04 - 5.46522e-04 5.18453e-04 4.94661e-04 4.52725e-04 - 4.27053e-04 3.90745e-04 3.39057e-04 3.23924e-04 - 2.70297e-04 2.48641e-04 2.16107e-04 1.89106e-04 - 1.66525e-04 1.45497e-04 1.25320e-04 1.09231e-04 - 9.58254e-05 8.33598e-05 7.34910e-05 6.42480e-05 - 5.67944e-05 4.98506e-05 4.41124e-05 3.89645e-05 - 3.44545e-05 3.06082e-05 2.71334e-05 2.40376e-05 - 2.12894e-05 1.89748e-05 1.68825e-05 1.49799e-05 - 1.33527e-05 1.18892e-05 1.05395e-05 9.38925e-06 - 8.34857e-06 7.45222e-06 6.62684e-06 5.89568e-06 - 5.26380e-06 4.68990e-06 4.18863e-06 3.74831e-06 - 3.33468e-06 2.98022e-06 2.66674e-06 2.37243e-06 - 2.12004e-06 1.91734e-06 1.77681e-06 1.66553e-06 - 1.56730e-06 1.46697e-06 1.37508e-06 1.28816e-06 - 1.20741e-06 1.13168e-06 1.06159e-06 9.96575e-07 - 9.35484e-07 8.78335e-07 8.25148e-07 7.75944e-07 - 7.30744e-07 6.87180e-07 6.47655e-07 6.10989e-07 - 5.77079e-07 5.45698e-07 5.16197e-07 4.87200e-07 - 4.60459e-07 4.34112e-07 4.09676e-07 3.86614e-07 - 3.64995e-07 3.45374e-07 3.27577e-07 3.11371e-07 - 2.96456e-07 2.82411e-07 2.69485e-07 2.57745e-07 - 2.47014e-07 2.37233e-07 2.28470e-07 2.20792e-07 - 2.13831e-07 2.08027e-07 2.03198e-07 1.98976e-07 - 1.95300e-07 1.93111e-07 1.91477e-07 1.90464e-07 - 1.90451e-07 1.91443e-07 1.93445e-07 1.96524e-07 - 2.00622e-07 2.05808e-07 2.12087e-07 2.20034e-07 - 2.29149e-07 2.39565e-07 2.51606e-07 2.65791e-07 - 2.81361e-07 2.99606e-07 3.19701e-07 3.42877e-07 - 3.68633e-07 3.97561e-07 4.31482e-07 4.66410e-07 - 5.09019e-07 5.59019e-07 6.15795e-07 6.71310e-07 - 7.39435e-07 8.24728e-07 9.12237e-07 1.02553e-06 - 1.14047e-06 1.29777e-06 1.44634e-06 1.68752e-06 - 1.93535e-06 2.23610e-06 2.64091e-06 3.19795e-06 - 3.79047e-06 4.56877e-06 5.41259e-06 6.51610e-06 - 7.55413e-06 8.98217e-06 1.03341e-05 1.21994e-05 - 1.48153e-05 1.68674e-05 1.92150e-05 2.04030e-05 - 2.21346e-05 2.34925e-05 2.50100e-05 2.66539e-05 - 2.78747e-05 2.87043e-05 3.02379e-05 3.10050e-05 - 3.26417e-05 3.29217e-05 3.43807e-05 3.36139e-05 - 3.48717e-05 3.49082e-05 3.56338e-05 3.54089e-05 - 3.62821e-05 3.88740e-05 4.05168e-05 4.33023e-05 - 4.65405e-05 5.14930e-05 5.62712e-05 6.38687e-05 - 7.05300e-05 7.81199e-05 8.86051e-05 1.01015e-04 - 1.15568e-04 1.30655e-04 1.51353e-04 1.63566e-04 - 1.91790e-04 2.04023e-04 2.11964e-04 2.47684e-04 - 2.54570e-04 2.87101e-04 3.03683e-04 3.24307e-04 - 3.45988e-04 3.45465e-04 3.59347e-04 3.77000e-04 - 3.79317e-04 3.81927e-04 3.77262e-04 3.68902e-04 - 3.71071e-04 3.43642e-04 3.21355e-04 2.98207e-04 - 2.61987e-04 2.36655e-04 1.99011e-04 1.72866e-04 - 1.40439e-04 1.13996e-04 9.67860e-05 7.76215e-05 - 6.25557e-05 5.01046e-05 4.00065e-05 3.20718e-05 - 2.59253e-05 2.11009e-05 1.73595e-05 1.44535e-05 - 1.22450e-05 1.04768e-05 9.17290e-06 8.18607e-06 - 7.36530e-06 6.65222e-06 6.08916e-06 5.55308e-06 - 5.11012e-06 4.68701e-06 4.31017e-06 3.96850e-06 - 3.67042e-06 3.38590e-06 3.15358e-06 2.90927e-06 - 2.70982e-06 2.50907e-06 2.33061e-06 2.17071e-06 - 2.00810e-06 1.86872e-06 1.73891e-06 1.61794e-06 - 1.50585e-06 1.40421e-06 1.31152e-06 1.22397e-06 - 1.14312e-06 1.06900e-06 9.99326e-07 9.34879e-07 - 8.75684e-07 8.18661e-07 7.68552e-07 7.19945e-07 - 6.75492e-07 6.34041e-07 5.95056e-07 5.59174e-07 - 5.25232e-07 4.93787e-07 4.64770e-07 4.37170e-07 - 4.12093e-07 3.88448e-07 3.66317e-07 3.45866e-07 - 3.26864e-07 3.09236e-07 2.92831e-07 2.77574e-07 - 2.63707e-07 2.50917e-07 2.39289e-07 2.28588e-07 - 2.19056e-07 2.10779e-07 2.03600e-07 1.97764e-07 - 1.92876e-07 1.90223e-07 1.88448e-07 1.89163e-07 - 1.91088e-07 2.01006e-07 2.04808e-07 2.20832e-07 - 2.48396e-07 2.69378e-07 2.94713e-07 3.28806e-07 - 3.68191e-07 4.05877e-07 4.57931e-07 4.94264e-07 - 5.34691e-07 5.64325e-07 6.23131e-07 6.72556e-07 - 7.23661e-07 7.77519e-07 8.02756e-07 8.32174e-07 - 8.39779e-07 8.58974e-07 8.78213e-07 8.91694e-07 - 9.01057e-07 9.22899e-07 9.49781e-07 9.65900e-07 - 9.78720e-07 9.84890e-07 9.91908e-07 9.98940e-07 - 9.98447e-07 1.02646e-06 1.04531e-06 1.04738e-06 - 1.10921e-06 1.16022e-06 1.24088e-06 1.33608e-06 - 1.44842e-06 1.56863e-06 1.74844e-06 1.92613e-06 - 2.18068e-06 2.45878e-06 2.77924e-06 3.19166e-06 - 3.65795e-06 4.19964e-06 4.81017e-06 5.42637e-06 - 6.25320e-06 7.13257e-06 8.00880e-06 9.38691e-06 - 1.07070e-05 1.16248e-05 1.25102e-05 1.40026e-05 - 1.59743e-05 1.67809e-05 1.76934e-05 1.89206e-05 - 1.99767e-05 2.11743e-05 2.12507e-05 2.14929e-05 - 2.28010e-05 2.28793e-05 2.25989e-05 2.14941e-05 - 2.10622e-05 2.06293e-05 1.93689e-05 1.81849e-05 - 1.70862e-05 1.57028e-05 1.37597e-05 1.22986e-05 - 1.06483e-05 9.28672e-06 8.39578e-06 7.37671e-06 - 6.43625e-06 5.62275e-06 4.91881e-06 4.32390e-06 - 3.82412e-06 3.39385e-06 3.02258e-06 2.68453e-06 - 2.40224e-06 2.15525e-06 1.91849e-06 1.71360e-06 - 1.53619e-06 1.37371e-06 1.21901e-06 1.08837e-06 - 9.68296e-07 8.52308e-07 7.68714e-07 6.78216e-07 - 6.07061e-07 5.39480e-07 4.79766e-07 4.29587e-07 - 3.80850e-07 3.43703e-07 3.00803e-07 2.68250e-07 - 2.39201e-07 2.12476e-07 1.87621e-07 1.69611e-07 - 1.51010e-07 1.35502e-07 1.20883e-07 1.08634e-07 - 9.70064e-08 8.68068e-08 7.84200e-08 7.06553e-08 - 6.33196e-08 5.68885e-08 5.17279e-08 4.80003e-08 - 4.50667e-08 4.24443e-08 3.98816e-08 3.75099e-08 - 3.53111e-08 3.32481e-08 3.13497e-08 2.95881e-08 - 2.79450e-08 2.64114e-08 2.49970e-08 2.36740e-08 - 2.24520e-08 2.13220e-08 2.02748e-08 1.93105e-08 - 1.84296e-08 1.76133e-08 1.68808e-08 1.62038e-08 - 1.56206e-08 1.51219e-08 1.46604e-08 1.42743e-08 - 1.40213e-08 1.38444e-08 1.38012e-08 1.38058e-08 - 1.39737e-08 1.40458e-08 1.42335e-08 1.45854e-08 - 1.48318e-08 1.53490e-08 1.59639e-08 1.69282e-08 - 1.75362e-08 1.82230e-08 1.87558e-08 1.96880e-08 - 2.02039e-08 2.11199e-08 2.19110e-08 2.26550e-08 - 2.35078e-08 2.40495e-08 2.48076e-08 2.52733e-08 - 2.56322e-08 2.66981e-08 2.73242e-08 2.81776e-08 - 2.89145e-08 2.91407e-08 2.96926e-08 3.11439e-08 - 3.19854e-08 3.54991e-08 3.80000e-08 4.04661e-08 - 4.31951e-08 4.71211e-08 5.11741e-08 5.62003e-08 - 6.16946e-08 6.72795e-08 7.55101e-08 8.41265e-08 - 9.42699e-08 1.04303e-07 1.16731e-07 1.34498e-07 - 1.52401e-07 1.69434e-07 2.04809e-07 2.37837e-07 - 2.83326e-07 3.32537e-07 4.11029e-07 4.74613e-07 - 6.22509e-07 7.66945e-07 9.68946e-07 1.15186e-06 - 1.29926e-06 1.38696e-06 1.46159e-06 1.56897e-06 - 1.70511e-06 1.83028e-06 1.94751e-06 2.08236e-06 - 2.19494e-06 2.34873e-06 2.43203e-06 2.55964e-06 - 2.67824e-06 2.78369e-06 2.95113e-06 3.12918e-06 - 3.23536e-06 3.51625e-06 3.78837e-06 3.96996e-06 - 4.37973e-06 4.92193e-06 5.52015e-06 5.98553e-06 - 6.94143e-06 7.50892e-06 8.03686e-06 9.33937e-06 - 9.82932e-06 1.08216e-05 1.15846e-05 1.24433e-05 - 1.30521e-05 1.41340e-05 1.37485e-05 1.42972e-05 - 1.43422e-05 1.43452e-05 1.41480e-05 1.36341e-05 - 1.32353e-05 1.30470e-05 1.22450e-05 1.17167e-05 - 1.05527e-05 9.55522e-06 8.39556e-06 7.34739e-06 - 6.73961e-06 5.92207e-06 5.14242e-06 4.47648e-06 - 3.94377e-06 3.49980e-06 3.13200e-06 2.81809e-06 - 2.56144e-06 2.35043e-06 2.16907e-06 2.03034e-06 - 1.90534e-06 1.79409e-06 1.72679e-06 1.66800e-06 - 1.65874e-06 1.61165e-06 1.63800e-06 1.60054e-06 - 1.57059e-06 1.64033e-06 1.62230e-06 1.66070e-06 - 1.70135e-06 1.70182e-06 1.69138e-06 1.71036e-06 - 1.72828e-06 1.71456e-06 1.68114e-06 1.67500e-06 - 1.47394e-06 1.31415e-06 1.14530e-06 9.76358e-07 - 7.77659e-07 6.47239e-07 5.54788e-07 4.55007e-07 - 4.04018e-07 3.30415e-07 2.89718e-07 2.46846e-07 - 2.08546e-07 1.73833e-07 1.49481e-07 1.26973e-07 - 1.12089e-07 9.82124e-08 8.79946e-08 7.88502e-08 - 7.26214e-08 6.49754e-08 5.93260e-08 5.45832e-08 - 4.98766e-08 4.58446e-08 4.18503e-08 3.87912e-08 - 3.59848e-08 3.32858e-08 3.07395e-08 2.85038e-08 - 2.64895e-08 2.46633e-08 2.29580e-08 2.13401e-08 - 1.99454e-08 1.86501e-08 1.74545e-08 1.63587e-08 - 1.53745e-08 1.44681e-08 1.36169e-08 1.28893e-08 - 1.21945e-08 1.15670e-08 1.10044e-08 1.04969e-08 - 1.00444e-08 9.64596e-09 9.29950e-09 9.00283e-09 - 8.73773e-09 8.58462e-09 8.44272e-09 8.30861e-09 - 8.39285e-09 8.45074e-09 8.74497e-09 8.88283e-09 - 9.10403e-09 9.83399e-09 1.04785e-08 1.14886e-08 - 1.25456e-08 1.43882e-08 1.70462e-08 2.01616e-08 - 2.28523e-08 2.48029e-08 2.65473e-08 2.88190e-08 - 3.17010e-08 3.41093e-08 3.65449e-08 3.93004e-08 - 4.26105e-08 4.57973e-08 4.91887e-08 5.28087e-08 - 5.79143e-08 6.17945e-08 6.76924e-08 7.36120e-08 - 7.85164e-08 8.66009e-08 9.42387e-08 1.04854e-07 - 1.18809e-07 1.32278e-07 1.48138e-07 1.69239e-07 - 1.90968e-07 2.24130e-07 2.46772e-07 2.77181e-07 - 3.27396e-07 3.64592e-07 4.19850e-07 4.53962e-07 - 4.99236e-07 5.46735e-07 6.17993e-07 6.74406e-07 - 7.19650e-07 7.79476e-07 8.19479e-07 8.66033e-07 - 8.72877e-07 9.25805e-07 9.42941e-07 9.39740e-07 - 9.22664e-07 8.81541e-07 8.63662e-07 8.43456e-07 - 7.98897e-07 7.51842e-07 6.89560e-07 6.58831e-07 - 5.78283e-07 5.08901e-07 4.42566e-07 3.89751e-07 - 3.46835e-07 3.05921e-07 2.67624e-07 2.37566e-07 - 2.13812e-07 1.91608e-07 1.74508e-07 1.59463e-07 - 1.46721e-07 1.36045e-07 1.27069e-07 1.19418e-07 - 1.13219e-07 1.10233e-07 1.05654e-07 1.01843e-07 - 1.00136e-07 9.86117e-08 9.73068e-08 9.57277e-08 - 9.60643e-08 9.33542e-08 9.20281e-08 9.27219e-08 - 9.05611e-08 8.96641e-08 8.99469e-08 8.88611e-08 - 8.82467e-08 8.02020e-08 6.96742e-08 6.26130e-08 - 4.94304e-08 4.17290e-08 3.18503e-08 2.68155e-08 - 2.20735e-08 2.11376e-08 1.89195e-08 1.55924e-08 - 1.35928e-08 1.21752e-08 1.00299e-08 8.73454e-09 - 7.30342e-09 6.39898e-09 5.62450e-09 5.01949e-09 - 4.49324e-09 4.08773e-09 3.72467e-09 3.40162e-09 - 3.13645e-09 2.89373e-09 2.67733e-09 2.48094e-09 - 2.30588e-09 2.14330e-09 1.99321e-09 1.86075e-09 - 1.74086e-09 1.63356e-09 1.53505e-09 1.44534e-09 - 1.36575e-09 1.29115e-09 1.22478e-09 1.16537e-09 - 1.11242e-09 1.06556e-09 1.02430e-09 9.88501e-10 - 9.57936e-10 9.32354e-10 9.11637e-10 8.95927e-10 - 8.84846e-10 8.78665e-10 8.77395e-10 8.81047e-10 - 8.89632e-10 9.03421e-10 9.22556e-10 9.47309e-10 - 9.77953e-10 1.01489e-09 1.05840e-09 1.10889e-09 - 1.16728e-09 1.23411e-09 1.31085e-09 1.39947e-09 - 1.50263e-09 1.61380e-09 1.73955e-09 1.89042e-09 - 2.01526e-09 2.17444e-09 2.38514e-09 2.65800e-09 - 3.03793e-09 3.45533e-09 3.90632e-09 4.44641e-09 - 5.04410e-09 5.72199e-09 6.52391e-09 7.39850e-09 - 8.43072e-09 9.65670e-09 1.09270e-08 1.25430e-08 - 1.43235e-08 1.63420e-08 1.88559e-08 2.14933e-08 - 2.45611e-08 2.81003e-08 3.21117e-08 3.64363e-08 - 4.27054e-08 4.80875e-08 5.55926e-08 6.34436e-08 - 7.25261e-08 8.16756e-08 9.08788e-08 1.03333e-07 - 1.14892e-07 1.29455e-07 1.40982e-07 1.56447e-07 - 1.74767e-07 1.92169e-07 2.12838e-07 2.35023e-07 - 2.56023e-07 2.81521e-07 3.16400e-07 3.52958e-07 - 3.74376e-07 4.07363e-07 4.57106e-07 4.82589e-07 - 5.29874e-07 5.69467e-07 6.28600e-07 6.60687e-07 - 6.91455e-07 7.40973e-07 7.57086e-07 8.01800e-07 - 8.20579e-07 8.21173e-07 8.30536e-07 8.15092e-07 - 8.03467e-07 7.77406e-07 7.59002e-07 7.39057e-07 - 6.79861e-07 6.45644e-07 5.74716e-07 5.39684e-07 - 4.72441e-07 4.13942e-07 3.59090e-07 3.11628e-07 - 2.69357e-07 2.36860e-07 2.08891e-07 1.85320e-07 - 1.65186e-07 1.48357e-07 1.33769e-07 1.22026e-07 - 1.11464e-07 1.03366e-07 9.59670e-08 9.04410e-08 - 8.60239e-08 8.27320e-08 7.95193e-08 7.90999e-08 - 7.89179e-08 7.98704e-08 8.10484e-08 8.24104e-08 - 8.80001e-08 8.93126e-08 9.17375e-08 1.00413e-07 - 1.04763e-07 1.13051e-07 1.19630e-07 1.28998e-07 - 1.34637e-07 1.37289e-07 1.43931e-07 1.47427e-07 - 1.49230e-07 1.54718e-07 1.54968e-07 1.52096e-07 - 1.48511e-07 1.31892e-07 1.14496e-07 9.50411e-08 - 8.01577e-08 7.02830e-08 4.97299e-08 4.74245e-08 - 4.03474e-08 3.47034e-08 2.93232e-08 2.40213e-08 - 2.02010e-08 1.77651e-08 1.57416e-08 1.38702e-08 - 1.22446e-08 1.12747e-08 1.02042e-08 8.79999e-09 - 7.55215e-09 6.51292e-09 5.85138e-09 5.45725e-09 - 5.05536e-09 4.72513e-09 4.27303e-09 3.81306e-09 - 3.56670e-09 3.17224e-09 2.87871e-09 2.59783e-09 - 2.37753e-09 2.16564e-09 2.01014e-09 1.84861e-09 - 1.69705e-09 1.57586e-09 1.46034e-09 1.35880e-09 - 1.26924e-09 1.19124e-09 1.12205e-09 1.06051e-09 - 1.00592e-09 9.57542e-10 9.14815e-10 8.77602e-10 - 8.45620e-10 8.18586e-10 7.96510e-10 7.79257e-10 - 7.66834e-10 7.59253e-10 7.56964e-10 7.60126e-10 - 7.69193e-10 7.84324e-10 8.06122e-10 8.40514e-10 - 8.80572e-10 9.30155e-10 1.01550e-09 1.08955e-09 - 1.18742e-09 1.32936e-09 1.53119e-09 1.73878e-09 - 2.00019e-09 2.41521e-09 2.97673e-09 3.73567e-09 - 4.47923e-09 5.04024e-09 5.50643e-09 6.15253e-09 - 6.83087e-09 7.51759e-09 8.47318e-09 9.33415e-09 - 1.03147e-08 1.19940e-08 1.27974e-08 1.45602e-08 - 1.66228e-08 1.83784e-08 2.03921e-08 2.29656e-08 - 2.67480e-08 2.90124e-08 3.29093e-08 3.59205e-08 - 4.02199e-08 4.39503e-08 4.77159e-08 5.09565e-08 - 5.42165e-08 5.84811e-08 6.13709e-08 6.36877e-08 - 6.32736e-08 6.77375e-08 6.79185e-08 6.70192e-08 - 6.60426e-08 6.32361e-08 6.22556e-08 5.96565e-08 - 5.68402e-08 5.36841e-08 5.04933e-08 4.35506e-08 - 3.89714e-08 3.41565e-08 3.05615e-08 2.65784e-08 - 2.28356e-08 1.99173e-08 1.75791e-08 1.54377e-08 - 1.34490e-08 1.22060e-08 1.08365e-08 9.74743e-09 - 8.87596e-09 8.10370e-09 7.49108e-09 6.95803e-09 - 6.62844e-09 6.23342e-09 6.03765e-09 5.92530e-09 - 5.83141e-09 5.90184e-09 5.95995e-09 5.97307e-09 - 6.59710e-09 6.81596e-09 7.13158e-09 7.54883e-09 - 8.11778e-09 8.39583e-09 9.18604e-09 9.94758e-09 - 1.05257e-08 1.12062e-08 1.15997e-08 1.22520e-08 - 1.25886e-08 1.27267e-08 1.27880e-08 1.25246e-08 - 1.22216e-08 1.08419e-08 9.48082e-09 7.70900e-09 - 6.10496e-09 4.83285e-09 3.99261e-09 3.55664e-09 - 3.24481e-09 2.47777e-09 2.20911e-09 1.81678e-09 - 1.46336e-09 1.21999e-09 1.01956e-09 8.74050e-10 - 7.58491e-10 6.66911e-10 5.90938e-10 5.30126e-10 - 4.79414e-10 4.36594e-10 3.99930e-10 3.68317e-10 - 3.40810e-10 3.16936e-10 2.96065e-10 2.78043e-10 - 2.62395e-10 2.48966e-10 2.37280e-10 2.27661e-10 - 2.19471e-10 2.13035e-10 2.08033e-10 2.04470e-10 - 2.02188e-10 2.01348e-10 2.01794e-10 2.03688e-10 - 2.06711e-10 2.11349e-10 2.17281e-10 2.24673e-10 - 2.33687e-10 2.44165e-10 2.56434e-10 2.70334e-10 - 2.86354e-10 3.04336e-10 3.22340e-10 3.41987e-10 - 3.68793e-10 4.08289e-10 4.61798e-10 5.24957e-10 - 5.95184e-10 6.75581e-10 7.67796e-10 8.72989e-10 - 9.93140e-10 1.13007e-09 1.28609e-09 1.46385e-09 - 1.66633e-09 1.89947e-09 2.16559e-09 2.47131e-09 - 2.81671e-09 3.21987e-09 3.66779e-09 4.19992e-09 - 4.80491e-09 5.53711e-09 6.31457e-09 7.28372e-09 - 8.45644e-09 9.54660e-09 1.10335e-08 1.25716e-08 - 1.42633e-08 1.68680e-08 1.87609e-08 2.14822e-08 - 2.44878e-08 2.76625e-08 3.09734e-08 3.52158e-08 - 3.90655e-08 4.28368e-08 4.97323e-08 5.46104e-08 - 6.15045e-08 6.66945e-08 7.18407e-08 7.53453e-08 - 8.32839e-08 9.07819e-08 9.35536e-08 9.60950e-08 - 9.95741e-08 1.01537e-07 1.03737e-07 1.04952e-07 - 1.04111e-07 1.02749e-07 1.00515e-07 9.74564e-08 - 9.04528e-08 8.97846e-08 8.30703e-08 7.77763e-08 - 6.92144e-08 6.24424e-08 5.67564e-08 4.92279e-08 - 4.29712e-08 3.76346e-08 3.25447e-08 2.83435e-08 - 2.46610e-08 2.17854e-08 1.91093e-08 1.68412e-08 - 1.48364e-08 1.31459e-08 1.16958e-08 1.04476e-08 - 9.37608e-09 8.41877e-09 7.62685e-09 6.92239e-09 - 6.34128e-09 5.85140e-09 5.45801e-09 5.12210e-09 - 4.85569e-09 4.71863e-09 4.58823e-09 4.54990e-09 - 4.56279e-09 4.60989e-09 4.76654e-09 4.89769e-09 - 5.15402e-09 5.44665e-09 5.81163e-09 6.15472e-09 - 6.55657e-09 6.96404e-09 7.59198e-09 8.08822e-09 - 8.83970e-09 9.40092e-09 1.04314e-08 1.09166e-08 - 1.16817e-08 1.24581e-08 1.33252e-08 1.40481e-08 - 1.46785e-08 1.48305e-08 1.55935e-08 1.56146e-08 - 1.55923e-08 1.55319e-08 1.53309e-08 1.48901e-08 - 1.41744e-08 1.40713e-08 1.29909e-08 1.23651e-08 - 1.14165e-08 1.04390e-08 9.01258e-09 7.71352e-09 - 6.89273e-09 5.83011e-09 5.06844e-09 4.44046e-09 - 3.87296e-09 3.40278e-09 3.00385e-09 2.63248e-09 - 2.34656e-09 2.07785e-09 1.84218e-09 1.63888e-09 - 1.45907e-09 1.28503e-09 1.15176e-09 1.02679e-09 - 9.11532e-10 8.10237e-10 7.20106e-10 6.41688e-10 - 5.72886e-10 5.12656e-10 4.59954e-10 4.13731e-10 - 3.73468e-10 3.38645e-10 3.08739e-10 2.83051e-10 - 2.61588e-10 2.43647e-10 2.29411e-10 2.18355e-10 - 2.10484e-10 2.05803e-10 2.03961e-10 2.05320e-10 - 2.09529e-10 2.17127e-10 2.28119e-10 2.42511e-10 - 2.61022e-10 2.84017e-10 3.12574e-10 3.46703e-10 - 3.85518e-10 4.34753e-10 4.91919e-10 5.46640e-10 - 6.33141e-10 7.11310e-10 8.02123e-10 9.04884e-10 - 1.05248e-09 1.19754e-09 1.35247e-09 1.50073e-09 - 1.69416e-09 1.93066e-09 2.18580e-09 2.42139e-09 - 2.69872e-09 3.00343e-09 3.29042e-09 3.66626e-09 - 4.03708e-09 4.44449e-09 4.90302e-09 5.30228e-09 - 5.64400e-09 6.08399e-09 6.51538e-09 6.92910e-09 - 7.14715e-09 7.37815e-09 7.54213e-09 7.81906e-09 - 7.68502e-09 7.74018e-09 7.80997e-09 7.61371e-09 - 7.46648e-09 7.19317e-09 6.88669e-09 6.60181e-09 - 6.20328e-09 5.89211e-09 5.10670e-09 4.87879e-09 - 4.22935e-09 3.72399e-09 3.19057e-09 2.81619e-09 - 2.42855e-09 2.11396e-09 1.80142e-09 1.59040e-09 - 1.38706e-09 1.21829e-09 1.07401e-09 9.42107e-10 - 8.30156e-10 7.33210e-10 6.49631e-10 5.74641e-10 - 5.16752e-10 4.62128e-10 4.14289e-10 3.72504e-10 - 3.36785e-10 3.06214e-10 2.80429e-10 2.58696e-10 - 2.41022e-10 2.27413e-10 2.16947e-10 2.08886e-10 - 2.13460e-10 2.05946e-10 2.09964e-10 2.17712e-10 - 2.29753e-10 2.43671e-10 2.53500e-10 2.87975e-10 - 3.14831e-10 3.35176e-10 3.79095e-10 4.13335e-10 - 4.56781e-10 4.96715e-10 5.29759e-10 5.79707e-10 - 6.15081e-10 6.66251e-10 6.90256e-10 7.14286e-10 - 7.22367e-10 7.64864e-10 7.69970e-10 7.53247e-10 - 7.35188e-10 6.82818e-10 6.84874e-10 6.83159e-10 - 6.49738e-10 6.01176e-10 5.54264e-10 4.67988e-10 - 4.18308e-10 3.53251e-10 3.01755e-10 2.59486e-10 - 2.25890e-10 1.98136e-10 1.74735e-10 1.55068e-10 - 1.38438e-10 1.24450e-10 1.12710e-10 1.02992e-10 - 9.50533e-11 8.87435e-11 8.39320e-11 8.05259e-11 - 7.84892e-11 7.77477e-11 7.83034e-11 8.01776e-11 - 8.34103e-11 8.80612e-11 9.42088e-11 1.01932e-10 - 1.11406e-10 1.22748e-10 1.36172e-10 1.51891e-10 - 1.70160e-10 1.91289e-10 2.15705e-10 2.43682e-10 - 2.75725e-10 3.12803e-10 3.55694e-10 4.05754e-10 - 4.66654e-10 5.34364e-10 6.06580e-10 7.14761e-10 - 8.24405e-10 9.11947e-10 1.03611e-09 1.17625e-09 - 1.37264e-09 1.54232e-09 1.78712e-09 2.03063e-09 - 2.30113e-09 2.59131e-09 3.06031e-09 3.44048e-09 - 3.91817e-09 4.37302e-09 5.11417e-09 5.66347e-09 - 6.53256e-09 7.43954e-09 8.13114e-09 9.37906e-09 - 1.02479e-08 1.13947e-08 1.20800e-08 1.32933e-08 - 1.39118e-08 1.44097e-08 1.49941e-08 1.52562e-08 - 1.55635e-08 1.57458e-08 1.55930e-08 1.53949e-08 - 1.47531e-08 1.46506e-08 1.36051e-08 1.28357e-08 - 1.21854e-08 1.06649e-08 9.40264e-09 8.09581e-09 - 7.24872e-09 -*END diff --git a/data/continua/mt_ckd_plot.pdf b/data/continua/mt_ckd_plot.pdf deleted file mode 100644 index d5e24925..00000000 Binary files a/data/continua/mt_ckd_plot.pdf and /dev/null differ diff --git a/docs/Explanations/spectraltools_pipeline.md b/docs/Explanations/spectraltools_pipeline.md new file mode 100644 index 00000000..b44baa05 --- /dev/null +++ b/docs/Explanations/spectraltools_pipeline.md @@ -0,0 +1,265 @@ +# Building spectral files + +The newer [PROTEUS spectral files](../Reference/proteus_spectral_file_reference.md) are built with `spectraltools`, a set of Python scripts in the [`spectraltools/`](https://github.com/FormingWorlds/SOCRATES/tree/main/spectraltools) folder of this repository. They are not part of the Met Office distribution of SOCRATES and are distributed under the 3-Clause BSD Licence. + +`spectraltools` does not calculate line absorption itself. It reads cross-sections that were computed beforehand at high spectral resolution, writes them in the netCDF format that `Ccorr_k` reads, and then runs the compiled SOCRATES tools `prep_spec`, `Ccorr_k` and `Cscatter_average`. This keeps the slowest step, turning a line list into cross-sections, separate from the fitting of k-terms. + +--- + +## Steps + +The diagram outlines the pipeline. Cylinders are data, boxes with double sides are compiled SOCRATES programs, and plain boxes are Python steps. The outline colour shows which code carries out each step: PyExoCross (blue), `spectraltools` (green) or SOCRATES (orange). + +```mermaid +flowchart TD + subgraph inputs ["Input data"] + LL[("Line lists
ExoMol, ExoAtom,
HITRAN, HITEMP")] --> PEC["PyExoCross"] + DACE[("DACE opacity
database")] --> TID["Tinterpolate_dace.py"] + HC[("HITRAN CIA")] --> TDC["Tdownload_cia.py"] + PEC --> XS[("Cross-sections
for each gas")] + TID --> XS + TDC --> CIA[("CIA file
for each gas pair")] + MT[("MT_CKD 4.3
self-continuum")] + end + + subgraph make ["Tmake_spectralfile.py, run once per band count"] + GRID["Check data coverage;
choose p–T grid and band edges"] + SKEL[["prep_spec: skeleton spectral file"]] + NC["Write netCDF cross-sections,
one file per gas"] + LBL[["Ccorr_k: k-terms for line absorption,
one gas at a time"]] + CONT[["Ccorr_k: k-terms for continua,
one gas pair at a time"]] + DROP[["Cscatter_average: water droplets,
if H2O is present"]] + ASM[["prep_spec: assemble .sf and .sf_k"]] + FIN["Fill NaN k-terms from
low-T Planck underflow;
write checksums"] + GRID --> SKEL --> NC --> LBL --> CONT --> DROP --> ASM --> FIN + end + + XS --> GRID + CIA --> CONT + MT --> CONT + FIN --> PKG["Tpackage_spectralfile.py:
zip archive for each band count"] + + classDef pyexocross stroke:#3b7dd8,stroke-width:2px + classDef tools stroke:#2e9e6a,stroke-width:2px + classDef socrates stroke:#d9822b,stroke-width:2px + class PEC pyexocross + class TID,TDC,GRID,NC,FIN,PKG tools + class SKEL,LBL,CONT,DROP,ASM socrates +``` + +1. Compute or download cross-sections for each gas, and download the HITRAN collision-induced absorption (CIA) files. +2. Set the gases, file name and other parameters in `Tmake_spectralfile.py`. +3. Check that the data cover the requested pressures, temperatures and wavenumbers, and choose the pressure–temperature grid. +4. Choose the band edges. +5. Write a skeleton spectral file and the pressure–temperature files with `prep_spec`. +6. Write one netCDF cross-section file per gas. +7. Fit k-terms for line absorption, one gas at a time, with `Ccorr_k`. +8. Fit k-terms for the continua, one gas pair at a time, with `Ccorr_k`. +9. Fit water droplet scattering properties with `Cscatter_average`, if H2O is present. +10. Assemble the spectral file with `prep_spec`, fill the NaN k-terms caused by underflow of the Planck function at low temperatures, and write checksums. +11. Package the files into a zip archive. + +`Tmake_spectralfile.py` carries out steps 3 to 10. `Tmake_spectralfile_bands.py` runs it for several band counts in turn and packages each result (step 11). + +--- + +## Input data + +### Cross-sections + +Cross-sections for each gas go in `spectraltools/data///`. `Tmake_spectralfile.py` sets a default source and per-gas exceptions: + +```python +source = "exocross" +vol_source = {"VO":"dace", "CH4":"dace", "NH3":"dace"} +``` + +- **`exocross`**: `.xsec` or `.xsec.bz2` files, one per pressure and temperature, with the pressure and temperature in the file name (`P

bar`, `TK`). They are read from `data/exocross///`, where the line list source is `ExoMol`, `ExoAtom`, `HITRAN` or `HITEMP`. If more than one of these folders exists, the first in that order is used and a warning is logged. +- **`dace`**: binary files at 0.01 cm⁻¹ resolution, downloaded from the [DACE opacity database](https://dace.unige.ch/opacityDatabase/) with `Tinterpolate_dace.py`. This script asks DACE (through the `dace-query` package) for cross-sections interpolated to the target pressures up to 10³ bar, and to those target temperatures that lie within the line list's temperature range. DACE computes its cross-sections with HELIOS-K. + +Readers for HITRAN `.xsc` files and ExoMol `.sigma` files also exist, but are not used by the Generation III files. + +### PyExoCross cross-sections + +For the files made in October 2026, the `exocross` cross-sections were computed with [PyExoCross](https://github.com/Beryl-Jingxin/PyExoCross) ([Zhang et al. 2024](https://doi.org/10.1093/rasti/rzae016)), a Python version of ExoCross ([Yurchenko et al. 2018](https://doi.org/10.1051/0004-6361/201732531)). The calculations were run from a fork, [nichollsh/PyExoCross](https://github.com/nichollsh/PyExoCross), whose script `tools/generate_xsec_inp_config.py` writes an input file for each species from a template. The script changes only the species, data set, quantum-number labels and whether the uncertainty filter is used (on only where the line list gives uncertainties); every other setting comes from the template. The templates in the fork (commit `9c86b5f`) set: + +| Setting | Template value | +|---------|----------------| +| Calculation | Absorption cross-sections in local thermodynamic equilibrium | +| Wavenumber range | 10–50 000 cm⁻¹ | +| Grid | Bins of 0.025 cm⁻¹ | +| Temperatures | The 57 temperatures of the target grid below (25–5000 K) | +| Pressures | The 18 pressures of the target grid below (10⁻⁵–10⁴ bar) | +| Line profile | Voigt: `HumlicekVoigt` (ExoMol and HITRAN templates) or `SciPyVoigt` (ExoAtom template) | +| Line-wing cut-off | 40 cm⁻¹ (ExoMol and HITRAN templates), 100 cm⁻¹ (ExoAtom template) | +| Pressure broadening | `Default` with ratio 1.0. The PyExoCross documentation defines this as a Lorentzian half-width of 0.07 and a temperature exponent of 0.5 for all lines; for HITRAN and HITEMP input it means air broadening. | +| Intensity threshold | Minimum line intensity 10⁻³² cm molecule⁻¹ | +| Uncertainty filter | Maximum uncertainty 0.1 cm⁻¹, applied only where the line list gives uncertainties | + +The input files for each species are not in the repository, so these values have not been checked against them. They differ from the templates at least in the cut-off: the cut-offs used were 25 cm⁻¹ for H2O, 100 cm⁻¹ for H2, Na, K and Fe, and 40 cm⁻¹ for the other PyExoCross gases (see the [line opacity table](../Reference/proteus_spectral_file_reference.md#line-opacities)). The template grid matches the target grid and the `dnu` of 0.025 cm⁻¹ used by `Tmake_spectralfile.py`. + +### Collision-induced absorption + +`Tdownload_cia.py` downloads one HITRAN CIA file per gas pair into `data/cia/.cia`. It tries HITRAN's `main` folder first and then its `alternate` folder. The water vapour self-continuum is not taken from HITRAN CIA but from the MT_CKD file in `data/continua/` (see [Continua](#continua)). + +--- + +## Settings + +The parameters are set at the top of `main()` in `Tmake_spectralfile.py`: + +| Parameter | Value used | Meaning | +|-----------|------------|---------| +| `vols` | e.g. `["H2O", "CO2", "CO", "O2", "SO2", "OCS", "S2"]` | Gases with line absorption; the first is the most significant absorber | +| `alias` | e.g. `"Breezehome"` | Name of the spectral file | +| `nband` | 32, 64, 128, 256 or 2048 | Number of bands | +| `method` | 3 | Band selection method (see [Band edges](#band-edges)) | +| `numin`, `numax` | 10, 50 000 cm⁻¹ | Wavenumber range | +| `dnu` | 0.025 cm⁻¹ | Wavenumber step of the netCDF files | +| `maxpath` | 10³ kg m⁻² | Default maximum absorber path for `Ccorr_k` (also used for continua, in kg² m⁻⁵) | +| `vol_maxpath` | 10 kg m⁻² for SiO, TiO, VO, MgO, Na, K and Fe | Per-gas maximum absorber path | +| `drops` | `True` | Add water droplet scattering when H2O is present | +| `UV` | `False` | Add separate UV cross-sections (not used) | +| `preNC` | `True` | Reuse netCDF files from an earlier run of the same alias | + +The target grid has 18 pressures and 57 temperatures, 1026 points in all: + +- pressures: 10⁻⁵ and 10⁻⁴ bar, then every half decade from 10⁻³·⁵ to 10⁴ bar, rounded to two significant figures (3.2 × 10⁻⁴, 10⁻³, 3.2 × 10⁻³, …); +- temperatures: 25 K; 100–325 K every 25 K; 350–950 K every 50 K; 1000–4000 K every 100 K; 4500 K and 5000 K. + +--- + +## Data coverage and pressure–temperature grid + +For each gas, the script reads one cross-section file to find its wavenumber range, and lists the pressures and temperatures of all its files. Where the target grid extends more than 1 % beyond a gas's data, a warning is logged and the nearest available point is used for that gas. For example, the DACE data for CH4 and NH3 stop at 10³ bar and at 2500 K and 1900 K respectively. The script stops with an error if the target grid extends beyond the data of all gases combined. The wavenumber range is narrowed to the range covered by the data. + +The last gas in `vols` that uses the default source is the reference gas. Its files set the pressure–temperature grid: each target temperature is replaced by the nearest temperature in its files, and each target pressure by the nearest pressure in logarithmic distance (`ptf.best_pt`). The reference gas's files must form a rectangular grid, and the code refuses target grids of 2000 points or more. + +--- + +## Band edges + +`spectral.best_bands` places the band edges in wavenumber by one of several methods: + +| Method | Band spacing | +|--------|--------------| +| 0 | Linear | +| 1 | Logarithmic | +| 2 | One band for wavelengths longer than 40 µm, linear spacing elsewhere | +| 3 | Linear spacing for wavelengths longer than 40 µm, logarithmic spacing elsewhere | +| 4 | Linear for wavelengths longer than 40 µm, logarithmic between 40 µm and 400 nm, and logarithmic again (with a separate share of the bands) shortward of 400 nm | +| 5 | Set by the weighted sum of Planck functions at 180 K, 1800 K and 6500 K, so that each band holds an equal share of their cumulative distribution | +| 9 | The 318 bands of the legacy spectral files | + +The Generation III files use **method 3**. Of the `nband + 1` edges, 12 % (rounded down) are spaced linearly between the lowest wavenumber and 250 cm⁻¹ (40 µm), and the rest logarithmically from 250 cm⁻¹ to the highest wavenumber. Each edge is then moved to the nearest wavenumber in the reference gas's data. The log lists the resulting bands. + +--- + +## Skeleton spectral file + +`spectral.create_skeleton` runs `prep_spec` to write `_skel.sf`, which holds the band limits, the absorbers (by their SOCRATES identifiers from `gas_list_pcf.F90`) and the continua. A continuum is included for every supported pair (`utils.cia_pairs`) whose two gases are both present. No aerosols are added, and no absorbers or continua are yet assigned to bands. + +It also writes two pressure–temperature files for `Ccorr_k`: + +- `_pt_lbl.dat`, for line absorption: every pressure combined with every temperature of the grid; +- `_pt_cia.dat`, for the continua: a single pressure, the grid pressure closest to 1 bar, with every temperature. When H2O is present, temperatures below 50 K are left out, because the Planck weights used for MT_CKD underflow there. All pairs share this grid. + +--- + +## netCDF cross-section files + +For each gas, `netcdf.write_ncdf_from_grid` writes `_.nc`: + +1. Each point of the grid is matched to the gas's closest file, by the combined relative difference in pressure and temperature (`ptf.map_ptf`). The matches are written to `__ptf.csv`. +2. Each file is read and cut to the wavenumber range. DACE data are moved from their 0.01 cm⁻¹ grid onto multiples of `dnu` by taking the nearest point, not by interpolation, so that narrow lines are not smeared. PyExoCross data already lie on a 0.025 cm⁻¹ grid. +3. Cross-sections are converted from cm² per molecule to m² kg⁻¹ using the molar mass, and values below a small floor (10⁻⁴⁵ cm² g⁻¹, or for DACE the smallest positive value in the file) are raised to it. +4. The file holds the variables `p_calc` (Pa), `t_calc` (K), `nu` (m⁻¹) and `kabs` (m² kg⁻¹, one row per pressure–temperature point). + +All gases must have the same wavenumber step. With `preNC = True` an existing file is reused, since it does not depend on the number of bands; the 2026 builds reused files written by an earlier run. + +--- + +## Line absorption + +`spectral.calc_kcoeff_lbl` runs `Ccorr_k` once per gas: + +``` +Ccorr_k -F _pt_lbl.dat -R -l \ + -tt 1.000e-40 -t 5.0e-03 -ns 500 -s _skel.sf +p -lk -k \ + -o __lbl.sf_k -m __mon.log -L _.nc \ + -sm __map.nc -np 40 +``` + +| Option | Meaning | +|--------|---------| +| `-R` | Only the bands that lie entirely within the gas's data | +| `-l gas maxpath` | Line absorption for this gas. Transmission errors are considered for absorber paths up to `maxpath` (10³ kg m⁻², or 10 kg m⁻² for the gases listed above) | +| `-t 5.0e-03` | Use as many k-terms as needed to keep the RMS transmission error below 5 × 10⁻³ (`CCORRK_LBL_TOLTYPE = 't'`, `CCORRK_T_RMSERR` in `src/spectral.py`). The alternatives are a fixed number of terms (`-n`) or binning by the pressure where scaling peaks (`-b`) | +| `-tt 1.000e-40` | Threshold on the summed absorption below which a band is treated as transparent | +| `-ns 500` | Maximum number of sub-bands per band in the k-term fit; the fit stops at this limit even if the tolerance is not met | +| `+p` | Planckian weighting | +| `-lk` | Look-up table in pressure and temperature, rather than a scaling function | +| `-k` | Passed for every gas; the `Ccorr_k` manual page describes it as an adjustment for use with the CKD continuum | +| `-L` | The netCDF cross-section file from the previous step | +| `-sm` | Save the mapping from wavenumber to g-space; the H2O mapping is reused for the H2O-H2O continuum | + +The run stops if the `Ccorr_k` log does not report a normal end or reports a failure to converge. + +--- + +## Continua + +`spectral.calc_kcoeff_cia` runs `Ccorr_k` once per gas pair present, with the same tolerance type and value as for line absorption, the continuum pressure–temperature file, a maximum path of 10³ kg² m⁻⁵ (`-ct`) and an integration step equal to the netCDF wavenumber step (`-i`, 2.5 m⁻¹). + +**H2O-H2O** uses the MT_CKD 4.3 self-continuum, `data/continua/absco-ref_wv-mt-ckd4p3.nc` (`MT_CKD_VERSION = "mt_ckd4p3"`). The same file is given twice to `-e`, as the `Ccorr_k` manual page requires for this format, and `Ccorr_k` applies the temperature exponents stored in it. According to the comments in `src/spectral.py`, the file holds coefficients without the radiation term ν tanh(hcν/2kT), which `Ccorr_k` applies itself. Only bands lying entirely within the MT_CKD table (up to 20 000 cm⁻¹ for this file) receive the continuum. The call adds `-c 2500` (a line cut-off of 2500 m⁻¹, i.e. 25 cm⁻¹, the value the manual page specifies for use with CKD), `-tt`, `-ns`, and `-lm` with the H2O mapping saved in the previous step. + +**Other pairs** use HITRAN CIA files. Before use, `spectral.write_cia_fixed` rewrites each file in the fixed columns that `Ccorr_k` reads. Some HITRAN files write the wavenumber limits and temperature as integers, which `Ccorr_k` would read with an implied decimal point (296 K as 2.96 K); some write five-digit mantissas, which lose the last digit of the exponent; and some have left-aligned columns. The log records how many data sets (one per temperature or wavenumber range) were rewritten for each pair. The CO2-H2O data exist only at 296 K and are used at all temperatures. + +--- + +## Water droplets + +If `drops = True` and H2O is among the gases, `spectral.calc_waterdroplets` runs `Cscatter_average` on `data/cloud/scatter_drop_type5`, with thick averaging (`-t`), Planckian weighting at 250 K, one moment of the phase function, and a Padé fit (fit type 5) for a material density of 1000 kg m⁻³. The result is added to block 10 as droplet type 5, with the range of validity 1.5 × 10⁻⁶ to 5.0 × 10⁻⁵ given to `prep_spec`. Snowline and Breezehome contain these data; Cliffshade and Volenfell do not, as they have no H2O. + +--- + +## Assembly and NaN check + +`spectral.assemble` runs `prep_spec` on the skeleton file to add the k-terms for each gas (block 5), the continuum k-terms and the droplet data, giving `.sf` and its look-up tables `.sf_k`. It adds no thermal source function, solar spectrum, Rayleigh scattering, aerosol or ice data; the 2026 files contain blocks 0, 1, 4, 5, 8, 18 and 19, plus block 10 where droplets are included. + +Both files are then searched for NaN values. These come from `Ccorr_k`, which gives NaN k-terms at low temperatures because the Planck function it uses to weight them underflows there: exp(−hcν/kT) becomes too small for double precision, which at 25 K happens above roughly 12 000 cm⁻¹. In `.sf_k`, `spectral.fill_nan_lookup` replaces each NaN by linear interpolation in temperature along its row of the look-up table (same band, gas, k-term and pressure), keeping the outermost valid value beyond the ends; the code comments state that this matches how SOCRATES interpolates the table. A row with no valid values is set to zero, and any NaN left after that is replaced by zero. The log reports how many values were filled or set to zero. Every 2026 build had NaN values filled by interpolation; none reported values set to zero, and the final files contain no NaN. + +--- + +## Checksums and packaging + +`spectral.assemble` writes BLAKE2b checksums of `.sf` and `.sf_k` to `.chk` and `.chk_k`. `Tcalc_checksum.py ` computes the same checksum to check a downloaded file. + +`Tmake_spectralfile_bands.py` runs `Tmake_spectralfile.py` for each requested band count (by default 32, 64, 128, 256 and 2048), using the same gases and settings. The runs share an alias, so each clears the output of the previous one, except the netCDF files when `preNC = True`. After each run, `Tpackage_spectralfile.py` writes `///.zip`, holding the spectral file, its look-up tables, the logs, the checksums, the plots of each gas's cross-section, and a copy of `Tmake_spectralfile.py` as `_Tmake_spectralfile.py`. It then tests the archive. + +!!! warning + The copy of `Tmake_spectralfile.py` in each archive is the script as it was when the archive was written, which may differ from the script that made the file. For the 2026 files the copies do not always show the gases of the file they accompany. The log in the same archive records the settings actually used. + +--- + +## Running the pipeline + +With SOCRATES compiled, `. ./set_rad_env` sourced and an `output/` folder (or link) inside `spectraltools/`: + +```bash +cd spectraltools +python Tdownload_cia.py # HITRAN CIA files into data/cia/ +python Tinterpolate_dace.py # DACE data for one gas; edit the parameters first +# edit the parameters in Tmake_spectralfile.py +python Tmake_spectralfile_bands.py --nband 32 64 128 256 2048 +``` + +`Tmake_spectralfile.py` can also be run on its own to make a single file with the band count set in the script. + +--- + +## References + +- PyExoCross: Zhang, Tennyson & Yurchenko 2024, RAS Techniques and Instruments 3, 257, [doi:10.1093/rasti/rzae016](https://doi.org/10.1093/rasti/rzae016). +- ExoCross: Yurchenko, Al-Refaie & Tennyson 2018, A&A 614, A131, [doi:10.1051/0004-6361/201732531](https://doi.org/10.1051/0004-6361/201732531). +- The references for the line lists, the continua and the databases are on the [PROTEUS spectral files](../Reference/proteus_spectral_file_reference.md#opacity-data-and-references) page. diff --git a/docs/Reference/proteus_spectral_file_reference.md b/docs/Reference/proteus_spectral_file_reference.md index 0d6774d6..b1629512 100644 --- a/docs/Reference/proteus_spectral_file_reference.md +++ b/docs/Reference/proteus_spectral_file_reference.md @@ -5,72 +5,51 @@ --- -## Overview +## Spectral file summary table -Each spectral file is identified by a codename and a band count; several codenames are available at multiple resolutions. All files are in the standard SOCRATES spectral file format. +Each spectral file is identified by a codename and a band count; several codenames are available at multiple resolutions. All files are in the standard SOCRATES spectral file format. The Generation III files are made with the [`spectraltools`](https://github.com/FormingWorlds/SOCRATES/tree/main/spectraltools) scripts in this repository; [Building spectral files](../Explanations/spectraltools_pipeline.md) describes how. -Spectroscopic data sources are abbreviated as follows: - * **HITRAN** – [HITRAN linelist](https://hitran.org/) - * **EXOMOL** — [ExoMol linelist](https://www.exomol.com/) - * **DACE** — [DACE opacity database](https://dace.unige.ch/opacityDatabase/), from ExoMol. - * **ExoCross** - From opacities calculated using ExoCross, from multiple linelists. +A quick reference, with one row per codename. Click a codename for its details and data sources, or a band count for its record in the [PROTEUS Zenodo community](https://zenodo.org/communities/proteus_framework). Band counts without a link have no Zenodo record yet. ---- +### Generation III -## Spectral file summary table +| Codename | Purpose | Bands | Gases | +|----------|---------|-------|-------| +| [Snowline](#snowline) | Water | [2048](https://zenodo.org/records/23806236 "Snowline 2048 on Zenodo"), [256](https://zenodo.org/records/23806212 "Snowline 256 on Zenodo"), [128](https://zenodo.org/records/23806166 "Snowline 128 on Zenodo"), [64](https://zenodo.org/records/23806186 "Snowline 64 on Zenodo"), [32](https://zenodo.org/records/23806138 "Snowline 32 on Zenodo") | H2O | +| [Breezehome](#breezehome) | Oxidised volatiles | [2048](https://zenodo.org/records/23808117 "Breezehome 2048 on Zenodo"), [256](https://zenodo.org/records/23808153 "Breezehome 256 on Zenodo"), [128](https://zenodo.org/records/23808184 "Breezehome 128 on Zenodo"), [64](https://zenodo.org/records/23808200 "Breezehome 64 on Zenodo"), [32](https://zenodo.org/records/23808218 "Breezehome 32 on Zenodo") | H2O, CO2, CO, O2, SO2, OCS, S2 | +| [Cliffshade](#cliffshade) | Reduced volatiles | 2048, 256, 128, 64, 32 | H2, CO, CH4, S2, H2S, N2, NH3 | +| [Volenfell](#volenfell) | Rock vapours | [2048](https://zenodo.org/records/23808275 "Volenfell 2048 on Zenodo"), [256](https://zenodo.org/records/23808259 "Volenfell 256 on Zenodo"), [128](https://zenodo.org/records/23808253 "Volenfell 128 on Zenodo"), [64](https://zenodo.org/records/23808244 "Volenfell 64 on Zenodo"), [32](https://zenodo.org/records/23808230 "Volenfell 32 on Zenodo") | CO, O2, SiO, TiO, MgO, Na, K, Fe | +| [Proudspire](#proudspire) | Combined volatiles | [2048](https://zenodo.org/records/23838267 "Proudspire 2048 on Zenodo"), [256](https://zenodo.org/records/23838213 "Proudspire 256 on Zenodo"), [128](https://zenodo.org/records/23838187 "Proudspire 128 on Zenodo"), [64](https://zenodo.org/records/23838157 "Proudspire 64 on Zenodo"), [32](https://zenodo.org/records/23837929 "Proudspire 32 on Zenodo") | H2O, H2, CO2, CO, O2, O3, CH4, SO2, OCS, S2, H2S, N2, NH3, HCN | +| [Skyborn](#skyborn) | Hot Jupiters | [2048](https://zenodo.org/records/23838562 "Skyborn 2048 on Zenodo"), [256](https://zenodo.org/records/23838507 "Skyborn 256 on Zenodo"), [128](https://zenodo.org/records/23838482 "Skyborn 128 on Zenodo"), [64](https://zenodo.org/records/23838469 "Skyborn 64 on Zenodo"), [32](https://zenodo.org/records/23838451 "Skyborn 32 on Zenodo") | H2O, H2, CO2, CO, SiO, TiO, VO, MgO, Na, K, Fe | +| [Atmora](#atmora) | Rock vapours and volatiles (smaller set) | [2048](https://zenodo.org/records/23837640 "Atmora 2048 on Zenodo"), [256](https://zenodo.org/records/23837583 "Atmora 256 on Zenodo"), [128](https://zenodo.org/records/23837548 "Atmora 128 on Zenodo"), [64](https://zenodo.org/records/23837520 "Atmora 64 on Zenodo"), [32](https://zenodo.org/records/23837505 "Atmora 32 on Zenodo") | H2O, H2, CO2, CO, O2, CH4, SO2, S2, H2S, NH3, SiO, TiO, Na, K | +| [Sovngarde](#sovngarde) | Rock vapours and volatiles (larger set) | [2048](https://zenodo.org/records/23839054 "Sovngarde 2048 on Zenodo"), [256](https://zenodo.org/records/23838984 "Sovngarde 256 on Zenodo"), [128](https://zenodo.org/records/23838924 "Sovngarde 128 on Zenodo"), [64](https://zenodo.org/records/23838886 "Sovngarde 64 on Zenodo"), [32](https://zenodo.org/records/23838860 "Sovngarde 32 on Zenodo") | H2O, H2, CO2, CO, O2, O3, CH4, SO2, OCS, S2, H2S, N2, NH3, HCN, SiO, TiO, MgO, Na, K, Fe | -The following table contains information about spectral files that can be downloaded through Zenodo (https://zenodo.org/communities/proteus_framework/records?q=&f=subject%3Aspectral_files&l=list&p=1&s=10&sort=newest). - -| Codename | Bands | Absorbers | Continua | UV | Tolerance | Sources | NaN-clean | SOCRATES | Date | Platform | Creator | Notes | -|------------|-------|------------------------|--------------------------|---------|-----------|---------|-----------|----------|------------|-------------|------------------|---------------------| -| Legacy | 318 | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | CO2, CH4, O2, N2, H2, He |No | 1.00E-02 | HITRAN | TRUE | 2002 | 2021 | Linux Intel | Tim Lichtenberg | Legacy spectral file used in Lichtenberg+2021 | -| Oak | 318 | H2O | H2O | No | 1.00E-02 | HITRAN | TRUE | 2306 | 2023-07-10 | Linux Intel | Harrison Nicholls | Water-only spectral file from HITRAN. To be used for benchmarking. | -| Idwal | 318 | H2O | H2O | No | 1.00E-02 | HITRAN | FALSE | 2211 | 2023-07-11 | Linux Intel | Harrison Nicholls | Made redundant by Oak. They only differ by SOCRATES version. | -| Balmora | 318 | H2O | H2O | No | 1.00E-02 | HITRAN | FALSE | 2306 | 2023-07-19 | Mac ARM | Tim Lichtenberg | Made redundant by Oak. They only differ by creation platform. | -| Triangle | 318 | H2O, H2, CO2 | H2O, H2, CO2 | No | 1.00E-02 | HITRAN | TRUE | 2306 | 2023-07-11 | Linux Intel | Harrison Nicholls | Test | -| Mallard | 318 | H2O, H2, CO2, CO, CH4, O2, N2, He | H2O, CO2, CH4, O2, N2, H2, He | No | 1.00E-02 | HITRAN | TRUE | 2306 | 2023-07-13 | Linux Intel | Harrison Nicholls | HITRAN file with useful opacities | -| Reach | 318 | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | H2O, CO2, CH4, O2, N2, H2, He | No | 1.00E-02 | HITRAN | TRUE | 2306 | 2023-07-19 | Linux Intel | Harrison Nicholls | Same as above but with more opacities | -| Vivec | 318 | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | H2O, CO2, CH4, O2, N2, H2, He | No | 1.00E-02 | HITRAN | FALSE | 2306 | 2023-07-25 | Mac Intel | Tim Lichtenberg | Same as above, but compiled on MacOS | -| Alduin | 318 | H2O | H2O | No | 1.00E-02 | EXOMOL | TRUE | 2306 | | Linux Intel | Ryan Boukrouche | Script exists to generate this file, but it is not currently available | -| Kynesgrove | 318 | O2 | O2-O2 | No | 5.00E-04 | DACE | TRUE | 2403 | 2024-03-14 | Linux Intel | Harrison Nicholls | Created for validation of DACE xsec data against SOCRATES' own LbL calculations used in Mallard. | -| Frostflow | 4096 | H2O | H2O | No | 5.00E-03 | DACE | TRUE | 2403 | 2024-03-20 | Linux Intel | Harrison Nicholls | Very high resolution. Intended for benchmarking. | -| Frostflow | 256 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Frostflow | 48 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Frostflow | 16 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Low resolution. Intended for debugging. | -| Dayspring | 4096 | H2O, H2, CO2, CO, CH4, N2 | H2O-H2O, H2-CH4, H2-H2, N2-H2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 | No | 1.00E-02 | DACE | TRUE | 2403 | 2024-04-30 | Linux Intel | Harrison Nicholls | Very high resolution. Intended for benchmarking. | -| Dayspring | 256 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Dayspring | 48 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Dayspring | 16 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Low resolution. Intended for debugging. | -| Honeyside | 4096 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 | No | 1.00E-02 | DACE | TRUE | 2403 | 2024-07-07 | Linux Intel | Harrison Nicholls | Very high resolution. Intended for benchmarking. | -| Honeyside | 256 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Honeyside | 48 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Honeyside | 16 | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | ^ | Low resolution. Intended for debugging. | -| Rocks | 256 | O2, SiO, SiO2 | O2-O2 | No | ? | DACE | TRUE | 2407.2 | 2025-05-15 | Linux Intel | Alex McGinty | High resolution file used for comparison with JWST observations of rock-vapour atmospheres. | -| Rocks | 128 | H2, H2O, O2, SiO, SiO2 | H2O-H2O, H2-H2, O2-O2 | ^ | ? | ^ | ^ | ^ | ^ | ^ | Alex McGinty | Rock vapours and key volatiles. | -| Rocks | 64 | H2, H2O, O2, SiO, SiO2 | H2O-H2O, H2-H2, O2-O2 | ^ | ? | ^ | ^ | ^ | ^ | ^ | Alex McGinty | Rock vapours and key volatiles (low resolution). | -| Winterfell | 4096 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 | CO2, H2O, H2S, N2, N2O, NH3, O3, SO2 | ?|DACE, MPI| TRUE | 2407.2 | 2026-01-12 | Linux Intel | Bruna Fena | Honeyside but with UV included for some molecules. Very high-resolution. | -| Winterfell | 256 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Winterfell | 48 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Winterfell | 16 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Low-resolution. | -| Dragonstone| 4096 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 | CO2, H2O, H2S, N2, N2O, NH3, O3, SO2 | ?|DACE, MPI| TRUE | 2407.2 | 2026-01-12 | Linux Intel | Bruna Fena | Same as Lighthouse but no O2 included. Very high-resolution. | -| Dragonstone | 256 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Dragonstone | 48 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Dragonstone | 16 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Low-resolution. | -| Sunspear | 4096 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 | CO2, SO2, H2S | ?|DACE, MPI| TRUE | 2407.2 | 2026-01-12 | Linux Intel | Bruna Fena | To simulate Ranjan and Sasselov (2016), only CO2, SO2 and H2S have UV values. Very high-resolution. | -| Sunspear | 256 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | High resolution. | -| Sunspear | 48 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Medium resolution. | -| Sunspear | 16 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | ^ | ^ | ?|^ | ^ | ^ | ^ | ^ | ^ | Low-resolution. | +### Generation II +| Codename | Purpose | Bands | Gases | +|----------|---------|-------|-------| +| [Kynesgrove](#kynesgrove) | Validation of DACE O2 cross-sections against SOCRATES line-by-line calculations | [318](https://zenodo.org/records/23190125 "Kynesgrove 318 on Zenodo") | O2 | +| [Frostflow](#frostflow) | Water-dominated atmospheres (DACE) | [4096](https://zenodo.org/records/15799776 "Frostflow 4096 on Zenodo"), [256](https://zenodo.org/records/15799754 "Frostflow 256 on Zenodo"), [48](https://zenodo.org/records/15696415 "Frostflow 48 on Zenodo"), [16](https://zenodo.org/records/15799743 "Frostflow 16 on Zenodo") | H2O | +| [Dayspring](#dayspring) | Mixed volatiles, smaller set than Honeyside (DACE) | [4096](https://zenodo.org/records/15799495 "Dayspring 4096 on Zenodo"), [256](https://zenodo.org/records/15799474 "Dayspring 256 on Zenodo"), [48](https://zenodo.org/records/15721749 "Dayspring 48 on Zenodo"), [16](https://zenodo.org/records/15799318 "Dayspring 16 on Zenodo") | H2O, H2, CO2, CO, CH4, N2 | +| [Honeyside](#honeyside) | Mixed volatiles; suggested for magma-ocean planets (DACE) | [4096](https://zenodo.org/records/15696457 "Honeyside 4096 on Zenodo"), [256](https://zenodo.org/records/15799731 "Honeyside 256 on Zenodo"), [48](https://zenodo.org/records/15799652 "Honeyside 48 on Zenodo"), [16](https://zenodo.org/records/15799607 "Honeyside 16 on Zenodo") | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | +| [Winterfell](#winterfell) | As Honeyside, with UV cross-sections | [4096](https://zenodo.org/records/18402082 "Winterfell 4096 on Zenodo"), [256](https://zenodo.org/records/18402159 "Winterfell 256 on Zenodo"), [48](https://zenodo.org/records/18402184 "Winterfell 48 on Zenodo"), [16](https://zenodo.org/records/18402217 "Winterfell 16 on Zenodo") | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | +| [Dragonstone](#dragonstone) | As Winterfell, without O2 | [4096](https://zenodo.org/records/18922546 "Dragonstone 4096 on Zenodo"), [256](https://zenodo.org/records/18910878 "Dragonstone 256 on Zenodo"), [48](https://zenodo.org/records/18922528 "Dragonstone 48 on Zenodo"), [16](https://zenodo.org/records/18922335 "Dragonstone 16 on Zenodo") | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S | +| [Sunspear](#sunspear) | Reproducing Ranjan & Sasselov (2016): UV for CO2, SO2 and H2S only | 4096, 256, 48, 16 | H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 | -The files for the UV were taken from the MPI-Mainz UV/VIS Spectral Atlas: -* CO2: Archer et al. (2013); Cook et al. (1966); Kuo et al. (2004); Gallagher et al. (1988); Shaw et al. (1995); Shemansky (1972); Venot, O. et al. (2018). -* H2O: Gürtler et al. (1977); J.B. Burkholder; S.P. Sander; J. Abbatt; J.R. Barker; R.E. Huie; C.E. Kolb; M.J. Kurylo; V.L. Orkin and Wine (2015); Ranjan et al. (2020). -* H2S: Feng et al. (1999); Grosch et al. (2015); Wu and Chen (1998). -* N2: Souza and Srivastava (1994). -* N2O: Johnston and Graham (1974). -* NH3: Burton et al. (1993); Limão-Vieira et al. (2019). -* O3: Mason et al. (1996); Molina and Molina (1986); Serdyuchenko et al. (2014). -* SO2: Golomb et al. (1962); Olive (2015). +### Generation I + +| Codename | Purpose | Bands | Gases | +|----------|---------|-------|-------| +| [Legacy](#legacy) | Legacy file used in Lichtenberg et al. (2021) | [318](https://zenodo.org/records/15806343 "Legacy 318 on Zenodo") | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | +| [Oak](#oak) | Water only (HITRAN), for benchmarking | [318](https://zenodo.org/records/15743843 "Oak 318 on Zenodo") | H2O | +| [Idwal](#idwal) | Superseded by Oak (older SOCRATES version) | 318 | H2O | +| [Balmora](#balmora) | Superseded by Oak (built on macOS) | 318 | H2O | +| [Triangle](#triangle) | Test file | 318 | H2O, H2, CO2 | +| [Mallard](#mallard) | Common opacities from HITRAN | [318](https://zenodo.org/records/23190131 "Mallard 318 on Zenodo") | H2O, H2, CO2, CO, CH4, O2, N2, He | +| [Reach](#reach) | As Mallard, with more opacities | [318](https://zenodo.org/records/23190144 "Reach 318 on Zenodo") | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | +| [Vivec](#vivec) | As Reach, built on macOS | 318 | H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS | + +--- ## Choosing a spectral file @@ -79,5 +58,491 @@ The appropriate spectral file depends on the atmospheric composition being model - For **benchmarking or comparison with observations**, use a high- or very-high-resolution configuration (256–4096 bands). - For **debugging**, use a low resolution spectral file with 16 bands. - For **water-dominated atmospheres**, Frostflow or Oak are appropriate depending on the required resolution and data source. -- For **mixed volatile atmospheres** (H$_2$O, CO$_2$, CH$_4$, H$_2$, N$_2$ and more), Honeyside is the most complete option. -- For **rock-vapour atmospheres** (relevant to magma ocean planets), use the Rocks files which include SiO and SiO$_2$ opacity. \ No newline at end of file +- For **mixed volatile atmospheres** (H2O, CO2, CH4, H2, N2 and more), Honeyside is the most complete option. +- The Generation III files are organised by composition: **Snowline** for water, **Breezehome** for oxidised volatiles, **Cliffshade** for reduced volatiles, **Volenfell** for rock vapours, **Proudspire** for combined volatiles, **Skyborn** for hot Jupiters, and **Atmora** and **Sovngarde** for rock vapours with volatiles (a smaller and a larger set of gases). Each has 32, 64, 128, 256 and 2048 bands. + +--- + +## Spectral file details + +One subsection per codename. **k-term tolerance** is the maximum RMS error in transmission allowed when choosing the number of k-terms (`Ccorr_k` option `-t` for Generation III). **Maximum absorber path** (Generation III) is the largest absorber amount for which `Ccorr_k` fits the k-terms to the line-by-line transmission (options `-l` for line absorption and `-ct` for continua); the build script sets 10³ kg m⁻² by default and 10 kg m⁻² for SiO, TiO, VO, MgO, Na, K and Fe (see [Building spectral files](../Explanations/spectraltools_pipeline.md)). The abbreviations used for data sources are listed under [Abbreviations](#abbreviations). A "?" marks a value that is not known. + +### Legacy + +- **Bands**: 318 +- **Zenodo records**: [318](https://zenodo.org/records/15806343 "Legacy 318 on Zenodo") +- **Absorbers**: H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS +- **Continua**: CO2, CH4, O2, N2, H2, He +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2002 +- **Date**: 2021 +- **Platform**: Linux Intel +- **Creator**: Tim Lichtenberg +- **Notes**: Legacy spectral file used in Lichtenberg+2021 + +### Oak + +- **Bands**: 318 +- **Zenodo records**: [318](https://zenodo.org/records/15743843 "Oak 318 on Zenodo") +- **Absorbers**: H2O +- **Continua**: H2O +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-10 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: Water-only spectral file from HITRAN. To be used for benchmarking. + +### Idwal + +- **Bands**: 318 +- **Zenodo records**: no Zenodo record found +- **Absorbers**: H2O +- **Continua**: H2O +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2211 +- **Date**: 2023-07-11 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: Made redundant by Oak. They only differ by SOCRATES version. + +### Balmora + +- **Bands**: 318 +- **Zenodo records**: no Zenodo record found +- **Absorbers**: H2O +- **Continua**: H2O +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-19 +- **Platform**: Mac ARM +- **Creator**: Tim Lichtenberg +- **Notes**: Made redundant by Oak. They only differ by creation platform. + +### Triangle + +- **Bands**: 318 +- **Zenodo records**: no Zenodo record found +- **Absorbers**: H2O, H2, CO2 +- **Continua**: H2O, H2, CO2 +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-11 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: Test + +### Mallard + +- **Bands**: 318 +- **Zenodo records**: [318](https://zenodo.org/records/23190131 "Mallard 318 on Zenodo") +- **Absorbers**: H2O, H2, CO2, CO, CH4, O2, N2, He +- **Continua**: H2O, CO2, CH4, O2, N2, H2, He +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-13 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: HITRAN file with useful opacities + +### Reach + +- **Bands**: 318 +- **Zenodo records**: [318](https://zenodo.org/records/23190144 "Reach 318 on Zenodo") +- **Absorbers**: H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS +- **Continua**: H2O, CO2, CH4, O2, N2, H2, He +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-19 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: Same as above but with more opacities + +### Vivec + +- **Bands**: 318 +- **Zenodo records**: no Zenodo record found +- **Absorbers**: H2O, CO2, O3, N2O, CO, CH4, O2, NO, SO2, NO2, NH3, HNO3, N2, H2, He, OCS +- **Continua**: H2O, CO2, CH4, O2, N2, H2, He +- **UV cross-sections**: No +- **Sources**: HITRAN +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2306 +- **Date**: 2023-07-25 +- **Platform**: Mac Intel +- **Creator**: Tim Lichtenberg +- **Notes**: Same as above, but compiled on MacOS + +### Kynesgrove + +- **Bands**: 318 +- **Zenodo records**: [318](https://zenodo.org/records/23190125 "Kynesgrove 318 on Zenodo") +- **Absorbers**: O2 +- **Continua**: O2-O2 +- **UV cross-sections**: No +- **Sources**: DACE +- **k-term tolerance**: 5.00E-04 +- **SOCRATES version**: 2403 +- **Date**: 2024-03-14 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls +- **Notes**: Created for validation of DACE xsec data against SOCRATES' own LbL calculations used in Mallard. + +### Frostflow + +- **Bands**: + - 4096: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low resolution. Intended for debugging. +- **Zenodo records**: [4096](https://zenodo.org/records/15799776 "Frostflow 4096 on Zenodo"), [256](https://zenodo.org/records/15799754 "Frostflow 256 on Zenodo"), [48](https://zenodo.org/records/15696415 "Frostflow 48 on Zenodo"), [16](https://zenodo.org/records/15799743 "Frostflow 16 on Zenodo") +- **Absorbers**: H2O +- **Continua**: H2O +- **UV cross-sections**: No +- **Sources**: DACE +- **k-term tolerance**: 5.00E-03 +- **SOCRATES version**: 2403 +- **Date**: 2024-03-20 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls + +### Dayspring + +- **Bands**: + - 4096: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low resolution. Intended for debugging. +- **Zenodo records**: [4096](https://zenodo.org/records/15799495 "Dayspring 4096 on Zenodo"), [256](https://zenodo.org/records/15799474 "Dayspring 256 on Zenodo"), [48](https://zenodo.org/records/15721749 "Dayspring 48 on Zenodo"), [16](https://zenodo.org/records/15799318 "Dayspring 16 on Zenodo") +- **Absorbers**: H2O, H2, CO2, CO, CH4, N2 +- **Continua**: H2O-H2O, H2-CH4, H2-H2, N2-H2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 +- **UV cross-sections**: No +- **Sources**: DACE +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2403 +- **Date**: 2024-04-30 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls + +### Honeyside + +- **Bands**: + - 4096: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low resolution. Intended for debugging. +- **Zenodo records**: [4096](https://zenodo.org/records/15696457 "Honeyside 4096 on Zenodo"), [256](https://zenodo.org/records/15799731 "Honeyside 256 on Zenodo"), [48](https://zenodo.org/records/15799652 "Honeyside 48 on Zenodo"), [16](https://zenodo.org/records/15799607 "Honeyside 16 on Zenodo") +- **Absorbers**: H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S +- **Continua**: H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 +- **UV cross-sections**: No +- **Sources**: DACE +- **k-term tolerance**: 1.00E-02 +- **SOCRATES version**: 2403 +- **Date**: 2024-07-07 +- **Platform**: Linux Intel +- **Creator**: Harrison Nicholls + +### Winterfell + +- **Bands**: + - 4096: Honeyside but with UV included for some molecules. Very high-resolution. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low-resolution. +- **Zenodo records**: [4096](https://zenodo.org/records/18402082 "Winterfell 4096 on Zenodo"), [256](https://zenodo.org/records/18402159 "Winterfell 256 on Zenodo"), [48](https://zenodo.org/records/18402184 "Winterfell 48 on Zenodo"), [16](https://zenodo.org/records/18402217 "Winterfell 16 on Zenodo") +- **Absorbers**: H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 +- **Continua**: H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 +- **UV cross-sections**: CO2, H2O, H2S, N2, N2O, NH3, O3, SO2 (see [UV cross-sections](#uv-cross-sections)) +- **Sources**: DACE, MPI +- **k-term tolerance**: ? +- **SOCRATES version**: 2407.2 +- **Date**: 2026-01-12 +- **Platform**: Linux Intel +- **Creator**: Bruna Fena + +### Dragonstone + +- **Bands**: + - 4096: Same as Lighthouse but no O2 included. Very high-resolution. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low-resolution. +- **Zenodo records**: [4096](https://zenodo.org/records/18922546 "Dragonstone 4096 on Zenodo"), [256](https://zenodo.org/records/18910878 "Dragonstone 256 on Zenodo"), [48](https://zenodo.org/records/18922528 "Dragonstone 48 on Zenodo"), [16](https://zenodo.org/records/18922335 "Dragonstone 16 on Zenodo") +- **Absorbers**: H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S +- **Continua**: H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 +- **UV cross-sections**: CO2, H2O, H2S, N2, N2O, NH3, O3, SO2 (see [UV cross-sections](#uv-cross-sections)) +- **Sources**: DACE, MPI +- **k-term tolerance**: ? +- **SOCRATES version**: 2407.2 +- **Date**: 2026-01-12 +- **Platform**: Linux Intel +- **Creator**: Bruna Fena + +### Sunspear + +- **Bands**: + - 4096: To simulate Ranjan and Sasselov (2016), only CO2, SO2 and H2S have UV values. Very high-resolution. + - 256: High resolution. + - 48: Medium resolution. + - 16: Low-resolution. +- **Zenodo records**: no Zenodo record found +- **Absorbers**: H2O, H2, CO2, CO, CH4, N2, NH3, SO2, N2O, O3, HCN, H2S, O2 +- **Continua**: H2O-H2O, H2-CH4, H2-H2, H2-N2, N2-N2, N2-H2O, CO2-CO2, CO2-H2, CO2-CH4 +- **UV cross-sections**: CO2, SO2, H2S (see [UV cross-sections](#uv-cross-sections)) +- **Sources**: DACE, MPI +- **k-term tolerance**: ? +- **SOCRATES version**: 2407.2 +- **Date**: 2026-01-12 +- **Platform**: Linux Intel +- **Creator**: Bruna Fena + +### Snowline + +Water. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: + - 2048: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 128: Medium resolution. + - 64: Low resolution. + - 32: Low resolution. +- **Zenodo records**: [2048](https://zenodo.org/records/23806236 "Snowline 2048 on Zenodo"), [256](https://zenodo.org/records/23806212 "Snowline 256 on Zenodo"), [128](https://zenodo.org/records/23806166 "Snowline 128 on Zenodo"), [64](https://zenodo.org/records/23806186 "Snowline 64 on Zenodo"), [32](https://zenodo.org/records/23806138 "Snowline 32 on Zenodo") +- **Absorbers**: H2O +- **Continua**: H2O-H2O +- **UV cross-sections**: No +- **Sources**: EXOMOL, ExoCross, MT_CKD +- **k-term tolerance**: 5.00E-03 +- **Maximum absorber path**: 10³ kg m⁻² (H2O); 10³ kg² m⁻⁵ for the continuum +- **SOCRATES version**: 2607.3 +- **Date**: 2026-10-29 +- **Platform**: Linux +- **Creator**: Harrison Nicholls +- Also contains water droplet scattering data (block 10). +- **References**: line list Polyansky et al. 2018; MT_CKD Mlawer et al. 2012, 2023. Also cite the ExoMol database references (Tennyson et al. 2024) and the ExoCross and PyExoCross references (Yurchenko et al. 2018; Zhang et al. 2024). Details and links are in [Opacity data and references](#opacity-data-and-references). + +### Breezehome + +Oxidised volatiles. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: + - 2048: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 128: Medium resolution. + - 64: Low resolution. + - 32: Low resolution. +- **Zenodo records**: [2048](https://zenodo.org/records/23808117 "Breezehome 2048 on Zenodo"), [256](https://zenodo.org/records/23808153 "Breezehome 256 on Zenodo"), [128](https://zenodo.org/records/23808184 "Breezehome 128 on Zenodo"), [64](https://zenodo.org/records/23808200 "Breezehome 64 on Zenodo"), [32](https://zenodo.org/records/23808218 "Breezehome 32 on Zenodo") +- **Absorbers**: H2O, CO2, CO, O2, SO2, OCS, S2 +- **Continua**: H2O-H2O, O2-CO2, O2-O2, CO2-CO2, CO2-H2O +- **UV cross-sections**: No +- **Sources**: EXOMOL, ExoCross, HITRAN CIA, MT_CKD +- **k-term tolerance**: 5.00E-03 +- **Maximum absorber path**: 10³ kg m⁻² for every gas; 10³ kg² m⁻⁵ for the continua +- **SOCRATES version**: 2607.4 +- **Date**: 2026-10-29 +- **Platform**: Linux +- **Creator**: Harrison Nicholls +- Also contains water droplet scattering data (block 10). +- **References**: line lists Polyansky et al. 2018, Yurchenko et al. 2025, Tao et al. 2026, Somogyi et al. 2026, Underwood et al. 2016, Tóbiás et al. 2018, Owens et al. 2024, Gomez et al. 2024; the CIA references for O2-CO2, O2-O2, CO2-CO2 and CO2-H2O; MT_CKD Mlawer et al. 2012, 2023. Also cite the ExoMol database references (Tennyson et al. 2024), the ExoCross and PyExoCross references (Yurchenko et al. 2018; Zhang et al. 2024) and the three HITRAN CIA overview papers. Details and links are in [Opacity data and references](#opacity-data-and-references). + +### Cliffshade + +Reduced volatiles. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: + - 2048: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 128: Medium resolution. + - 64: Low resolution. + - 32: Low resolution. +- **Absorbers**: H2, CO, CH4, S2, H2S, N2, NH3 +- **Continua**: H2-CH4, H2-H2, N2-H2, N2-N2, N2-CH4, CH4-CH4 +- **UV cross-sections**: No +- **Sources**: EXOMOL, HITEMP, ExoCross, DACE, HITRAN CIA +- **k-term tolerance**: 5.00E-03 +- **Maximum absorber path**: 10³ kg m⁻² for every gas; 10³ kg² m⁻⁵ for the continua +- **SOCRATES version**: 2607.4 +- **Date**: 2026-10-29 +- **Platform**: Linux +- **Creator**: Harrison Nicholls +- **References**: line lists Roueff et al. 2019 (paper and data set), Tao et al. 2026, Hargreaves et al. 2020, Gomez et al. 2024, Azzam et al. 2016, Chubb et al. 2018, Western et al. 2018, Western 2017, Shemansky 1969, Jans 2024, Coles et al. 2019, Al Derzi et al. 2015; DACE (Grimm & Heng 2015, Grimm et al. 2021, HELIOS-K); HITEMP (Rothman et al. 2010); the CIA references for H2-CH4, H2-H2, N2-H2, N2-N2, N2-CH4 and CH4-CH4. Also cite the ExoMol database references (Tennyson et al. 2024), the ExoCross and PyExoCross references (Yurchenko et al. 2018; Zhang et al. 2024) and the three HITRAN CIA overview papers. Details and links are in [Opacity data and references](#opacity-data-and-references). + +### Volenfell + +Rock vapours. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: + - 2048: Very high resolution. Intended for benchmarking. + - 256: High resolution. + - 128: Medium resolution. + - 64: Low resolution. + - 32: Low resolution. +- **Zenodo records**: [2048](https://zenodo.org/records/23808275 "Volenfell 2048 on Zenodo"), [256](https://zenodo.org/records/23808259 "Volenfell 256 on Zenodo"), [128](https://zenodo.org/records/23808253 "Volenfell 128 on Zenodo"), [64](https://zenodo.org/records/23808244 "Volenfell 64 on Zenodo"), [32](https://zenodo.org/records/23808230 "Volenfell 32 on Zenodo") +- **Absorbers**: CO, O2, SiO, TiO, MgO, Na, K, Fe +- **Continua**: O2-O2 +- **UV cross-sections**: No +- **Sources**: EXOMOL, ExoAtom, ExoCross, HITRAN CIA +- **k-term tolerance**: 5.00E-03 +- **Maximum absorber path**: 10³ kg m⁻² for CO and O2, 10 kg m⁻² for SiO, TiO, MgO, Na, K and Fe; 10³ kg² m⁻⁵ for the continuum +- **SOCRATES version**: 2607.4 +- **Date**: 2026-10-29 +- **Platform**: Linux +- **Creator**: Harrison Nicholls +- **References**: line lists Tao et al. 2026, Somogyi et al. 2026, Yurchenko et al. 2021, McKemmish et al. 2019, 2024, Li et al. 2019, Kramida et al. 2024; ExoAtom (Ni et al. 2026); the CIA references for O2-O2. Also cite the ExoMol database references (Tennyson et al. 2024), the ExoCross and PyExoCross references (Yurchenko et al. 2018; Zhang et al. 2024) and the three HITRAN CIA overview papers. Details and links are in [Opacity data and references](#opacity-data-and-references). + +### Proudspire + +Combined volatiles. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: 2048, 256, 128, 64, 32 +- **Zenodo records**: [2048](https://zenodo.org/records/23838267 "Proudspire 2048 on Zenodo"), [256](https://zenodo.org/records/23838213 "Proudspire 256 on Zenodo"), [128](https://zenodo.org/records/23838187 "Proudspire 128 on Zenodo"), [64](https://zenodo.org/records/23838157 "Proudspire 64 on Zenodo"), [32](https://zenodo.org/records/23837929 "Proudspire 32 on Zenodo") +- **Gases (line list)**: H2O (POKAZATEL), H2 (RACPPK), CO2 (Dozen), CO (4thplus), O2 (SWYT), O3 (HITRAN2024), CH4 (HITEMP2020), SO2 (ExoAmes), OCS (OYT8), S2 (Gomez), H2S (AYT2), N2 (WCCRMT), NH3 (CoYuTe), HCN (Harris) + +### Skyborn + +Hot Jupiters. Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: 2048, 256, 128, 64, 32 +- **Zenodo records**: [2048](https://zenodo.org/records/23838562 "Skyborn 2048 on Zenodo"), [256](https://zenodo.org/records/23838507 "Skyborn 256 on Zenodo"), [128](https://zenodo.org/records/23838482 "Skyborn 128 on Zenodo"), [64](https://zenodo.org/records/23838469 "Skyborn 64 on Zenodo"), [32](https://zenodo.org/records/23838451 "Skyborn 32 on Zenodo") +- **Gases (line list)**: H2O (POKAZATEL), H2 (RACPPK), CO2 (Dozen), CO (4thplus), SiO (SiOUVenIR), TiO (Toto), VO (VOMYT), MgO (LiTY), Na (NIST), K (NIST), Fe (NIST) + +### Atmora + +Rock vapours and volatiles (smaller set). Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: 2048, 256, 128, 64, 32 +- **Zenodo records**: [2048](https://zenodo.org/records/23837640 "Atmora 2048 on Zenodo"), [256](https://zenodo.org/records/23837583 "Atmora 256 on Zenodo"), [128](https://zenodo.org/records/23837548 "Atmora 128 on Zenodo"), [64](https://zenodo.org/records/23837520 "Atmora 64 on Zenodo"), [32](https://zenodo.org/records/23837505 "Atmora 32 on Zenodo") +- **Gases (line list)**: H2O (POKAZATEL), H2 (RACPPK), CO2 (Dozen), CO (4thplus), O2 (SWYT), CH4 (HITEMP2020), SO2 (ExoAmes), S2 (Gomez), H2S (AYT2), NH3 (CoYuTe), SiO (SiOUVenIR), TiO (Toto), Na (NIST), K (NIST) + +### Sovngarde + +Rock vapours and volatiles (larger set). Made with `spectraltools`; see [Building spectral files](../Explanations/spectraltools_pipeline.md). + +- **Bands**: 2048, 256, 128, 64, 32 +- **Zenodo records**: [2048](https://zenodo.org/records/23839054 "Sovngarde 2048 on Zenodo"), [256](https://zenodo.org/records/23838984 "Sovngarde 256 on Zenodo"), [128](https://zenodo.org/records/23838924 "Sovngarde 128 on Zenodo"), [64](https://zenodo.org/records/23838886 "Sovngarde 64 on Zenodo"), [32](https://zenodo.org/records/23838860 "Sovngarde 32 on Zenodo") +- **Gases (line list)**: H2O (POKAZATEL), H2 (RACPPK), CO2 (Dozen), CO (4thplus), O2 (SWYT), O3 (HITRAN2024), CH4 (HITEMP2020), SO2 (ExoAmes), OCS (OYT8), S2 (Gomez), H2S (AYT2), N2 (WCCRMT), NH3 (CoYuTe), HCN (Harris), SiO (SiOUVenIR), TiO (Toto), MgO (LiTY), Na (NIST), K (NIST), Fe (NIST) + +The line list for each gas is the same as in the [line opacity table](#line-opacities). + +--- + +## Opacity data and references + +This section lists the data used by the Generation III files, and the references to cite for them; each family's own list is in its subsection above. All references below are in the BibTeX file [proteus_spectral_file_references.bib](proteus_spectral_file_references.bib). They were taken from each data provider's recommended citation and checked against the Crossref or DataCite record (or against the provider's page where there is no DOI). + +### Line opacities + +PyExoCross cross-sections were computed from the line list with the line-wing cut-off given. DACE cross-sections were downloaded from DACE, which computes them with HELIOS-K; their cut-off is set by DACE and has not been checked. + +| Species | Line list | Database and cross-sections | References | +|---------|-----------|-----------------------------|------------| +| H2O | POKAZATEL | ExoMol; PyExoCross, cut-off 25 cm⁻¹ | [Polyansky et al. 2018](https://doi.org/10.1093/mnras/sty1877) | +| H2 | RACPPK | ExoMol; PyExoCross, cut-off 100 cm⁻¹ | [Roueff et al. 2019](https://doi.org/10.1051/0004-6361/201936249); data set [VizieR J/A+A/630/A58](https://doi.org/10.26093/cds/vizier.36300058) | +| CO2 | Dozen | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Yurchenko et al. 2025](https://doi.org/10.1093/mnras/staf2135) | +| CO | 4thplus | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Tao et al. 2026](https://doi.org/10.1093/mnras/stag985) | +| O2 | SWYT | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Somogyi et al. 2026](https://doi.org/10.1093/mnras/stag1279) | +| SO2 | ExoAmes | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Underwood et al. 2016](https://doi.org/10.1093/mnras/stw849); [Tóbiás et al. 2018](https://doi.org/10.1016/j.jqsrt.2018.01.006) | +| OCS | OYT8 | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Owens et al. 2024](https://doi.org/10.1093/mnras/stae1110). ExoMol also lists a second paper, marked as submitted; it is not included here. | +| S2 | Gomez | HITRAN-format line list hosted by ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Gomez et al. 2024](https://doi.org/10.1093/mnras/stae246) | +| H2S | AYT2 | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Azzam et al. 2016](https://doi.org/10.1093/mnras/stw1133); [Chubb et al. 2018](https://doi.org/10.1016/j.jqsrt.2018.07.012) | +| N2 | WCCRMT | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Western et al. 2018](https://doi.org/10.1016/j.jqsrt.2018.07.017); [Western 2017](https://doi.org/10.1016/j.jqsrt.2016.04.010); [Shemansky 1969](https://doi.org/10.1063/1.1672058); [Jans 2024](https://doi.org/10.1016/j.jqsrt.2023.108809) | +| CH4 | HITEMP2020 | HITEMP; cross-sections from DACE | [Hargreaves et al. 2020](https://doi.org/10.3847/1538-4365/ab7a1a) | +| NH3 | CoYuTe | ExoMol; cross-sections from DACE | [Coles et al. 2019](https://doi.org/10.1093/mnras/stz2778); [Al Derzi et al. 2015](https://doi.org/10.1016/j.jqsrt.2015.03.034) | +| SiO | SiOUVenIR | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Yurchenko et al. 2021](https://doi.org/10.1093/mnras/stab3267) | +| TiO | Toto | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [McKemmish et al. 2019](https://doi.org/10.1093/mnras/stz1818); [McKemmish et al. 2024](https://doi.org/10.1093/rasti/rzae037) | +| MgO | LiTY | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Li et al. 2019](https://doi.org/10.1093/mnras/stz912) | +| Na, K, Fe | NIST (ExoAtom data set version 20240901) | ExoAtom; PyExoCross, cut-off 100 cm⁻¹ | [Kramida et al. 2024, NIST ASD](https://doi.org/10.18434/T4W30F); [Ni et al. 2026](https://doi.org/10.1093/rasti/rzaf065) | +| O3 | HITRAN2024 | HITRAN; PyExoCross, cut-off 40 cm⁻¹ | [Gordon et al. 2026](https://doi.org/10.1016/j.jqsrt.2026.109807) | +| HCN | Harris | ExoMol; PyExoCross, cut-off 40 cm⁻¹ | [Harris et al. 2006](https://doi.org/10.1111/j.1365-2966.2005.09960.x); [Barber et al. 2014](https://doi.org/10.1093/mnras/stt2011) | +| VO | VOMYT | ExoMol; cross-sections from DACE | [McKemmish et al. 2016](https://doi.org/10.1093/mnras/stw1969) | + +### Continua + +HITRAN CIA files are from the HITRAN `main` folder, except CH4-CH4 and CH4-Ar, which are only in the `alternate` folder. The HITRAN CIA overview papers should be cited alongside the original sources: [Terragni et al. 2025](https://doi.org/10.1016/j.jqsrt.2025.109631) (the reference that the HITRAN CIA page gives), [Karman et al. 2019](https://doi.org/10.1016/j.icarus.2019.02.034) and [Richard et al. 2012](https://doi.org/10.1016/j.jqsrt.2011.11.004). + +| Pair | Data | Original references | +|------|------|---------------------| +| H2O-H2O | MT_CKD 4.3 self-continuum (`absco-ref_wv-mt-ckd4p3.nc`) | [Mlawer et al. 2012](https://doi.org/10.1098/rsta.2011.0295); [Mlawer et al. 2023](https://doi.org/10.1016/j.jqsrt.2023.108645) | +| H2-CH4 | `H2-CH4_norm_2011.cia` | [Borysow & Frommhold 1986, ApJ 304](https://doi.org/10.1086/164221) | +| H2-H2 | `H2-H2_2011.cia` | [Abel et al. 2011](https://doi.org/10.1021/jp109441f) | +| N2-H2 | `N2-H2_2024.cia` | [Borysow & Frommhold 1986, ApJ 303](https://doi.org/10.1086/164096); [Wei et al. 2024](https://doi.org/10.1016/j.ijhydene.2024.10.318) | +| N2-N2 | `N2-N2_2021.cia` | [Chistikov et al. 2019](https://doi.org/10.1063/1.5125756); [Baranov et al. 2005](https://doi.org/10.1016/j.jms.2005.06.008); [Lafferty et al. 1996](https://doi.org/10.1364/ao.35.005911); [Hartmann et al. 2017](https://doi.org/10.1002/2016jd025677) | +| N2-CH4 | `N2-CH4_2024.cia` | [Finenko et al. 2022](https://doi.org/10.3847/1538-4365/ac36d3) | +| O2-CO2 | `O2-CO2_2024.cia` | [Banerjee et al. 2019](https://doi.org/10.1039/c8cp06778c); [Vangvichith et al. 2009](https://doi.org/10.1016/j.jqsrt.2009.06.002) | +| O2-O2 | `O2-O2_2024.cia` | [Baranov et al. 2005](https://doi.org/10.1016/j.jms.2005.06.008); [Mondelain et al. 2019](https://doi.org/10.1029/2018jd029317); [Kassi et al. 2021](https://doi.org/10.1029/2021jd034860); [Adkins et al. 2023](https://doi.org/10.1016/j.jqsrt.2023.108732); [Karman et al. 2018](https://doi.org/10.1038/s41557-018-0015-x); [Spiering & van der Zande 2012](https://doi.org/10.1039/c2cp40961e); [Tran et al. 2006](https://doi.org/10.1029/2005jd006869); [Spiering et al. 2011](https://doi.org/10.1039/c1cp20403c); [Thalman & Volkamer 2013](https://doi.org/10.1039/c3cp50968k); [Finkenzeller & Volkamer 2022](https://doi.org/10.1016/j.jqsrt.2021.108063) | +| CO2-CO2 | `CO2-CO2_2024.cia` | [Gruszka & Borysow 1997](https://doi.org/10.1006/icar.1997.5773); [Baranov et al. 2004](https://doi.org/10.1016/j.jms.2004.04.010); [Terragni et al. 2025](https://doi.org/10.1016/j.jqsrt.2025.109595); [Baranov et al. 2003](https://doi.org/10.1007/978-94-010-0025-3_12); [Tran et al. 2024](https://doi.org/10.1016/j.icarus.2024.116265); [Baranov 2018](https://doi.org/10.1016/j.jms.2017.11.005) | +| CO2-H2O | `CO2-H2O_2024.cia` | [Fleurbaey et al. 2022](https://doi.org/10.1016/j.jqsrt.2022.108162) | +| CH4-CH4 | `CH4-CH4_2011.cia` (alternate folder) | [Borysow & Frommhold 1987](https://doi.org/10.1086/165426) | +| N2-H2O | `N2-H2O_2018.cia` | [Hartmann et al. 2018](https://doi.org/10.1063/1.5019994) | +| O2-N2 | `O2-N2_2024.cia` | [Thibault et al. 1997](https://doi.org/10.1364/ao.36.000563); [Orlando et al. 1991](https://doi.org/10.1029/91jd02042); [Menoux et al. 1993](https://doi.org/10.1364/ao.32.000263); [Baranov et al. 2005](https://doi.org/10.1016/j.jms.2005.06.008); [Lafferty et al. 1996](https://doi.org/10.1364/ao.35.005911); [Mondelain et al. 2019](https://doi.org/10.1029/2018jd029317); [Kassi et al. 2021](https://doi.org/10.1029/2021jd034860); [Adkins et al. 2023](https://doi.org/10.1016/j.jqsrt.2023.108732); [Tran et al. 2006](https://doi.org/10.1029/2005jd006869) | +| CO2-H2 | `CO2-H2_2024.cia` | [Turbet et al. 2020](https://doi.org/10.1016/j.icarus.2020.113762) | +| CO2-CH4 | `CO2-CH4_2024.cia` | [Fakhardji et al. 2022](https://doi.org/10.1016/j.jqsrt.2022.108148) | + +### General references + +- **ExoMol database**: [Tennyson et al. 2024](https://doi.org/10.1016/j.jqsrt.2024.109083) (most recent release) and [Tennyson et al. 2016](https://doi.org/10.1016/j.jms.2016.05.002); optionally the data-format update [Corey et al. 2026](https://doi.org/10.1093/rasti/rzag081). ExoMol asks users to cite the line list papers as well. +- **ExoCross and PyExoCross**: [Yurchenko et al. 2018](https://doi.org/10.1051/0004-6361/201732531) (ExoCross); [Zhang et al. 2024](https://doi.org/10.1093/rasti/rzae016) (PyExoCross). +- **ExoAtom**: [Ni et al. 2026](https://doi.org/10.1093/rasti/rzaf065). +- **DACE and HELIOS-K**: [Grimm & Heng 2015](https://doi.org/10.1088/0004-637x/808/2/182); [Grimm et al. 2021](https://doi.org/10.3847/1538-4365/abd773), which describes the database; the [HELIOS-K repository](https://github.com/exoclime/HELIOS-K). +- **HITRAN2024**: [Gordon et al. 2026](https://doi.org/10.1016/j.jqsrt.2026.109807). +- **HITEMP**: [Rothman et al. 2010](https://doi.org/10.1016/j.jqsrt.2010.05.001); for CH4, also [Hargreaves et al. 2020](https://doi.org/10.3847/1538-4365/ab7a1a). +- **NIST Atomic Spectra Database**: [Kramida et al. 2024](https://doi.org/10.18434/T4W30F) (version 5.12; add the access date). +- **MT_CKD**: [Mlawer et al. 2012](https://doi.org/10.1098/rsta.2011.0295) and [Mlawer et al. 2023](https://doi.org/10.1016/j.jqsrt.2023.108645); AER and HITRAN also list [Mlawer et al. 2019](https://doi.org/10.1029/2018jd029508), and AER lists [Delamere et al. 2010](https://doi.org/10.1029/2009jd012968), [Payne et al. 2011](https://doi.org/10.1109/tgrs.2010.2091416) and the [MT_CKD_H2O software](https://github.com/AER-RC/MT_CKD_H2O). + +### Additional references for Proudspire, Skyborn, Atmora and Sovngarde + +Proudspire, Skyborn, Atmora and Sovngarde also need: Gordon et al. 2026 (O3; Proudspire, Sovngarde), Harris et al. 2006 and Barber et al. 2014 (HCN; Proudspire, Sovngarde), McKemmish et al. 2016 (VO; Skyborn), and the CIA references for N2-H2O, O2-N2, CO2-H2 and CO2-CH4 where both gases of a pair are present. + +### Caveats + +- **CO2-H2O**: the HITRAN data cover only 296 K and 5700–6300 cm⁻¹. They are used at all temperatures. +- **N2-H2O**: the HITRAN data cover 250–350 K. +- **CH4-CH4 and CH4-Ar** come from HITRAN's `alternate` folder, which the HITRAN CIA readme describes as holding either alternative data or data "not generally recommended due to large uncertainties". CH4-Ar is not applied in any file here, since none contains Ar. +- **DACE coverage**: the DACE data stop at 2500 K for CH4 (HITEMP2020), 1900 K for NH3 (CoYuTe) and 2900 K or 4500 K for VO (VOMYT versions 1.0 and 2.0), and at 10³ bar. The files' grid reaches 5000 K and 10⁴ bar, so at the missing points these gases use the nearest available point. The DACE line-list versions used are not recorded in the build logs. +- **NIST ASD version**: the ExoAtom NIST data set is dated 20240901, before ASD version 5.12 was released, so the data may come from an earlier ASD version. The BibTeX entry follows NIST's current (version 5.12) citation form. +- **MT_CKD** is defined for line absorption cut at 25 cm⁻¹ with the Lorentzian "pedestal" removed. The H2O cross-sections use a 25 cm⁻¹ cut-off; whether the pedestal was removed has not been checked. +- **Original sources**: HITRAN (for O3) and HITEMP (for CH4) also ask users to cite the original source of each parameter used. Those per-line sources are not listed here. + +--- + +### UV cross-sections + +The files for the UV were taken from the MPI-Mainz UV/VIS Spectral Atlas: + +- CO2: Archer et al. (2013); Cook et al. (1966); Kuo et al. (2004); Gallagher et al. (1988); Shaw et al. (1995); Shemansky (1972); Venot, O. et al. (2018). +- H2O: Gürtler et al. (1977); J.B. Burkholder; S.P. Sander; J. Abbatt; J.R. Barker; R.E. Huie; C.E. Kolb; M.J. Kurylo; V.L. Orkin and Wine (2015); Ranjan et al. (2020). +- H2S: Feng et al. (1999); Grosch et al. (2015); Wu and Chen (1998). +- N2: Souza and Srivastava (1994). +- N2O: Johnston and Graham (1974). +- NH3: Burton et al. (1993); Limão-Vieira et al. (2019). +- O3: Mason et al. (1996); Molina and Molina (1986); Serdyuchenko et al. (2014). +- SO2: Golomb et al. (1962); Olive (2015). + +--- + +## Abbreviations + +The data sources in the [spectral file details](#spectral-file-details) are abbreviated as follows: + + * **HITRAN** – [HITRAN linelist](https://hitran.org/) + * **EXOMOL** — [ExoMol linelist](https://www.exomol.com/) + * **DACE** — [DACE opacity database](https://dace.unige.ch/opacityDatabase/): cross-sections computed with HELIOS-K from published line lists, including ExoMol, HITRAN and HITEMP line lists. + * **ExoCross** — Cross-sections computed from line lists with ExoCross. The Generation III files used PyExoCross, the Python version of ExoCross. + * **ExoAtom** — [ExoAtom](https://www.exomol.com/exoatom/) database of atomic line lists in ExoMol format; its NIST data set is used here. + * **HITEMP** — [HITEMP](https://hitran.org/hitemp/) high-temperature line database. + * **HITRAN CIA** — [HITRAN collision-induced absorption](https://hitran.org/cia/) data. + * **MT_CKD** — [MT_CKD](https://github.com/AER-RC/MT_CKD_H2O) water vapour continuum model; version 4.3 (self-continuum only) in Generation III. + * **MPI** — MPI-Mainz UV/VIS Spectral Atlas (UV cross-sections; see [UV cross-sections](#uv-cross-sections)). diff --git a/docs/Reference/proteus_spectral_file_references.bib b/docs/Reference/proteus_spectral_file_references.bib new file mode 100644 index 00000000..6d113a9c --- /dev/null +++ b/docs/Reference/proteus_spectral_file_references.bib @@ -0,0 +1,964 @@ +% Opacity data references for SOCRATES spectral files built with spectraltools (FormingWorlds fork). +% Generated 2026-10-29. Companion to nogit_opacity_references.md. +% Journal entries: fields from Crossref metadata (api.crossref.org), year = published-print year where Crossref +% gives one, else issued year. Titles converted from Crossref HTML/MathML to LaTeX; where Crossref titles were +% garbled, the provider's text was used (see the .md file). Non-DOI or DataCite entries: fields from the provider page. + + +% ===== Line lists and atomic data (Table 1) ===== + +@article{Polyansky2018, + author = {Polyansky, Oleg L and Kyuberis, Aleksandra A and Zobov, Nikolai F and Tennyson, Jonathan and Yurchenko, Sergei N and Lodi, Lorenzo}, + title = {{ExoMol molecular line lists XXX: a complete high-accuracy line list for water}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {480}, + number = {2}, + pages = {2597--2608}, + year = {2018}, + doi = {10.1093/mnras/sty1877} +} + +@article{Roueff2019, + author = {Roueff, E. and Abgrall, H. and Czachorowski, P. and Pachucki, K. and Puchalski, M. and Komasa, J.}, + title = {{The full infrared spectrum of molecular hydrogen}}, + journal = {Astronomy \& Astrophysics}, + volume = {630}, + pages = {A58}, + year = {2019}, + doi = {10.1051/0004-6361/201936249} +} + +@misc{Roueff2019b, + author = {Roueff, E. and Abgrall, H. and Czachorowski, P. and Pachucki, K. and Puchalski, M. and Komasa, J.}, + title = {{Full infrared spectrum of molecular hydrogen}}, + howpublished = {VizieR On-line Data Catalog: J/A+A/630/A58}, + publisher = {Centre de Donn{\'e}es astronomiques de Strasbourg (CDS)}, + year = {2019}, + doi = {10.26093/cds/vizier.36300058} +} + +@article{Yurchenko2025, + author = {Yurchenko, Sergei N and Barnfield, Marco G and Bowesman, Charles A and Brady, Ryan P and Guest, Elizabeth R and Kefala, Kyriaki and Ni, Qing-He and Perri, Armando N and Smola, Oleksiy A and Solokov, Andrei and Tao, Chenyi and Tennyson, Jonathan}, + title = {{ExoMol line lists -- LXIII. ExoMol line lists for 12 isotopologues of CO2}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {545}, + number = {3}, + pages = {staf2135}, + year = {2025}, + doi = {10.1093/mnras/staf2135} +} + +@article{Tao2026, + author = {Tao, Chenyi and Abu El Kher, Nariman and El-Kork, Nayla and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol line lists -- LXX. The CO fourth positive band system}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {549}, + number = {4}, + pages = {stag985}, + year = {2026}, + doi = {10.1093/mnras/stag985} +} + +@article{Somogyi2026, + author = {Somogyi, W and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol line lists -- LXVII: empirical magnetic dipole and electric quadrupole spectra of the infrared bands of oxygen (O2)}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {550}, + number = {4}, + pages = {stag1279}, + year = {2026}, + doi = {10.1093/mnras/stag1279} +} + +@article{Gordon2026, + author = {Gordon, I.E. and Rothman, L.S. and Hargreaves, R.J. and Gomez, F.M. and Bertin, T. and Hill, C. and Kochanov, R.V. and Tan, Y. and Wcis{\l}o, P. and Makhnev, V. Yu. and Bernath, P.F. and Birk, M. and Boudon, V. and Campargue, A. and Coustenis, A. and Drouin, B.J. and Gamache, R.R. and Hodges, J.T. and Jacquemart, D. and Mlawer, E.J. and Nikitin, A.V. and Perevalov, V.I. and Rotger, M. and Robert, S. and Tennyson, J. and Toon, G.C. and Tran, H. and Tyuterev, V.G. and Adkins, E.M. and Barbe, A. and Bailey, D.M. and Bielska, K. and Bizzocchi, L. and Blake, T.A. and Bowesman, C.A. and Cacciani, P. and {\v C}erm{\'a}k, P. and Cs{\'a}sz{\'a}r, A.G. and Denis, L. and Egbert, S.C. and Egorov, O. and Ermilov, A. Yu. and Fleisher, A.J. and Fleurbaey, H. and Foltynowicz, A. and Furtenbacher, T. and Germann, M. and Guest, E.R. and Harrison, J.J. and Hartmann, J.-M. and Hj{\"a}lt{\'e}n, A. and Hu, S.-M. and Huang, X. and Johnson, T.J. and J{\'o}{\'z}wiak, H. and Kassi, S. and Khan, M.V. and Kwabia-Tchana, F. and Lee, T.J. and Lisak, D. and Liu, A.-W. and Lyulin, O.M. and Malarich, N.A. and Manceron, L. and Marinina, A.A. and Massie, S.T. and Mascio, J. and Medvedev, E.S. and Meshkov, V.V. and Mellau, G. Ch. and Melosso, M. and Mikhailenko, S.N. and Mondelain, D. and M{\"u}ller, H.S.P. and O'Donnell, M. and Owens, A. and Perrin, A. and Polyansky, O.L. and Raston, P.L. and Reed, Z.D. and Rey, M. and Richard, C. and Rieker, G.B. and R{\"o}ske, C. and Sharpe, S.W. and Starikova, E. and Stolarczyk, N. and Stolyarov, A.V. and Sung, K. and Tamassia, F. and Terragni, J. and Ushakov, V.G. and Vasilchenko, S. and Vispoel, B. and Vodopyanov, K.L. and Wagner, G. and W{\'o}jtewicz, S. and Yurchenko, S.N. and Zobov, N.F.}, + title = {{The HITRAN2024 molecular spectroscopic database}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {353}, + pages = {109807}, + year = {2026}, + doi = {10.1016/j.jqsrt.2026.109807} +} + +@article{Hargreaves2020, + author = {Hargreaves, Robert J. and Gordon, Iouli E. and Rey, Michael and Nikitin, Andrei V. and Tyuterev, Vladimir G. and Kochanov, Roman V. and Rothman, Laurence S.}, + title = {{An Accurate, Extensive, and Practical Line List of Methane for the HITEMP Database}}, + journal = {The Astrophysical Journal Supplement Series}, + volume = {247}, + number = {2}, + pages = {55}, + year = {2020}, + doi = {10.3847/1538-4365/ab7a1a} +} + +@article{Underwood2016, + author = {Underwood, Daniel S. and Tennyson, Jonathan and Yurchenko, Sergei N. and Huang, Xinchuan and Schwenke, David W. and Lee, Timothy J. and Clausen, Sonnik and Fateev, Alexander}, + title = {{ExoMol molecular line lists -- XIV. The rotation--vibration spectrum of hot SO$_{2}$}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {459}, + number = {4}, + pages = {3890--3899}, + year = {2016}, + doi = {10.1093/mnras/stw849} +} + +@article{Tobias2018, + author = {T{\'o}bi{\'a}s, Roland and Furtenbacher, Tibor and Cs{\'a}sz{\'a}r, Attila G. and Naumenko, Olga V. and Tennyson, Jonathan and Flaud, Jean-Marie and Kumar, Praveen and Poirier, Bill}, + title = {{Critical evaluation of measured rotational--vibrational transitions of four sulphur isotopologues of S16O2}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {208}, + pages = {152--163}, + year = {2018}, + doi = {10.1016/j.jqsrt.2018.01.006} +} + +@article{Owens2024, + author = {Owens, Alec and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol line lists -- LVIII. High-temperature molecular line list of carbonyl sulphide (OCS)}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {530}, + number = {4}, + pages = {4004--4015}, + year = {2024}, + doi = {10.1093/mnras/stae1110} +} + +@article{Gomez2024, + author = {Gomez, Frances M and Hargreaves, Robert J and Gordon, Iouli E}, + title = {{A HITRAN-formatted UV line list of S$_2$-containing transitions involving X$^3\Sigma_g^-$, B$^3\Sigma_u^-$, and B$''\,^3\Pi_u$ electronic states}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {528}, + number = {2}, + pages = {3823--3832}, + year = {2024}, + doi = {10.1093/mnras/stae246} +} + +@article{Azzam2016, + author = {Azzam, Ala'a A. A. and Tennyson, Jonathan and Yurchenko, Sergei N. and Naumenko, Olga V.}, + title = {{ExoMol molecular line lists -- XVI. The rotation--vibration spectrum of hot H$_{2}$S}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {460}, + number = {4}, + pages = {4063--4074}, + year = {2016}, + doi = {10.1093/mnras/stw1133} +} + +@article{Chubb2018, + author = {Chubb, Katy L. and Naumenko, Olga and Keely, Stefan and Bartolotto, Sebestiano and Macdonald, Skye and Mukhtar, Mahmoud and Grachov, Andrey and White, Joe and Coleman, Eden and Liu, Anwen and Fazliev, Alexander Z. and Polovtseva, Elena R. and Horneman, Veli-Matti and Campargue, Alain and Furtenbacher, Tibor and Cs{\'a}sz{\'a}r, Attila G. and Yurchenko, Sergei N. and Tennyson, Jonathan}, + title = {{Marvel analysis of the measured high-resolution rovibrational spectra of H232S}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {218}, + pages = {178--186}, + year = {2018}, + doi = {10.1016/j.jqsrt.2018.07.012} +} + +@article{Western2018, + author = {Western, Colin M. and Carter-Blatchford, Luke and Crozet, Patrick and Ross, Amanda J. and Morville, J{\'e}r{\^o}me and Tokaryk, Dennis W.}, + title = {{The spectrum of N$_2$ from 4,500 to 15,700 cm$^{-1}$ revisited with PGOPHER}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {219}, + pages = {127--141}, + year = {2018}, + doi = {10.1016/j.jqsrt.2018.07.017} +} + +@article{Western2017, + author = {Western, Colin M.}, + title = {{PGOPHER: A program for simulating rotational, vibrational and electronic spectra}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {186}, + pages = {221--242}, + year = {2017}, + doi = {10.1016/j.jqsrt.2016.04.010} +} + +@article{Shemansky1969, + author = {Shemansky, D. E.}, + title = {{N2 Vegard--Kaplan System in Absorption}}, + journal = {The Journal of Chemical Physics}, + volume = {51}, + number = {2}, + pages = {689--700}, + year = {1969}, + doi = {10.1063/1.1672058} +} + +@article{Jans2024, + author = {Jans, E.R.}, + title = {{Rovibronic molecular line list for the N$_2$(C$^3\Pi_u$--B$^3\Pi_g$) second positive system}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {312}, + pages = {108809}, + year = {2024}, + doi = {10.1016/j.jqsrt.2023.108809} +} + +@article{Coles2019, + author = {Coles, Phillip A and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol molecular line lists -- XXXV. A rotation-vibration line list for hot ammonia}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {490}, + number = {4}, + pages = {4638--4647}, + year = {2019}, + doi = {10.1093/mnras/stz2778} +} + +@article{AlDerzi2015, + author = {Al Derzi, Afaf R. and Furtenbacher, Tibor and Tennyson, Jonathan and Yurchenko, Sergei N. and Cs{\'a}sz{\'a}r, Attila G.}, + title = {{MARVEL analysis of the measured high-resolution spectra of 14NH3}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {161}, + pages = {117--130}, + year = {2015}, + doi = {10.1016/j.jqsrt.2015.03.034} +} + +@article{Harris2006, + author = {Harris, G. J. and Tennyson, J. and Kaminsky, B. M. and Pavlenko, Y. V. and Jones, H. R. A.}, + title = {{Improved HCN/HNC linelist, model atmospheres and synthetic spectra for WZ Cas}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {367}, + number = {1}, + pages = {400--406}, + year = {2006}, + doi = {10.1111/j.1365-2966.2005.09960.x} +} + +@article{Barber2014, + author = {Barber, R. J. and Strange, J. K. and Hill, C. and Polyansky, O. L. and Mellau, G. Ch. and Yurchenko, S. N. and Tennyson, Jonathan}, + title = {{ExoMol line lists -- III. An improved hot rotation-vibration line list for HCN and HNC}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {437}, + number = {2}, + pages = {1828--1835}, + year = {2014}, + doi = {10.1093/mnras/stt2011} +} + +@article{Yurchenko2021, + author = {Yurchenko, Sergei N and Tennyson, Jonathan and Syme, Anna-Maree and Adam, Ahmad Y and Clark, Victoria H J and Cooper, Bridgette and Dobney, C Pria and Donnelly, Shaun T E and Gorman, Maire N and Lynas-Gray, Anthony E and Meltzer, Thomas and Owens, Alec and Qu, Qianwei and Semenov, Mikhail and Somogyi, Wilfrid and Upadhyay, Apoorva and Wright, Samuel and Zapata Trujillo, Juan C}, + title = {{ExoMol line lists -- XLIV. Infrared and ultraviolet line list for silicon monoxide (28Si16O)}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {510}, + number = {1}, + pages = {903--919}, + year = {2021}, + doi = {10.1093/mnras/stab3267} +} + +@article{McKemmish2019, + author = {McKemmish, Laura K and Masseron, Thomas and Hoeijmakers, H Jens and P{\'e}rez-Mesa, V{\'i}ctor and Grimm, Simon L and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol molecular line lists -- XXXIII. The spectrum of Titanium Oxide}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {488}, + number = {2}, + pages = {2836--2854}, + year = {2019}, + doi = {10.1093/mnras/stz1818} +} + +@article{McKemmish2024, + author = {McKemmish, Laura K and Bowesman, Charles A and Kefala, Kyriaki and Perri, Armando N and Syme, Anna-Maree and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{A hybrid approach to generating diatomic line lists for high resolution studies of exoplanets and other hot astronomical objects: updates to ExoMol MgO, TiO, and VO line lists}}, + journal = {RAS Techniques and Instruments}, + volume = {3}, + number = {1}, + pages = {565--583}, + year = {2024}, + doi = {10.1093/rasti/rzae037} +} + +@article{McKemmish2016, + author = {McKemmish, Laura K. and Yurchenko, Sergei N. and Tennyson, Jonathan}, + title = {{ExoMol line lists -- XVIII. The high-temperature spectrum of VO}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {463}, + number = {1}, + pages = {771--793}, + year = {2016}, + doi = {10.1093/mnras/stw1969} +} + +@article{Bowesman2024, + author = {Bowesman, Charles A and Qu, Qianwei and McKemmish, Laura K and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoMol line lists -- LV: hyperfine-resolved molecular line list for vanadium monoxide (51V16O)}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {529}, + number = {2}, + pages = {1321--1332}, + year = {2024}, + doi = {10.1093/mnras/stae542} +} + +@article{Li2019, + author = {Li, Heng Ying and Tennyson, Jonathan and Yurchenko, Sergei N}, + title = {{ExoMol line lists -- XXXII. The rovibronic spectrum of MgO}}, + journal = {Monthly Notices of the Royal Astronomical Society}, + volume = {486}, + number = {2}, + pages = {2351--2365}, + year = {2019}, + doi = {10.1093/mnras/stz912} +} + +@misc{Kramida2024, + author = {Kramida, A. and Ralchenko, Yu. and Reader, J. and {NIST ASD Team}}, + title = {{NIST Atomic Spectra Database (version 5.12)}}, + howpublished = {[Online]. Available: \url{https://physics.nist.gov/asd}}, + organization = {National Institute of Standards and Technology, Gaithersburg, MD}, + year = {2024}, + doi = {10.18434/T4W30F}, + note = {Citation form from https://physics.nist.gov/PhysRefData/ASD/Html/verhist.shtml; add the access date. ExoAtom NIST data set version 20240901 may derive from ASD v5.11 -- check before citing} +} + +% ===== Databases and codes ===== + +@article{Tennyson2024, + author = {Tennyson, Jonathan and Yurchenko, Sergei N. and Zhang, Jingxin and Bowesman, Charles A. and Brady, Ryan P. and Buldyreva, Jeanna and Chubb, Katy L. and Gamache, Robert R. and Gorman, Maire N. and Guest, Elizabeth R. and Hill, Christian and Kefala, Kyriaki and Lynas-Gray, A.E. and Mellor, Thomas M. and McKemmish, Laura K. and Mitev, Georgi B. and Mizus, Irina I. and Owens, Alec and Peng, Zhijian and Perri, Armando N. and Pezzella, Marco and Polyansky, Oleg L. and Qu, Qianwei and Semenov, Mikhail and Smola, Oleksiy and Solokov, Andrei and Somogyi, Wilfrid and Upadhyay, Apoorva and Wright, Samuel O.M. and Zobov, Nikolai F.}, + title = {{The 2024 release of the ExoMol database: Molecular line lists for exoplanet and other hot atmospheres}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {326}, + pages = {109083}, + year = {2024}, + doi = {10.1016/j.jqsrt.2024.109083} +} + +@article{Tennyson2016, + author = {Tennyson, Jonathan and Yurchenko, Sergei N. and Al-Refaie, Ahmed F. and Barton, Emma J. and Chubb, Katy L. and Coles, Phillip A. and Diamantopoulou, S. and Gorman, Maire N. and Hill, Christian and Lam, Aden Z. and Lodi, Lorenzo and McKemmish, Laura K. and Na, Yueqi and Owens, Alec and Polyansky, Oleg L. and Rivlin, Tom and Sousa-Silva, Clara and Underwood, Daniel S. and Yachmenev, Andrey and Zak, Emil}, + title = {{The ExoMol database: Molecular line lists for exoplanet and other hot atmospheres}}, + journal = {Journal of Molecular Spectroscopy}, + volume = {327}, + pages = {73--94}, + year = {2016}, + doi = {10.1016/j.jms.2016.05.002} +} + +@article{Corey2026, + author = {Corey, Terrance G Y and Zhang, Jingxin and Hill, Christian and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{A formal update of the ExoMol Database Collection}}, + journal = {RAS Techniques and Instruments}, + pages = {rzag081}, + year = {2026}, + doi = {10.1093/rasti/rzag081} +} + +@article{Yurchenko2018, + author = {Yurchenko, Sergei N. and Al-Refaie, Ahmed F. and Tennyson, Jonathan}, + title = {{EXOCROSS: a general program for generating spectra from molecular line lists}}, + journal = {Astronomy \& Astrophysics}, + volume = {614}, + pages = {A131}, + year = {2018}, + doi = {10.1051/0004-6361/201732531} +} + +@article{Zhang2024, + author = {Zhang, Jingxin and Tennyson, Jonathan and Yurchenko, Sergei N}, + title = {{PyExoCross: a Python program for generating spectra and cross-sections from molecular line lists}}, + journal = {RAS Techniques and Instruments}, + volume = {3}, + number = {1}, + pages = {257--287}, + year = {2024}, + doi = {10.1093/rasti/rzae016} +} + +@article{Ni2026, + author = {Ni, Qing-He and Wang, Rujia and Xie, Tianyang and Zhang, Jingxin and Hill, Christian and Yurchenko, Sergei N and Tennyson, Jonathan}, + title = {{ExoAtom: a database of atomic spectra in ExoMol format}}, + journal = {RAS Techniques and Instruments}, + volume = {5}, + pages = {rzaf065}, + year = {2026}, + doi = {10.1093/rasti/rzaf065} +} + +@article{Grimm2015, + author = {Grimm, Simon L. and Heng, Kevin}, + title = {{HELIOS-K: an ultrafast, open-source opacity calculator for radiative transfer}}, + journal = {The Astrophysical Journal}, + volume = {808}, + number = {2}, + pages = {182}, + year = {2015}, + doi = {10.1088/0004-637x/808/2/182} +} + +@article{Grimm2021, + author = {Grimm, Simon L. and Malik, Matej and Kitzmann, Daniel and Guzm{\'a}n-Mesa, Andrea and Hoeijmakers, H. Jens and Fisher, Chloe and Mendon{\c c}a, Jo{\~a}o M. and Yurchenko, Sergey N. and Tennyson, Jonathan and Alesina, Fabien and Buchschacher, Nicolas and Burnier, Julien and Segransan, Damien and Kurucz, Robert L. and Heng, Kevin}, + title = {{HELIOS-K 2.0 Opacity Calculator and Open-source Opacity Database for Exoplanetary Atmospheres}}, + journal = {The Astrophysical Journal Supplement Series}, + volume = {253}, + number = {1}, + pages = {30}, + year = {2021}, + doi = {10.3847/1538-4365/abd773} +} + +@misc{HELIOSK, + title = {{HELIOS-K}}, + howpublished = {\url{https://github.com/exoclime/HELIOS-K}}, + note = {Opacity calculator used for the DACE opacity database; repository listed under References on https://dace.unige.ch/opacityDatabase/} +} + +@article{Rothman2010, + author = {Rothman, L.S. and Gordon, I.E. and Barber, R.J. and Dothe, H. and Gamache, R.R. and Goldman, A. and Perevalov, V.I. and Tashkun, S.A. and Tennyson, J.}, + title = {{HITEMP, the high-temperature molecular spectroscopic database}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {111}, + number = {15}, + pages = {2139--2150}, + year = {2010}, + doi = {10.1016/j.jqsrt.2010.05.001} +} + +% ===== HITRAN CIA overview papers ===== + +@article{Terragni2025b, + author = {Terragni, J. and Gordon, I.E. and Adkins, E.M. and Boulet, C. and Campargue, A. and Chistikov, D. and Finenko, A. and Finkenzeller, H. and Fleurbaey, H. and Hargreaves, R.J. and Hanson, R.K. and Hartmann, J.-M. and Klingberg, A. and Kohler, E. and Koroleva, A.O. and Mondelain, D. and Piccioni, G. and Stefani, S. and Strand, C.L. and Tran, H. and Turbet, M. and Vigasin, A. and Vitali, F. and Volkamer, R. and Wei, C.}, + title = {{Collision induced absorption in HITRAN2024: Enhanced and improved data for atmospheric and planetary studies}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {347}, + pages = {109631}, + year = {2025}, + doi = {10.1016/j.jqsrt.2025.109631} +} + +@article{Karman2019, + author = {Karman, Tijs and Gordon, Iouli E. and van der Avoird, Ad and Baranov, Yury I. and Boulet, Christian and Drouin, Brian J. and Groenenboom, Gerrit C. and Gustafsson, Magnus and Hartmann, Jean-Michel and Kurucz, Robert L. and Rothman, Laurence S. and Sun, Kang and Sung, Keeyoon and Thalman, Ryan and Tran, Ha and Wishnow, Edward H. and Wordsworth, Robin and Vigasin, Andrey A. and Volkamer, Rainer and van der Zande, Wim J.}, + title = {{Update of the HITRAN collision-induced absorption section}}, + journal = {Icarus}, + volume = {328}, + pages = {160--175}, + year = {2019}, + doi = {10.1016/j.icarus.2019.02.034} +} + +@article{Richard2012, + author = {Richard, C. and Gordon, I.E. and Rothman, L.S. and Abel, M. and Frommhold, L. and Gustafsson, M. and Hartmann, J.-M. and Hermans, C. and Lafferty, W.J. and Orton, G.S. and Smith, K.M. and Tran, H.}, + title = {{New section of the HITRAN database: Collision-induced absorption (CIA)}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {113}, + number = {11}, + pages = {1276--1285}, + year = {2012}, + doi = {10.1016/j.jqsrt.2011.11.004} +} + +% ===== HITRAN CIA original sources (Table 2; reference index in the HITRAN CIA references PDF) ===== + +@article{Abel2011, + author = {Abel, Martin and Frommhold, Lothar and Li, Xiaoping and Hunt, Katharine L. C.}, + title = {{Collision-Induced Absorption by H$_{2}$ Pairs: From Hundreds to Thousands of Kelvin}}, + journal = {The Journal of Physical Chemistry A}, + volume = {115}, + number = {25}, + pages = {6805--6812}, + year = {2011}, + doi = {10.1021/jp109441f} +} + +@article{Abel2012, + author = {Abel, Martin and Frommhold, Lothar and Li, Xiaoping and Hunt, Katharine L. C.}, + title = {{Infrared absorption by collisional H2--He complexes at temperatures up to 9000 K and frequencies from 0 to 20 000 cm$^{-1}$}}, + journal = {The Journal of Chemical Physics}, + volume = {136}, + number = {4}, + pages = {044319}, + year = {2012}, + doi = {10.1063/1.3676405} +} + +@article{Adkins2023, + author = {Adkins, Erin M. and Karman, Tijs and Campargue, Alain and Mondelain, Didier and Hodges, Joseph T.}, + title = {{Parameterized model to approximate theoretical collision-induced absorption band shapes for O2-O2 and O2-N2}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {310}, + pages = {108732}, + year = {2023}, + doi = {10.1016/j.jqsrt.2023.108732} +} + +@article{Banerjee2019, + author = {Banerjee, Agniva and Mandon, Julien and Harren, Frans and Parker, David H.}, + title = {{Collision-induced absorption between O$_2$--CO$_2$ for the a$^1\Delta_g$ ($v$ = 1) $\leftarrow$ X$^3\Sigma^-_g$ ($v$ = 0) transition of molecular oxygen at 1060 nm}}, + journal = {Physical Chemistry Chemical Physics}, + volume = {21}, + number = {4}, + pages = {1805--1811}, + year = {2019}, + doi = {10.1039/c8cp06778c} +} + +@incollection{Baranov2003, + author = {Baranov, Y. I. and Fraser, Gerald T. and Lafferty, W. J. and Vigasin, A. A.}, + title = {{Collision-Induced Absorption in The CO2 Fermi Triad for Temperatures from 211K to 296 K}}, + booktitle = {Weakly Interacting Molecular Pairs: Unconventional Absorbers of Radiation in the Atmosphere}, + editor = {Camy-Peyret, C. and Vigasin, A. A.}, + publisher = {Springer Netherlands}, + pages = {149--158}, + year = {2003}, + doi = {10.1007/978-94-010-0025-3_12} +} + +@article{Baranov2004, + author = {Baranov, Yuri I. and Lafferty, W.J. and Fraser, G.T.}, + title = {{Infrared spectrum of the continuum and dimer absorption in the vicinity of the O2 vibrational fundamental in O2/CO2 mixtures}}, + journal = {Journal of Molecular Spectroscopy}, + volume = {228}, + number = {2}, + pages = {432--440}, + year = {2004}, + doi = {10.1016/j.jms.2004.04.010} +} + +@article{Baranov2005, + author = {Baranov, Yu.I. and Lafferty, W.J. and Fraser, G.T.}, + title = {{Investigation of collision-induced absorption in the vibrational fundamental bands of O2 and N2 at elevated temperatures}}, + journal = {Journal of Molecular Spectroscopy}, + volume = {233}, + number = {1}, + pages = {160--163}, + year = {2005}, + doi = {10.1016/j.jms.2005.06.008} +} + +@article{Baranov2018, + author = {Baranov, Yu. I.}, + title = {{Collision-induced absorption in the region of the $\nu_2 + \nu_3$ band of carbon dioxide}}, + journal = {Journal of Molecular Spectroscopy}, + volume = {345}, + pages = {11--16}, + year = {2018}, + doi = {10.1016/j.jms.2017.11.005} +} + +@article{BarZiv1972, + author = {Bar-Ziv, Ezra and Weiss, Shmuel}, + title = {{Translational Spectra Due to Collision-Induced Overlap Moments in Mixtures of He with CO2, N2, CH4, and C2H6}}, + journal = {The Journal of Chemical Physics}, + volume = {57}, + number = {1}, + pages = {34--37}, + year = {1972}, + doi = {10.1063/1.1677970} +} + +@article{Borysow1986a, + author = {Borysow, A. and Frommhold, L.}, + title = {{Theoretical collision-induced rototranslational absorption spectra for modeling Titan's atmosphere - H2-N2 pairs}}, + journal = {The Astrophysical Journal}, + volume = {303}, + pages = {495}, + year = {1986}, + doi = {10.1086/164096} +} + +@article{Borysow1986b, + author = {Borysow, A. and Frommhold, L.}, + title = {{Theoretical collision-induced rototranslational absorption spectra for the outer planets - H2-CH4 pairs}}, + journal = {The Astrophysical Journal}, + volume = {304}, + pages = {849}, + year = {1986}, + doi = {10.1086/164221} +} + +@article{Borysow1987, + author = {Borysow, Aleksandra and Frommhold, Lothar}, + title = {{Collision-induced rototranslational absorption spectra of CH4-CH4 pairs at temperatures from 50 to 300 K}}, + journal = {The Astrophysical Journal}, + volume = {318}, + pages = {940}, + year = {1987}, + doi = {10.1086/165426} +} + +@article{Chistikov2019, + author = {Chistikov, Daniil N. and Finenko, Artem A. and Lokshtanov, Sergei E. and Petrov, Sergey V. and Vigasin, Andrey A.}, + title = {{Simulation of collision-induced absorption spectra based on classical trajectories and ab initio potential and induced dipole surfaces. I. Case study of N2--N2 rototranslational band}}, + journal = {The Journal of Chemical Physics}, + volume = {151}, + number = {19}, + pages = {194106}, + year = {2019}, + doi = {10.1063/1.5125756} +} + +@article{Fakhardji2022, + author = {Fakhardji, Wissam and Boulet, Christian and Tran, Ha and Hartmann, Jean-Michel}, + title = {{Direct calculations of the CH4+CO2 far infrared collision-induced absorption}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {283}, + pages = {108148}, + year = {2022}, + doi = {10.1016/j.jqsrt.2022.108148} +} + +@article{Finenko2022, + author = {Finenko, Artem A. and B{\'e}zard, Bruno and Gordon, Iouli E. and Chistikov, Daniil N. and Lokshtanov, Sergei E. and Petrov, Sergey V. and Vigasin, Andrey A.}, + title = {{Trajectory-based Simulation of Far-infrared Collision-induced Absorption Profiles of CH$_{4}$--N$_{2}$ for Modeling Titan's Atmosphere}}, + journal = {The Astrophysical Journal Supplement Series}, + volume = {258}, + number = {2}, + pages = {33}, + year = {2022}, + doi = {10.3847/1538-4365/ac36d3} +} + +@article{Finkenzeller2022, + author = {Finkenzeller, Henning and Volkamer, Rainer}, + title = {{O2--O2 CIA in the gas phase: Cross-section of weak bands, and continuum absorption between 297--500 nm}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {279}, + pages = {108063}, + year = {2022}, + doi = {10.1016/j.jqsrt.2021.108063} +} + +@article{Fleurbaey2022, + author = {Fleurbaey, H. and Mondelain, D. and Fakhardji, W. and Hartmann, J.M. and Campargue, A.}, + title = {{Simultaneous collision-induced transitions in H2O+CO2 gas mixtures}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {285}, + pages = {108162}, + year = {2022}, + doi = {10.1016/j.jqsrt.2022.108162} +} + +@article{Gruszka1997, + author = {Gruszka, Marcin and Borysow, Aleksandra}, + title = {{Roto-translational collision-induced absorption of CO$_2$ for the atmosphere of Venus at frequencies from 0 to 250 cm$^{-1}$, at temperatures from 200 to 800 K}}, + journal = {Icarus}, + volume = {129}, + number = {1}, + pages = {172--177}, + year = {1997}, + doi = {10.1006/icar.1997.5773} +} + +@article{Gustafsson2001, + author = {Gustafsson, Magnus and Frommhold, Lothar}, + title = {{Infrared Absorption Spectra of Collisionally Interacting He and H Atoms}}, + journal = {The Astrophysical Journal}, + volume = {546}, + number = {2}, + pages = {1168--1170}, + year = {2001}, + doi = {10.1086/318311} +} + +@article{Gustafsson2003, + author = {Gustafsson, M. and Frommhold, L.}, + title = {{The H$_{2}$--H infrared absorption bands at temperatures from 1000 K to 2500 K}}, + journal = {Astronomy \& Astrophysics}, + volume = {400}, + number = {3}, + pages = {1161--1162}, + year = {2003}, + doi = {10.1051/0004-6361:20030100} +} + +@article{Hartmann2017, + author = {Hartmann, J.-M. and Boulet, C. and Toon, G. C.}, + title = {{Collision-induced absorption by N$_{2}$ near 2.16 $\mu$m: Calculations, model, and consequences for atmospheric remote sensing}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {122}, + number = {4}, + pages = {2419--2428}, + year = {2017}, + doi = {10.1002/2016jd025677} +} + +@article{Hartmann2018, + author = {Hartmann, Jean-Michel and Boulet, Christian and Tran, Duc Dung and Tran, Ha and Baranov, Yury}, + title = {{Effect of humidity on the absorption continua of CO2 and N2 near 4 $\mu$m: Calculations, comparisons with measurements, and consequences for atmospheric spectra}}, + journal = {The Journal of Chemical Physics}, + volume = {148}, + number = {5}, + pages = {054304}, + year = {2018}, + doi = {10.1063/1.5019994} +} + +@article{Karman2018, + author = {Karman, Tijs and Koenis, Mark A. J. and Banerjee, Agniva and Parker, David H. and Gordon, Iouli E. and van der Avoird, Ad and van der Zande, Wim J. and Groenenboom, Gerrit C.}, + title = {{O$_2$--O$_2$ and O$_2$--N$_2$ collision-induced absorption mechanisms unravelled}}, + journal = {Nature Chemistry}, + volume = {10}, + number = {5}, + pages = {549--554}, + year = {2018}, + doi = {10.1038/s41557-018-0015-x} +} + +@article{Kassi2021, + author = {Kassi, S. and Guessoum, S. and Abanto, J. C. Acosta and Tran, H. and Campargue, A. and Mondelain, D.}, + title = {{Temperature Dependence of the Collision-Induced Absorption Band of O$_{2}$ Near 1.27 $\mu$m}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {126}, + number = {13}, + pages = {e2021JD034860}, + year = {2021}, + doi = {10.1029/2021jd034860} +} + +@article{Lafferty1996, + author = {Lafferty, Walter J. and Solodov, Alexander M. and Weber, Alfons and Olson, Wm. Bruce and Hartmann, Jean-Michel}, + title = {{Infrared collision-induced absorption by N$_2$ near 4.3 $\mu$m for atmospheric applications: measurements and empirical modeling}}, + journal = {Applied Optics}, + volume = {35}, + number = {30}, + pages = {5911}, + year = {1996}, + doi = {10.1364/ao.35.005911} +} + +@article{Menoux1993, + author = {Menoux, V. and Le Doucen, R. and Boulet, C. and Roblin, A. and Bouchardy, A. M.}, + title = {{Collision-induced absorption in the fundamental band of N$_2$: temperature dependence of the absorption for N$_2$--N$_2$ and N$_2$--O$_2$ pairs}}, + journal = {Applied Optics}, + volume = {32}, + number = {3}, + pages = {263}, + year = {1993}, + doi = {10.1364/ao.32.000263} +} + +@article{Mondelain2019, + author = {Mondelain, D. and Kassi, S. and Campargue, A.}, + title = {{Accurate Laboratory Measurement of the O$_{2}$ Collision-Induced Absorption Band Near 1.27 $\mu$m}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {124}, + number = {1}, + pages = {414--423}, + year = {2019}, + doi = {10.1029/2018jd029317} +} + +@article{Odintsova2021, + author = {Odintsova, T.A. and Serov, E.A. and Balashov, A.A. and Koshelev, M.A. and Koroleva, A.O. and Simonova, A.A. and Tretyakov, M.Yu. and Filippov, N.N. and Chistikov, D.N. and Finenko, A.A. and Lokshtanov, S.E. and Petrov, S.V. and Vigasin, A.A.}, + title = {{CO$_2$--CO$_2$ and CO$_2$--Ar continua at millimeter wavelengths}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {258}, + pages = {107400}, + year = {2021}, + doi = {10.1016/j.jqsrt.2020.107400} +} + +@article{Orlando1991, + author = {Orlando, John J. and Tyndall, Geoffrey S. and Nickerson, Karen E. and Calvert, Jack G.}, + title = {{The temperature dependence of collision-induced absorption by oxygen near 6 $\mu$m}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {96}, + number = {D11}, + pages = {20755--20760}, + year = {1991}, + doi = {10.1029/91jd02042} +} + +@article{Samuelson1997, + author = {Samuelson, Robert E. and Nath, Nitya R. and Borysow, Aleksandra}, + title = {{Gaseous abundances and methane supersaturation in Titan's troposphere}}, + journal = {Planetary and Space Science}, + volume = {45}, + number = {8}, + pages = {959--980}, + year = {1997}, + doi = {10.1016/s0032-0633(97)00090-1} +} + +@article{Serov2024, + author = {Serov, E.A. and Galanina, T.A. and Koroleva, A.O. and Makarov, D.S. and Amerkhanov, I.S. and Koshelev, M.A. and Tretyakov, M.Yu. and Chistikov, D.N. and Finenko, A.A. and Vigasin, A.A.}, + title = {{Continuum absorption in pure N$_2$ gas and in its mixture with Ar}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {328}, + pages = {109172}, + year = {2024}, + doi = {10.1016/j.jqsrt.2024.109172} +} + +@article{Spiering2011, + author = {Spiering, Frans R. and Kiseleva, Maria B. and Filippov, Nikolay N. and van Kesteren, Line and van der Zande, Wim J.}, + title = {{Collision-induced absorption in the O2 B-band region near 670 nm}}, + journal = {Physical Chemistry Chemical Physics}, + volume = {13}, + number = {20}, + pages = {9616}, + year = {2011}, + doi = {10.1039/c1cp20403c} +} + +@article{Spiering2012, + author = {Spiering, Frans R. and van der Zande, Wim J.}, + title = {{Collision induced absorption in the a$^1\Delta$($v$ = 2) $\leftarrow$ X$^3\Sigma^-_g$($v$ = 0) band of molecular oxygen}}, + journal = {Physical Chemistry Chemical Physics}, + volume = {14}, + number = {28}, + pages = {9923}, + year = {2012}, + doi = {10.1039/c2cp40961e} +} + +@article{Taylor1988, + author = {Taylor, Roger H. and Borysow, Aleksandra and Frommhold, Lothar}, + title = {{Concerning the rototranslational absorption spectra of He CH4 pairs}}, + journal = {Journal of Molecular Spectroscopy}, + volume = {129}, + number = {1}, + pages = {45--58}, + year = {1988}, + doi = {10.1016/0022-2852(88)90257-3} +} + +@article{Terragni2025a, + author = {Terragni, Jacopo and Kohler, Erika and Kofman, Vincent and Anderson, Seamus and Villanueva, Geronimo L. and Faggi, Sara}, + title = {{New measurements of high-temperature CO2--CO2 collision-induced absorption in the 1100--1800 cm$^{-1}$ range}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {346}, + pages = {109595}, + year = {2025}, + doi = {10.1016/j.jqsrt.2025.109595} +} + +@article{Thalman2013, + author = {Thalman, Ryan and Volkamer, Rainer}, + title = {{Temperature dependent absorption cross-sections of O2--O2 collision pairs between 340 and 630 nm and at atmospherically relevant pressure}}, + journal = {Physical Chemistry Chemical Physics}, + volume = {15}, + number = {37}, + pages = {15371}, + year = {2013}, + doi = {10.1039/c3cp50968k} +} + +@article{Thibault1997, + author = {Thibault, F. and Menoux, V. and Le Doucen, R. and Rosenmann, L. and Hartmann, J.-M. and Boulet, Ch.}, + title = {{Infrared collision-induced absorption by O$_2$ near 6.4 $\mu$m for atmospheric applications: measurements and empirical modeling}}, + journal = {Applied Optics}, + volume = {36}, + number = {3}, + pages = {563}, + year = {1997}, + doi = {10.1364/ao.36.000563} +} + +@article{Tran2006, + author = {Tran, H. and Boulet, C. and Hartmann, J.-M.}, + title = {{Line mixing and collision-induced absorption by oxygen in the A band: Laboratory measurements, model, and tools for atmospheric spectra computations}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {111}, + number = {D15}, + pages = {2005JD006869}, + year = {2006}, + doi = {10.1029/2005jd006869} +} + +@article{Tran2024, + author = {Tran, H. and Hartmann, J.M. and Rambinison, E. and Turbet, M.}, + title = {{Collision-induced absorptions by pure CO2 in the infrared: New measurements in the 1150--4500 cm$^{-1}$ spectral range and empirical modeling for applications}}, + journal = {Icarus}, + volume = {422}, + pages = {116265}, + year = {2024}, + doi = {10.1016/j.icarus.2024.116265} +} + +@article{Turbet2020, + author = {Turbet, Martin and Boulet, Christian and Karman, Tijs}, + title = {{Measurements and semi-empirical calculations of CO2 + CH4 and CO2 + H2 collision-induced absorption across a wide range of wavelengths and temperatures. Application for the prediction of early Mars surface temperature}}, + journal = {Icarus}, + volume = {346}, + pages = {113762}, + year = {2020}, + doi = {10.1016/j.icarus.2020.113762} +} + +@article{Vangvichith2009, + author = {Vangvichith, M. and Tran, H. and Hartmann, J.-M.}, + title = {{Line-mixing and collision induced absorption for O2--CO2 mixtures in the oxygen A-band region}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {110}, + number = {18}, + pages = {2212--2216}, + year = {2009}, + doi = {10.1016/j.jqsrt.2009.06.002} +} + +@article{Wei2024, + author = {Wei, Chuyu and Klingberg, Andrew and Strand, Christopher L. and Hanson, Ronald K.}, + title = {{Measurement of hydrogen and nitrogen via collision-induced infrared absorption}}, + journal = {International Journal of Hydrogen Energy}, + volume = {93}, + pages = {364--373}, + year = {2024}, + doi = {10.1016/j.ijhydene.2024.10.318} +} + +% ===== MT_CKD water vapour self-continuum ===== + +@article{Mlawer2012, + author = {Mlawer, Eli J. and Payne, Vivienne H. and Moncet, Jean-Luc and Delamere, Jennifer S. and Alvarado, Matthew J. and Tobin, David C.}, + title = {{Development and recent evaluation of the MT\_CKD model of continuum absorption}}, + journal = {Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences}, + volume = {370}, + number = {1968}, + pages = {2520--2556}, + year = {2012}, + doi = {10.1098/rsta.2011.0295} +} + +@article{Mlawer2023, + author = {Mlawer, E.J. and Cady-Pereira, K.E. and Mascio, J. and Gordon, I.E.}, + title = {{The inclusion of the MT\_CKD water vapor continuum model in the HITRAN molecular spectroscopic database}}, + journal = {Journal of Quantitative Spectroscopy and Radiative Transfer}, + volume = {306}, + pages = {108645}, + year = {2023}, + doi = {10.1016/j.jqsrt.2023.108645} +} + +@article{Mlawer2019, + author = {Mlawer, E. J. and Turner, D. D. and Paine, S. N. and Palchetti, L. and Bianchini, G. and Payne, V. H. and Cady-Pereira, K. E. and Pernak, R. L. and Alvarado, M. J. and Gombos, D. and Delamere, J. S. and Mlynczak, M. G. and Mast, J. C.}, + title = {{Analysis of Water Vapor Absorption in the Far-Infrared and Submillimeter Regions Using Surface Radiometric Measurements From Extremely Dry Locations}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {124}, + number = {14}, + pages = {8134--8160}, + year = {2019}, + doi = {10.1029/2018jd029508} +} + +@article{Delamere2010, + author = {Delamere, J. S. and Clough, S. A. and Payne, V. H. and Mlawer, E. J. and Turner, D. D. and Gamache, R. R.}, + title = {{A far-infrared radiative closure study in the Arctic: Application to water vapor}}, + journal = {Journal of Geophysical Research: Atmospheres}, + volume = {115}, + number = {D17}, + pages = {D17106}, + year = {2010}, + doi = {10.1029/2009jd012968} +} + +@article{Payne2011, + author = {Payne, Vivienne H. and Mlawer, Eli J. and Cady-Pereira, Karen E. and Moncet, Jean-Luc}, + title = {{Water Vapor Continuum Absorption in the Microwave}}, + journal = {IEEE Transactions on Geoscience and Remote Sensing}, + volume = {49}, + number = {6}, + pages = {2194--2208}, + year = {2011}, + doi = {10.1109/tgrs.2010.2091416} +} + +@misc{Mlawer2003, + author = {Mlawer, E. J. and Clough, S. A. and Cady-Pereira, K. E.}, + title = {{MT\_CKD\_H2O: Mlawer-Tobin-Clough-Kneizys-Davies Water Vapor Continuum Model}}, + howpublished = {Software, Atmospheric and Environmental Research (AER), Radiation and Climate Group. \url{https://github.com/AER-RC/MT_CKD_H2O}}, + year = {2003}, + note = {Version 4.3 (release tag 4.3, 2024-04-17). Software reference as given on the AER MT\_CKD\_H2O wiki page References-and-Publications} +} diff --git a/docs/Reference/spectral_file_validation.md b/docs/Reference/spectral_file_validation.md new file mode 100644 index 00000000..8cbbad30 --- /dev/null +++ b/docs/Reference/spectral_file_validation.md @@ -0,0 +1,105 @@ +# Validation of spectral files + +This page tests the Generation III [PROTEUS spectral files](proteus_spectral_file_reference.md) in three ways: whether they reproduce the radiation limit of a runaway greenhouse atmosphere, how much the outgoing longwave radiation (OLR) changes with the number of bands, and how they compare with a line-by-line calculation. It covers Snowline, Breezehome and Volenfell. + +The calculations were made with [AGNI](https://www.h-nicholls.space/AGNI/) version 1.14.0, which calls SOCRATES for the radiative transfer. They use the two-stream solver with equivalent extinction for overlapping gases, include continuum absorption, and leave out Rayleigh scattering, clouds and stellar radiation. The temperature profiles are prescribed rather than solved for, as described in each section. The scripts that make these calculations and figures are in [`misc/validation/spectral_files`](https://github.com/nichollsh/AGNI/tree/main/misc/validation/spectral_files) in the AGNI repository. + +--- + +## Runaway greenhouse + +A pure-steam atmosphere above a water ocean has an upper limit on its OLR ([Komabayasi 1967](https://doi.org/10.2151/jmsj1965.45.1_137); [Ingersoll 1969](https://doi.org/10.1175/1520-0469%281969%29026%3C1191:TRGAHO%3E2.0.CO;2)). As the surface warms, the atmosphere becomes optically thick, and its emission comes from the upper part of the atmosphere, where the temperature follows the saturation curve of H2O. The OLR then stays almost constant as the surface warms further: this is the radiation limit of the runaway greenhouse ([Kasting 1988](https://doi.org/10.1016/0019-1035%2888%2990116-9); [Nakajima et al. 1992](https://doi.org/10.1175/1520-0469%281992%29049%3C2256:ASOTGE%3E2.0.CO;2)). Once the surface is hot enough (above about 1700 K in these calculations), the hot lower atmosphere emits at shorter wavelengths, where H2O absorbs less, and the OLR rises again (e.g. [Goldblatt et al. 2013](https://doi.org/10.1038/ngeo1892); [Hamano et al. 2015](https://doi.org/10.1088/0004-637X/806/2/216)). + +**Set-up.** The atmosphere is pure H2O with an inventory of 270 bar. Below the critical temperature, the surface pressure is the saturation vapour pressure if that is smaller than 270 bar, with the rest of the water taken to be in the ocean. The temperature follows a dry adiabat from the surface, replaced by the saturation curve wherever the adiabat would be supersaturated, up to 10−5 bar on 100 levels. The gas is ideal with constant heat capacity, and the gravity is 9.81 m s−2. The surface temperature runs from 200 K to 2500 K in steps of 25 K. The set-up follows the [canonical runaway notebook](https://github.com/nichollsh/AGNI/blob/main/docs/notebooks/01_canonical-runaway.ipynb) in AGNI. + +

+ ![OLR of a pure-steam atmosphere against surface temperature, for Snowline at five band counts and four published models](../assets/validation/runaway_light.png#only-light) + ![OLR of a pure-steam atmosphere against surface temperature, for Snowline at five band counts and four published models](../assets/validation/runaway_dark.png#only-dark) +
OLR of a pure-steam atmosphere against surface temperature. Left: the runaway limit, on a linear scale. Right: the full range, on a logarithmic scale. The published curves were digitised from figures in those papers (see below).
+
+ +OLR in W m−2 at selected surface temperatures: + +| Source | 400 K | 1000 K | 1500 K | 2000 K | 2200 K | +|--------|-------|--------|--------|--------|--------| +| Snowline, 32 bands | 294 | 292 | 292 | 419 | 891 | +| Snowline, 64 bands | 295 | 293 | 293 | 342 | 558 | +| Snowline, 128 bands | 295 | 293 | 293 | 406 | 822 | +| Snowline, 256 bands | 295 | 294 | 294 | 448 | 990 | +| Snowline, 2048 bands | 295 | 294 | 294 | 500 | 1190 | +| [Goldblatt et al. (2013)](https://doi.org/10.1038/ngeo1892) | 283 | 281 | 280 | | | +| [Kopparapu et al. (2013)](https://doi.org/10.1088/0004-637X/765/2/131) | 290 | 294 | 294 | 306 | | +| [Hamano et al. (2015)](https://doi.org/10.1088/0004-637X/806/2/216) | | | 279 | 303 | 417 | +| [Selsis et al. (2023)](https://doi.org/10.1038/s41586-023-06258-3) | | 276 | 274 | 336 | 604 | + +- Snowline gives a runaway limit of 292–296 W m−2 for surface temperatures between 300 K and 1500 K, at every band count. Breezehome has the same bands and H2O data as Snowline, and gives the same OLR. +- This agrees with Kopparapu et al. (2013) to within 2 %, and is 4–7 % higher than Goldblatt et al. (2013), Hamano et al. (2015) and Selsis et al. (2023). These models differ from each other and from this set-up in their opacity data and assumptions, so exact agreement is not expected. +- Above about 1700 K the OLR depends strongly on the number of bands, and does not change monotonically with it. At 2200 K it ranges from 558 W m−2 with 64 bands to 1190 W m−2 with 2048 bands. At this temperature every band count except 64 gives a higher OLR than Hamano et al. (2015) and Selsis et al. (2023). + +The Goldblatt et al. (2013), Kopparapu et al. (2013) and Hamano et al. (2015) curves were digitised from Fig. 12a of Hamano et al. (2015), and the Selsis et al. (2023) curve from their Fig. 2 (convective profiles). The data are in [`res/literature_data/runaway`](https://github.com/nichollsh/AGNI/tree/main/res/literature_data/runaway) in the AGNI repository. + +--- + +## Number of bands + +Each Generation III family is available with 32, 64, 128, 256 and 2048 bands. Here the OLR from the files with fewer bands is compared with the 2048-band file of the same family, which resolves the spectrum most finely. No line-by-line calculation was made, so this shows how consistent the band counts are with each other, not how accurate the 2048-band files are. + +**Set-up.** The temperature follows a dry adiabat from the surface up to an isothermal stratosphere at one third of the surface temperature (one half for Volenfell), up to 10−5 bar on 40 levels. The composition is fixed and the same at all heights. The compositions are illustrative, not the result of a chemistry calculation: + +| Family | Composition (mole fractions) | Surface pressures | Surface temperatures | +|--------|------------------------------|-------------------|----------------------| +| Snowline | H2O | 1 and 100 bar | 700, 1500 and 2500 K | +| Breezehome | H2O 0.5, CO2 0.3, CO 0.05, O2 0.05, SO2 0.05, OCS 0.03, S2 0.02 | 1 and 100 bar | 700, 1500 and 2500 K | +| Volenfell | O2 0.30, Na 0.30, SiO 0.20, Fe 0.10, MgO 0.05, K 0.03, CO 0.0195, TiO 0.0005 | 0.1 and 10 bar | 2000, 3000 and 4000 K | + +
+ ![Difference in OLR from the 2048-band file against the number of bands, for Snowline, Breezehome and Volenfell](../assets/validation/bands_light.png#only-light) + ![Difference in OLR from the 2048-band file against the number of bands, for Snowline, Breezehome and Volenfell](../assets/validation/bands_dark.png#only-dark) +
Difference in OLR from the 2048-band file of the same family, against the number of bands. Top: the lower surface pressure. Bottom: the higher surface pressure.
+
+ +- At 100 bar with surface temperatures of 700 K and 1500 K, every band count agrees with the 2048-band file to within 0.6 %. These atmospheres are optically thick, and the OLR is set by the isothermal stratosphere. +- In the other cases, the files with fewer bands differ more. With 32 bands, the OLR is 40 % higher for Breezehome at 1 bar and 700 K, and 15 % lower for Volenfell at 0.1 bar and 2000 K. +- With 256 bands, the OLR is within 5 % of the 2048-band file for Snowline, within 6 % for Breezehome and within 8 % for Volenfell, in every case. +- The differences do not always shrink as the number of bands grows. At 100 bar and 2500 K, the 64-band files of Snowline and Breezehome differ more (−13 % and −14 %) than the 32-band files (−5 % and −11 %). + +
+ ![Outgoing flux against wavelength for Breezehome with 32, 256 and 2048 bands](../assets/validation/spectrum_light.png#only-light) + ![Outgoing flux against wavelength for Breezehome with 32, 256 and 2048 bands](../assets/validation/spectrum_dark.png#only-dark) +
Outgoing flux in each band for Breezehome with 32, 256 and 2048 bands, for the seven-gas composition at 1 bar and a surface temperature of 1500 K. The OLR is 16.6 % higher with 32 bands and 5.2 % higher with 256 bands than with 2048 bands.
+
+ +--- + +## Line-by-line comparison + +AGNI can also calculate the outgoing flux line by line with the [Reference Forward Model](https://eodg.atm.ox.ac.uk/RFM/) (RFM; [Dudhia 2017](https://doi.org/10.1016/j.jqsrt.2016.06.018)). Here the RFM is run on the same atmosphere as Breezehome, using the HITRAN lines of H2O and CO2 between 4000 and 5000 cm−1 (2.0–2.5 µm) that AGNI downloads with `get_data.sh parfiles` ([Zenodo record](https://zenodo.org/records/15806626)). + +**Set-up.** The atmosphere is 70 % H2O and 30 % CO2 at 1 bar, with a surface temperature of 700 K, and the same type of profile as in [Number of bands](#number-of-bands). Continua are left out of both calculations, so only line absorption is compared. The RFM radiance is calculated every 0.002 cm−1 at a secant of 1.66 and multiplied by π to give a flux; 1.66 is the diffusivity factor of the two-stream scheme that AGNI uses in the longwave. The RFM needs line data a little beyond each end of the range it calculates, so it covers 4026–4973 cm−1, and only the bands that lie within this range are compared. None of the 32-band file's bands do. + +The two calculations do not use the same line data: Breezehome uses the ExoMol POKAZATEL (H2O) and Dozen (CO2) line lists, computed with PyExoCross, while the RFM uses HITRAN with its own line shapes and cut-off. The comparison therefore tests the line data and the k-term fits together. + +
+ ![Outgoing flux between 4000 and 5000 cm⁻¹ from the RFM and from Breezehome, with the difference in each band](../assets/validation/lbl_light.png#only-light) + ![Outgoing flux between 4000 and 5000 cm⁻¹ from the RFM and from Breezehome, with the difference in each band](../assets/validation/lbl_dark.png#only-dark) +
Top: outgoing flux from the RFM and from Breezehome with 256 and 2048 bands. Bottom: difference of each Breezehome band from the RFM flux integrated over the same band.
+
+ +- Over the 71 bands of the 2048-band file that lie in this range, Breezehome gives 5.5 % more outgoing flux than the RFM (11.66 against 11.05 W m−2). With 256 bands (8 bands in the range) it gives 3.1 % more. +- Between 4300 and 4700 cm−1, which carries 89 % of the flux, the 2048-band file agrees with the RFM to within −13 % to +25 % in each band. Larger differences occur at both ends, where the band-mean flux falls to 1/330 (below 4300 cm−1) and 1/15 000 (above 4700 cm−1) of its peak: up to +160 % between 4026 and 4300 cm−1, and down to −87 % above 4700 cm−1. These bands carry 8 % and 2 % of the flux. +- The 64- and 128-band files give 38 % and 26 % more flux than the RFM over their bands, in line with the band-count comparison above, where fewer bands give a higher OLR for Breezehome at 1 bar and 700 K. +- The RFM band fluxes change by less than 0.4 % when its step is increased from 0.002 to 0.01 cm−1. + +--- + +## References + +- Dudhia, A. 2017, Journal of Quantitative Spectroscopy and Radiative Transfer 186, 243, [doi:10.1016/j.jqsrt.2016.06.018](https://doi.org/10.1016/j.jqsrt.2016.06.018). +- Goldblatt, C., Robinson, T. D., Zahnle, K. J. & Crisp, D. 2013, Nature Geoscience 6, 661, [doi:10.1038/ngeo1892](https://doi.org/10.1038/ngeo1892). +- Hamano, K., Kawahara, H., Abe, Y., Onishi, M. & Hashimoto, G. L. 2015, ApJ 806, 216, [doi:10.1088/0004-637X/806/2/216](https://doi.org/10.1088/0004-637X/806/2/216). +- Ingersoll, A. P. 1969, Journal of the Atmospheric Sciences 26, 1191, [doi:10.1175/1520-0469(1969)026<1191:TRGAHO>2.0.CO;2](https://doi.org/10.1175/1520-0469%281969%29026%3C1191:TRGAHO%3E2.0.CO;2). +- Kasting, J. F. 1988, Icarus 74, 472, [doi:10.1016/0019-1035(88)90116-9](https://doi.org/10.1016/0019-1035%2888%2990116-9). +- Komabayasi, M. 1967, Journal of the Meteorological Society of Japan 45, 137, [doi:10.2151/jmsj1965.45.1_137](https://doi.org/10.2151/jmsj1965.45.1_137). +- Kopparapu, R. K., et al. 2013, ApJ 765, 131, [doi:10.1088/0004-637X/765/2/131](https://doi.org/10.1088/0004-637X/765/2/131). +- Nakajima, S., Hayashi, Y.-Y. & Abe, Y. 1992, Journal of the Atmospheric Sciences 49, 2256, [doi:10.1175/1520-0469(1992)049<2256:ASOTGE>2.0.CO;2](https://doi.org/10.1175/1520-0469%281992%29049%3C2256:ASOTGE%3E2.0.CO;2). +- Selsis, F., Leconte, J., Turbet, M., Chaverot, G. & Bolmont, É. 2023, Nature 620, 287, [doi:10.1038/s41586-023-06258-3](https://doi.org/10.1038/s41586-023-06258-3). diff --git a/docs/Reference/spectral_files.md b/docs/Reference/spectral_files.md new file mode 100644 index 00000000..fbe2c72c --- /dev/null +++ b/docs/Reference/spectral_files.md @@ -0,0 +1,12 @@ +# Spectral files + +SOCRATES takes all of its spectrally dependent data from a **spectral file** supplied at run time, rather than from the code itself. The spectral file sets the bands and their limits, the gaseous absorbers and their k-terms in each band, continuum absorption, Rayleigh scattering, the data for the thermal source function, and the optical properties of clouds and aerosols. The choice of spectral file therefore fixes the spectral resolution and which absorbers and processes the radiation calculation can include. + +[Spectral files](../Explanations/spectral_files.md) explains what spectral files are and what they contain, and [Building spectral files](../Explanations/spectraltools_pipeline.md) describes how the PROTEUS files are made with [`spectraltools`](https://github.com/FormingWorlds/SOCRATES/tree/main/spectraltools). + +Two sets of spectral files are described in this reference: + +- [PROTEUS spectral files](proteus_spectral_file_reference.md): files made for exoplanet and planetary atmospheres within the PROTEUS framework, identified by a codename and a band count and downloaded from Zenodo. Each one is a pair of files: `.sf` and the k-coefficient lookup tables `.sf_k`. +- [Met Office spectral files](spectral_file_reference.md): the standard files distributed with SOCRATES, developed for Earth atmosphere modelling in the Unified Model. + +[Validation](spectral_file_validation.md) shows how the Generation III PROTEUS files reproduce the runaway greenhouse limit, and how their results change with the number of bands. diff --git a/docs/assets/validation/bands_dark.png b/docs/assets/validation/bands_dark.png new file mode 100644 index 00000000..ede8222b Binary files /dev/null and b/docs/assets/validation/bands_dark.png differ diff --git a/docs/assets/validation/bands_light.png b/docs/assets/validation/bands_light.png new file mode 100644 index 00000000..e9df5608 Binary files /dev/null and b/docs/assets/validation/bands_light.png differ diff --git a/docs/assets/validation/lbl_dark.png b/docs/assets/validation/lbl_dark.png new file mode 100644 index 00000000..2ad0b81a Binary files /dev/null and b/docs/assets/validation/lbl_dark.png differ diff --git a/docs/assets/validation/lbl_light.png b/docs/assets/validation/lbl_light.png new file mode 100644 index 00000000..b443596a Binary files /dev/null and b/docs/assets/validation/lbl_light.png differ diff --git a/docs/assets/validation/runaway_dark.png b/docs/assets/validation/runaway_dark.png new file mode 100644 index 00000000..5356ab2d Binary files /dev/null and b/docs/assets/validation/runaway_dark.png differ diff --git a/docs/assets/validation/runaway_light.png b/docs/assets/validation/runaway_light.png new file mode 100644 index 00000000..b571fd49 Binary files /dev/null and b/docs/assets/validation/runaway_light.png differ diff --git a/docs/assets/validation/spectrum_dark.png b/docs/assets/validation/spectrum_dark.png new file mode 100644 index 00000000..d0de6d67 Binary files /dev/null and b/docs/assets/validation/spectrum_dark.png differ diff --git a/docs/assets/validation/spectrum_light.png b/docs/assets/validation/spectrum_light.png new file mode 100644 index 00000000..7b561ab8 Binary files /dev/null and b/docs/assets/validation/spectrum_light.png differ diff --git a/mkdocs.yml b/mkdocs.yml index 3ed4a7e4..4bcf6bcb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,13 +22,16 @@ nav: - Two-stream radiation code: Explanations/two_stream.md - Spherical harmonic code: Explanations/spherical_harmonic.md - Spectral files: Explanations/spectral_files.md + - Building spectral files: Explanations/spectraltools_pipeline.md - Interface to the calling model: Explanations/interface.md - Reference: - Publications: Reference/publications.md - Spectral files: - - Met Office spectral files: Reference/spectral_file_reference.md + - Overview: Reference/spectral_files.md - PROTEUS spectral files: Reference/proteus_spectral_file_reference.md + - Validation: Reference/spectral_file_validation.md + - Met Office spectral files: Reference/spectral_file_reference.md - Documentation PDFs: Reference/documentation_pdfs.md @@ -99,7 +102,12 @@ markdown_extensions: - attr_list - markdown_include.include: base_path: docs - - pymdownx.extra + - pymdownx.extra: + pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format - pymdownx.arithmatex: generic: true - pymdownx.tabbed: diff --git a/spectraltools/Tdownload_cia.py b/spectraltools/Tdownload_cia.py index ae6db13e..cacf418f 100755 --- a/spectraltools/Tdownload_cia.py +++ b/spectraltools/Tdownload_cia.py @@ -23,6 +23,7 @@ def main(): "N2-He": "N2-He_2018.cia", "N2-N2": "N2-N2_2021.cia", "N2-H2O": "N2-H2O_2018.cia", + "N2-CH4": "N2-CH4_2024.cia", "O2-CO2": "O2-CO2_2024.cia", "O2-N2": "O2-N2_2024.cia", @@ -33,6 +34,7 @@ def main(): "CO2-He": "CO2-He_2018.cia", "CO2-CH4": "CO2-CH4_2024.cia", "CO2-Ar": "CO2-Ar_2021.cia", + "CO2-H2O": "CO2-H2O_2024.cia", "CH4-He": "CH4-He_2018.cia", "CH4-Ar": "CH4-Ar_2011.cia", diff --git a/spectraltools/Tinterpolate_dace.py b/spectraltools/Tinterpolate_dace.py index 7ab29777..aaf3c01c 100755 --- a/spectraltools/Tinterpolate_dace.py +++ b/spectraltools/Tinterpolate_dace.py @@ -14,13 +14,19 @@ def main(): # Intended target pressures [bar] # p_arr = np.logspace(-6, 3, 5) - p_arr = [1e-3, 1e-2] + # Matches the ExoCross grid, clipped to DACE limits (p <= 1e3 bar) + p_arr = [1.0e-5, 1.0e-4, 3.2e-4, 1.0e-3, 3.2e-3, 1.0e-2, 3.2e-2, 1.0e-1, + 3.2e-1, 1.0, 3.2, 1.0e1, 3.2e1, 1.0e2, 3.2e2, 1.0e3] # Intended target temperatures [K] # t_arr = np.linspace(60.0, 2900.0, 5) - 5.0 # t_arr = np.append(t_arr, [75.0, 100.0]) - t_arr = [100.0, 300.0] + # Matches the ExoCross grid; points outside t_lims are dropped below + t_arr = [25.0, 100.0, 125.0, 150.0, 175.0, 200.0, 225.0, 250.0, 275.0, + 300.0, 325.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0, 650.0, + 700.0, 750.0, 800.0, 850.0, 900.0, 950.0, 1000.0] + t_arr += list(np.arange(1100.0, 4001.0, 100.0)) + [4500.0, 5000.0] # Uncomment one of the blocks below or write your own #isotopologue = '1H2-16O' @@ -35,11 +41,11 @@ def main(): #t_lims = (50.0, 4500.0) #outdir = utils.dirs["dace"] + "/H2/" - isotopologue = '12C-16O' - linelist = 'HITEMP2019' - linelist_version = 1.0 - t_lims = (50.0, 8900.0) - outdir = utils.dirs["dace"] + "/CO/" + #isotopologue = '12C-16O' + #linelist = 'HITEMP2019' + #linelist_version = 1.0 + #t_lims = (50.0, 8900.0) + #outdir = utils.dirs["dace"] + "/CO/" #isotopologue = '12C-16O2' #linelist = 'UCL-4000' @@ -77,11 +83,11 @@ def main(): #t_lims = (50.0, 4500.0) #outdir = utils.dirs["dace"] + "/N2O/" - #isotopologue = '14N-1H3' - #linelist = 'CoYuTe' - #linelist_version = 2.0 - #t_lims = (50.0, 1900.0) - #outdir = utils.dirs["dace"] + "/NH3/" + isotopologue = '14N-1H3' + linelist = 'CoYuTe' + linelist_version = 2.0 + t_lims = (50.0, 1900.0) + outdir = utils.dirs["dace"] + "/NH3/" #isotopologue = '16O-1H' #linelist = 'HITEMP2020' @@ -107,6 +113,18 @@ def main(): # t_lims = (50.0, 1900.0) # outdir = utils.dirs["dace"] + "/SO2/" + #isotopologue = '51V-16O' + #linelist = 'VOMYT' + #linelist_version = 2.0 + #t_lims = (50.0, 4500.0) + #outdir = utils.dirs["dace"] + "/VO/" + + #isotopologue = '12C-1H4' + #linelist = 'HITEMP2020' + #linelist_version = 1.0 + #t_lims = (50.0, 2500.0) + #outdir = utils.dirs["dace"] + "/CH4/" + # ------------------- # Na, NaO, Fe, FeO, FeH, K, SiO, SiO2, PH3, provided already by SOCRATES diff --git a/spectraltools/Tmake_spectralfile.py b/spectraltools/Tmake_spectralfile.py index ccd956db..31b0ca1c 100755 --- a/spectraltools/Tmake_spectralfile.py +++ b/spectraltools/Tmake_spectralfile.py @@ -17,24 +17,59 @@ log = logging.getLogger("fwl."+__name__) -def main(): +def main(nband=None): log.info(" SOCRATES directory: %s", utils.dirs["socrates"]) log.info(" SOCRATES version: %s", utils.socratesver()) log.info(" SOCRATES git hash: %s", utils.git_hash()) + # Water + # vols = ["H2O" ] # List of gases + # alias = "Snowline" # Alias for this spectral file + + # Rock vapours + # vols = ["CO", "O2", "SiO", "TiO", "MgO", "Na", "K", "Fe"] # List of gases + # alias = "Volenfell" # Alias for this spectral file + + # Oxidised volatiles + # vols = ["H2O", "CO2", "CO", "O2", "SO2", "OCS", "S2" ] # List of gases + # alias = "Breezehome" # Alias for this spectral file + + # Reduced volatiles + # vols = ["H2", "CO", "CH4", "S2", "H2S", "N2", "NH3" ] # List of gases + # alias = "Cliffshade" # Alias for this spectral file + + # Combined volatiles + # vols = ["H2O", "H2", "CO2", "CO", "O2", "O3", "CH4", "SO2", "OCS", "S2", "H2S", "N2", "NH3", "HCN"] + # alias = "Proudspire" + + # Hot jupiters + # vols = ["H2O", "H2", "CO2", "CO", "SiO", "TiO", "VO", "MgO", "Na", "K", "Fe"] + # alias = "Skyborn" + + # Vapours + volatiles (small) + vols = ["H2O", "H2", "CO2", "CO", "O2", "CH4", "SO2", "S2","H2S", "NH3", "SiO", "TiO", "Na", "K"] + alias = "Atmora" + + # Vapours + volatiles (large) + # vols = ["H2O", "H2", "CO2", "CO", "O2", "O3", "CH4", "SO2", "OCS", "S2", "H2S", "N2", "NH3", "HCN", "SiO", "TiO", "MgO", "Na", "K", "Fe"] + # alias = "Sovngarde" + # ------------ PARAMETERS ------------ source = "exocross" # Source database - vols = ["CO", "O2", "SiO", "TiO", "MgO", "Na", "K", "Fe"] # List of gases - alias = "Volenfell" # Alias for this spectral file + vol_source = {"VO":"dace", "CH4":"dace", "NH3":"dace"} # Per-gas overrides of source database + UV = False # Includes the UV range wavenumbers and cross-sections - nband = 128 # Number of wavenumber bands + if nband is None: + nband = 32 # Number of wavenumber bands (if not passed as argument) drops = True # Include water droplet scattering? - method = 2 # Band selection method + method = 3 # Band selection method numax = 50000.0 # Clip to this maximum wavenumber [cm-1] numin = 10.0 # Clip to this minimum wavenumber [cm-1] dnu = 0.025 # Downsample to this wavenumber resolution [cm-1] preNC = True # Use pre-existing netCDF files in output/ if they are found + maxpath = 1.0e3 # Default maximum mass path for k-coefficients [kg/m2]; also used for CIA [kg2/m5] + vol_maxpath = {"SiO":1e1, "TiO":1e1, "VO":1e1, "MgO":1e1, "Na":1e1, "K":1e1, "Fe":1e1} # Per-gas overrides of maximum mass path [kg/m2] # band selection methods (wavenumber space): # 0 = linspace \n @@ -73,10 +108,22 @@ def main(): raise Exception("Invalid gas '%s'"%vols[i]) vols[i] = safe + # Source database for each volatile + vol_source = {phys.chemsafe(k):utils.sourcesafe(s) for k,s in vol_source.items()} + srcs = {v:vol_source.get(v, source) for v in vols} + + # Maximum mass path for each volatile + spectral.CCORRK_MAXPATH = maxpath + vol_maxpath = {phys.chemsafe(k):float(m) for k,m in vol_maxpath.items()} + maxpaths = {v:vol_maxpath.get(v, maxpath) for v in vols} + + # Reference volatile for p,t grid and band edges: last one using the default source + vref = ([v for v in vols if srcs[v] == source] or vols)[-1] + # =========== # Check paths for v in vols: - formula_path = os.path.join(utils.dirs[source], v.strip()+"/") + formula_path = os.path.join(utils.dirs[srcs[v]], v.strip()+"/") if not os.path.exists(formula_path): raise Exception("Could not find folder '%s'" % formula_path) @@ -97,37 +144,36 @@ def main(): # Print params log.info("") log.info("Parameters") - log.info(" source: %s", source) - log.info(" alias: %s", alias) - log.info(" vols: %s", utils.get_arr_as_str(vols)) - log.info(" nvols: %d", len(vols)) - log.info(" nband: %d", nband) + log.info(" source: %s", source) + log.info(" gases: (N=%d)", len(vols)) + for v in vols: + log.info(" %6s from %-8s maxpath %.2e kg/m2", v, srcs[v], maxpaths[v]) + log.info(" alias: %s", alias) + log.info(" nband: %d", nband) log.info(" numin, numax, dnu : %.3f, %.3f, %.3f cm-1", numin, numax, dnu) - log.info(" drops: %s", str(drops)) - log.info(" method: %d", method) - log.info(" n_tp: %d", len(tgt_p)*len(tgt_t)) - log.info(" tgt_p: %s", utils.get_arr_as_str(tgt_p, fmt=r"%.2e", sep=',')) - log.info(" tgt_t: %s", utils.get_arr_as_str(tgt_t, fmt=r"%.2f", sep=',')) + log.info(" method: %d", method) + log.info(" masspath: %.2e kg/m2", maxpath) + log.info(" UV: %s", str(UV)) + log.info(" preNC: %s", str(preNC)) + log.info(" n_tp: %d", len(tgt_p)*len(tgt_t)) + log.info(" tgt_p: %s", utils.get_arr_as_str(tgt_p, fmt=r"%.2e", sep=',')) + log.info(" tgt_t: %s", utils.get_arr_as_str(tgt_t, fmt=r"%.2f", sep=',')) + log.info(" drops: %s", str(drops)) # =========== # Test each volatile for its numin, numax, pmin, pmax, tmin, tmax log.info("") log.info("Verifying domain of input data") - if source == "dace": - if np.amin(tgt_p) < 1.0e-8: - raise Exception("Requested pressures exceed DACE domain (p < 1.0e-8 bar)") - if np.amax(tgt_p) > 1.0e3: - raise Exception("Requested pressures exceed DACE domain (p > 1.0e3 bar)") - # check files directly dat_numin, dat_numax = np.inf, -np.inf dat_tmin, dat_tmax = np.inf, -np.inf + dat_pmin, dat_pmax = np.inf, -np.inf for v in vols: log.info(" checking %s", v) # read first file - formula_path = os.path.join(utils.dirs[source], v+"/") - temp_xc = cross.xsec(v, source, ptf.first_file(source, v)) + formula_path = os.path.join(utils.dirs[srcs[v]], v+"/") + temp_xc = cross.xsec(v, srcs[v], ptf.first_file(srcs[v], v)) temp_xc.read(UV=UV, numin=numin, numax=numax, dnu=dnu) temp_xc.plot([None,None], show=False, quiet=True, @@ -140,16 +186,33 @@ def main(): dat_numax = max(dat_numax, vol_numax) log.info(" numin, numax = %.1f, %.1f cm-1", vol_numin, vol_numax) - # get tmin, tmax - _,at,_ = ptf.list_all_ptf(source, v, quiet=False) + # get pmin, pmax, tmin, tmax + ap,at,_ = ptf.list_all_ptf(srcs[v], v, quiet=False) dat_tmin = min(dat_tmin, np.amin(at)) dat_tmax = max(dat_tmax, np.amax(at)) - - # check temperature range + dat_pmin = min(dat_pmin, np.amin(ap)) + dat_pmax = max(dat_pmax, np.amax(ap)) + + # warn if this volatile will be clamped to its nearest p,t point + rtol = 1.0e-2 + p_out = tgt_p[(tgt_p < np.amin(ap)*(1-rtol)) | (tgt_p > np.amax(ap)*(1+rtol))] + t_out = tgt_t[(tgt_t < np.amin(at)*(1-rtol)) | (tgt_t > np.amax(at)*(1+rtol))] + if len(p_out) > 0: + log.warning(" %s data spans p = [%.2e, %.2e] bar; using nearest for p = %s bar", + v, np.amin(ap), np.amax(ap), utils.get_arr_as_str(p_out, fmt=r"%.2e", sep=',')) + if len(t_out) > 0: + log.warning(" %s data spans t = [%.2f, %.2f] K; using nearest for t = %s K", + v, np.amin(at), np.amax(at), utils.get_arr_as_str(t_out, fmt=r"%.2f", sep=',')) + + # check temperature and pressure range if np.amin(tgt_t) < dat_tmin: - raise Exception("Requested temperatures exceed data domain (t < %g K)"%dat_tmin) + raise Exception("Requested temperatures exceed data domain (t < %.2f K)"%dat_tmin) if np.amax(tgt_t) > dat_tmax: - raise Exception("Requested temperatures exceed data domain (t > %g K)"%dat_tmax) + raise Exception("Requested temperatures exceed data domain (t > %.2f K)"%dat_tmax) + if np.amin(tgt_p) < dat_pmin*(1-rtol): + raise Exception("Requested pressures exceed data domain (p < %.2e bar)"%dat_pmin) + if np.amax(tgt_p) > dat_pmax*(1+rtol): + raise Exception("Requested pressures exceed data domain (p > %.2e bar)"%dat_pmax) # set new nu range numin = max(numin, dat_numin) @@ -157,8 +220,9 @@ def main(): log.info(" numin, numax set to %.1f, %.1f cm-1", numin, numax) # Set the nu limits to encompass all volatile nus (least restrictive) # =========== - # Determine flattened p,t grid using last of the absorbers - arr_p, arr_t = ptf.best_pt(source, vols[-1], tgt_p, tgt_t) + # Determine flattened p,t grid using reference absorber + log.info("Using %s as reference for p,t grid and band edges", vref) + arr_p, arr_t = ptf.best_pt(srcs[vref], vref, tgt_p, tgt_t) # Ensure pressure grid is ascending and unique # if not utils.is_ascending(arr_p): @@ -167,10 +231,9 @@ def main(): # raise Exception("Pressure grid is not unique (contains repeated values)!") # =========== - # Get nu array for required range and resolution (first file from last absorber) - nu_file = ptf.first_file(source, vols[-1]) - nu_samp = cross.xsec(vols[-1], # final volatile - source, nu_file) + # Get nu array for required range and resolution (first file from reference absorber) + nu_file = ptf.first_file(srcs[vref], vref) + nu_samp = cross.xsec(vref, srcs[vref], nu_file) nu_arr = nu_samp.read().get_nu() # =========== @@ -197,14 +260,14 @@ def main(): nc_paths[v] = ncp # Get numin, numax for this volatile - formula_path = ptf.get_formula_path(source, v) - temp_xc = cross.xsec(v, source, ptf.first_file(source, v)) + formula_path = ptf.get_formula_path(srcs[v], v) + temp_xc = cross.xsec(v, srcs[v], ptf.first_file(srcs[v], v)) temp_xc.read() temp_xc.plot([numin, numax], show=False, quiet=False, band_edges=band_edges, alias=alias+"_", pad_xlim=5e3) - numin = max(numin, np.amin(temp_xc.get_nu())) - numax = min(numax, np.amax(temp_xc.get_nu())) + numin_v = max(numin, np.amin(temp_xc.get_nu())) + numax_v = min(numax, np.amax(temp_xc.get_nu())) # Can skip PTF mapping? if os.path.exists(ncp) and preNC: @@ -218,15 +281,15 @@ def main(): else: # Map files, finding the closest p,t point to each target p,t point - vol_p, vol_t, vol_f = ptf.map_ptf(source, v, arr_p, arr_t) + vol_p, vol_t, vol_f = ptf.map_ptf(srcs[v], v, arr_p, arr_t) # Write these p,t,f to csv file for reference ptf.write_csv(alias, v, vol_p, vol_t, vol_f) # Write netCDF from source files - dnu_this = netcdf.write_ncdf_from_grid(UV, ncp, v, source, + dnu_this = netcdf.write_ncdf_from_grid(UV, ncp, v, srcs[v], arr_p, arr_t, vol_f, - dnu=dnu, numin=numin, numax=numax) + dnu=dnu, numin=numin_v, numax=numax_v) # Check resolution if (dnu_last is not None) and (not np.isclose(dnu_last, dnu_this)): @@ -242,7 +305,7 @@ def main(): # Calculate k-coefficients from netCDF log.info("") for i,f1 in enumerate(vols): - spectral.calc_kcoeff_lbl(alias, f1, nc_paths[f1]) + spectral.calc_kcoeff_lbl(alias, f1, nc_paths[f1], maxpath=maxpaths[f1]) for f2 in vols[i:]: spectral.calc_kcoeff_cia(alias, f1, f2, dnu_last) diff --git a/spectraltools/Tmake_spectralfile_bands.py b/spectraltools/Tmake_spectralfile_bands.py new file mode 100644 index 00000000..9851738e --- /dev/null +++ b/spectraltools/Tmake_spectralfile_bands.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +# Make spectral files with the same absorbers but different numbers of bands, +# packaging each one into its own zip archive. Absorbers, alias and all other +# settings are taken from the parameters in Tmake_spectralfile.py + +# Import local files +import src.utils as utils +import Tmake_spectralfile +import Tpackage_spectralfile +import logging +import os +import time +import argparse + +log = logging.getLogger("fwl."+__name__) + +# Main function +def main(nbands:list, target:str, overwrite:bool): + target = os.path.abspath(target) + + # Runs share the same alias, so each one clears the output of the previous + # run. Pre-existing netCDFs are kept if preNC=True, since they do not + # depend on the number of bands. + zpaths = [] + for nband in nbands: + + # Make spectral file, with its own log + logfile = utils.setup_logger("Tmake_spectralfile") + log.info("Spectral Tools Wizard (version %s)", utils.__version__) + log.info("Making spectral file with nband=%d", nband) + start = time.perf_counter() + alias = Tmake_spectralfile.main(nband=nband) + elapsed = time.perf_counter()-start + log.info("Time elapsed: %d hours %.2f minutes.", elapsed//3600, (elapsed%3600)//60) + + # Copy this run's log into output folder, so that it is packaged + out_logfile = utils.move_log_to_output(logfile, alias=alias) + log.info("Copied log file to '%s'", out_logfile) + + # Package into ///.zip + utils.setup_logger("Tpackage_spectralfile") + ztarget = os.path.join(target, alias, "%d"%nband) + Tpackage_spectralfile.main(alias, ztarget, overwrite) + zpaths.append(os.path.join(ztarget, alias+".zip")) + + log.info("") + log.info("Wrote %d zip files", len(zpaths)) + for z in zpaths: + log.info(" %s", z) + + +# Run main function +if __name__ == "__main__": + utils.checkenv() + + parser = argparse.ArgumentParser(description='Make and zip spectral files with different numbers of bands') + parser.add_argument('target', type=str, nargs='?', default='.', + help='Folder in which to write //.zip (default: current directory)') + parser.add_argument('--nband', type=int, nargs='+', default=[32, 64, 128, 256, 2048], + help='Numbers of bands to make') + parser.add_argument('--overwrite', action='store_true', help='Overwrite existing zip files') + args = parser.parse_args() + + main(args.nband, args.target, args.overwrite) + + +# End of file diff --git a/spectraltools/Tupload_zenodo.py b/spectraltools/Tupload_zenodo.py new file mode 100644 index 00000000..3d012ca9 --- /dev/null +++ b/spectraltools/Tupload_zenodo.py @@ -0,0 +1,1411 @@ +#!/usr/bin/env python3 +"""Upload PROTEUS spectral files to Zenodo as records of the PROTEUS community. + +Each pair of codename and band count becomes one Zenodo record, titled +``spectral_files//``, which holds these loose files: + + .sf, .sf_k spectral file and its k-coefficient file + .chk, .chk_k BLAKE2b checksums of the two files above + _Tmake_spectralfile_.log generator log + _*.log logs of prep_spec, Ccorr_k and Cscatter_average, + with their monitor logs, except the Cscatter_average + monitor log _droplet_mon.log (1.7 GB with + 2048 bands); empty logs are skipped + _Tmake_spectralfile.py generator script (settings backup), only if + its settings agree with the generator log + +This layout follows the existing records (for example +https://zenodo.org/records/15799731): one record per codename and band count, +loose files, keyword "spectral_files", licence CC-BY-4.0, resource type +dataset, each record its own concept (no version chain). AGNI's +src/get_data.sh downloads .sf and .sf_k from a record by +file name, and fwl-io (used by PROTEUS) downloads every file of a record, so +the zip archive made by Tpackage_spectralfile.py is not uploaded: AGNI would +not find the files inside it, and fwl-io would download it in addition to the +loose files. + +The files are read from + + ROOT/// + +Sub-folders of ROOT whose names start with '_' or '.' (such as _old) are +ignored. + +Steps +----- +1. Discover and check (always; offline). For each record: parse block 0 of the + .sf (absorbers, continua, band count) and the generator log (SOCRATES + version and git hash, spectraltools version, build time, gases with their + sources and maximum mass paths, band-selection method, continua and their + sources); check them against each other and against the folder + name; compute MD5, BLAKE2b and CRC32 of each file in one pass; compare the + BLAKE2b of .sf and .sf_k with the .chk and .chk_k files; compare each file + with its copy in .zip (size and CRC32) when the zip is present; + refuse a .sf or .sf_k that contains "NaN", and a .sf_k that contains the + netCDF fill value 9.969210E+36 (an input netCDF that was never filled) or any + value above 1e30, reporting the gas or continuum index and the number of + lines affected. The generator script is parsed + (not run) and left out, with a warning, if its alias, gases, sources, mass + paths or other settings differ from the log: Tpackage_spectralfile.py + stores the Tmake_spectralfile.py present at packaging time, which may + have been edited for another spectral file by then. +2. Dry run (the default). Print the records, their metadata, the files with + sizes and checksums, and exit. No network request is made and no file is + written. +3. --upload. List the user's depositions, then create one draft per record + (or resume the draft with the same title), set its metadata (with the build + date of the file as the publication date, and a request to reserve the + record's DOI, which is logged), upload the files with a streamed PUT to the + record's bucket, and compare the MD5 that Zenodo reports for each file with + the local MD5. The run stops at the first mismatch or error. Nothing is + published. +4. --upload --publish. As 3, then publish each verified draft. A published + record can no longer be deleted by its owner. + +At the end of an --upload run, a Markdown table of codename, band count, record +URL and DOI is printed for the documentation (docs/Reference/proteus_spectral_file_reference.md). + +Safety defaults +--------------- +* Dry run unless --upload is given; publishing needs --publish as well. +* The target is the sandbox (https://sandbox.zenodo.org) unless --production + is given. Sandbox records use test DOIs and can be discarded, so a mistaken + run there has no lasting effect. +* On production, the script asks for confirmation before it creates or changes + drafts, and again before it publishes; --yes skips both questions. +* The access token is read only from the environment variable ZENODO_TOKEN + (production) or ZENODO_SANDBOX_TOKEN (sandbox), and only when --upload is + given. It is never printed or logged. It needs the scopes deposit:write and + deposit:actions. + +Resuming +-------- +No state is kept between runs: Zenodo is the only record of what has been +uploaded. Each --upload run lists the user's depositions and matches them to +the records by title (spectral_files//), so a failed run can +be repeated with the same command: a draft with the same title is reused, files +already present with the correct MD5 are not uploaded again, and records +already published are skipped. Two drafts with the same title stop the run. + +Community +--------- +The record is added to the community through the "communities" field of the +deposit metadata, the route documented in Zenodo's developer documentation +(https://developers.zenodo.org/#deposit-metadata). The community curators may have to accept the +request; after publishing, the script reports whether the record lists the +community yet. The proteus_framework community exists only on production, so +on the sandbox no community is requested unless --community names one. + +Examples +-------- + # dry run over every family and band count below ROOT + python Tupload_zenodo.py ROOT + + # dry run for one record, printing the exact metadata JSON + python Tupload_zenodo.py ROOT --family Snowline --nband 256 --show-json + + # test run on the sandbox: drafts and uploads, no publishing + ZENODO_SANDBOX_TOKEN=... python Tupload_zenodo.py ROOT --nband 32 --upload \ + --creator "Family, Given" --orcid 0000-0000-0000-0000 + + # production: drafts and uploads, then publish (asks for confirmation) + ZENODO_TOKEN=... python Tupload_zenodo.py ROOT --production --upload --publish \ + --creator "Family, Given" --orcid 0000-0000-0000-0000 +""" + +# This script deliberately does not import src.utils: that module raises +# without RAD_DIR and spectraltools/output/, which an upload does not need. + +from __future__ import annotations + +import argparse +import ast +import datetime as dt +import math +import hashlib +import html +import json +import logging +import os +import re +import sys +import time +import zipfile +import zlib +from dataclasses import dataclass, field +from pathlib import Path +from urllib.parse import quote + +log = logging.getLogger("fwl.Tupload_zenodo") + +# --------------------------------------------------------------------------- +# Conventions of the existing PROTEUS spectral-file records on Zenodo, +# read from https://zenodo.org/api/records?communities=proteus_framework&q=keywords:spectral_files +# --------------------------------------------------------------------------- + +HOSTS = {"sandbox": "https://sandbox.zenodo.org", "production": "https://zenodo.org"} +TOKEN_VARS = {"sandbox": "ZENODO_SANDBOX_TOKEN", "production": "ZENODO_TOKEN"} + +COMMUNITY = "proteus_framework" +KEYWORDS = ["spectral_files"] # the community page filters on this subject +LICENSE = "cc-by-4.0" +UPLOAD_TYPE = "dataset" +ACCESS_RIGHT = "open" + +DOCS_URL = "https://proteus-framework.org/SOCRATES/Reference/proteus_spectral_file_reference.html" +# Shown in the "Repository URL" field of the record. Zenodo keeps it as the custom field code:codeRepository, +# which its legacy API returns under metadata.custom; the deposit API is not documented to accept it, so the +# script checks that the draft keeps it. +REPO_URL = "https://github.com/FormingWorlds/SOCRATES" + +# Zenodo developer documentation, legacy deposit API (still the documented +# REST API of Zenodo after its move to InvenioRDM): +# - deposit metadata, including "communities": [{"identifier": ...}]: +COMMUNITY_DOC = "https://developers.zenodo.org/#deposit-metadata" +# - bucket upload (streamed PUT to links.bucket, up to 50 GB per file): +BUCKET_DOC = "https://developers.zenodo.org/#quickstart-upload" +# The InvenioRDM review request (PUT /api/records/{id}/draft/review with type +# "community-submission", https://inveniordm.docs.cern.ch/reference/rest_api_reviews/) +# is not used: Zenodo's developer documentation lists its Communities API as +# "currently in testing" and does not document that route. + +USER_AGENT = "SOCRATES-spectraltools-Tupload_zenodo/1.0" +CONNECT_TIMEOUT = 30.0 # seconds + +SOURCE_NAMES = {"exocross": "ExoCross", "dace": "DACE", "hitran": "HITRAN", + "exomol": "ExoMol", "direct": "direct"} + +# Band-selection methods, as described in Tmake_spectralfile.py and +# src/spectral.py:best_bands. +BAND_METHODS = { + 0: "linearly spaced in wavenumber", + 1: "logarithmically spaced in wavenumber", + 2: "linearly spaced in wavenumber, with a single band covering long wavelengths", + 3: "logarithmically spaced in wavenumber, with a few linearly spaced bands covering long wavelengths", + 4: "piecewise density (linear, logarithmic, logarithmic)", + 5: "selected by the density of the Planck function at given temperatures", + 9: "matching the legacy 318-band spectral file", +} + +_LOG_FORMAT = logging.Formatter(fmt="[%(asctime)s %(levelname)7s] %(message)s", + datefmt="%H:%M:%S") + + +class CheckError(Exception): + """A local file is missing or inconsistent; nothing should be uploaded.""" + + +class ZenodoError(RuntimeError): + """A request to Zenodo failed or returned something unexpected.""" + + +# --------------------------------------------------------------------------- +# Local files +# --------------------------------------------------------------------------- + +@dataclass +class LocalFile: + name: str + path: Path + size: int = 0 + md5: str = "" + blake2b: str = "" + crc32: int = 0 + nan_count: int = 0 + + +@dataclass +class LogInfo: + path: Path + build_time: dt.datetime + tools_version: str = "" + socrates_version: str = "" + git_hash: str = "" + alias: str = "" + nband: int = 0 + source: str = "" + gases: list = field(default_factory=list) # (formula, source, maxpath string) + n_gases: int = 0 + numin: str = "" + numax: str = "" + dnu: str = "" + method: int = -1 + masspath: str = "" + uv: bool | None = None + drops_param: bool | None = None + n_tp: int = 0 + line_absorbers: list = field(default_factory=list) + continua: list = field(default_factory=list) # "A-B" + continuum_sources: dict = field(default_factory=dict) + droplets: bool | None = None + + +@dataclass +class Item: + codename: str + nband: int + folder: Path + files: list = field(default_factory=list) # LocalFile, in upload order + block0: dict = field(default_factory=dict) + log: LogInfo | None = None + excluded: list = field(default_factory=list) # (file name, reason) + zip_checked: bool = False + metadata: dict = field(default_factory=dict) + + @property + def key(self) -> str: + return f"{self.codename}/{self.nband}" + + @property + def title(self) -> str: + return f"spectral_files/{self.codename}/{self.nband}" + + @property + def total_size(self) -> int: + return sum(f.size for f in self.files) + + +def human_size(n: int) -> str: + for unit in ("B", "KiB", "MiB", "GiB"): + if n < 1024 or unit == "GiB": + return f"{n:.0f} {unit}" if unit == "B" else f"{n:.1f} {unit}" + n /= 1024.0 + return f"{n} B" + + +def hash_file(lf: LocalFile, scan_nan: bool) -> None: + """Fill size, MD5, BLAKE2b (as Tcalc_checksum.py), CRC32 and the NaN count, in one pass.""" + md5 = hashlib.md5() + b2 = hashlib.blake2b() + crc = 0 + size = 0 + nans = 0 + tail = b"" + with lf.path.open("rb") as f: + while chunk := f.read(1 << 22): + md5.update(chunk) + b2.update(chunk) + crc = zlib.crc32(chunk, crc) + size += len(chunk) + if scan_nan: + # Fortran writes a NaN as "NaN"; keep two bytes across chunk edges + buf = tail + chunk + nans += buf.count(b"NaN") + tail = buf[-2:] + lf.size = size + lf.md5 = md5.hexdigest() + lf.blake2b = b2.hexdigest() + lf.crc32 = crc & 0xFFFFFFFF + lf.nan_count = nans + + +# --------------------------------------------------------------------------- +# Implausible values in the k-coefficient file +# --------------------------------------------------------------------------- + +# netCDF default fill value for float (NC_FILL_FLOAT), written as 9.969210E+36 in a +# .sf_k when Ccorr_k reads a variable that was never filled. +FILL_VALUE = 9.969209968386869e36 +# No valid entry of a .sf_k comes near this: in the files checked so far every value, +# the pressure grid included, stays below 1e11. +K_LIMIT = 1.0e30 + +# "*BLOCK: " or "Band: , gas|continuum: " section headers of a .sf_k +_SFK_SECTION = re.compile(rb"^\*BLOCK:\s*([^\n]*?)\s*$|^Band:\s*(\d+),\s*(gas|continuum):\s*(\d+)", re.M) +# Cheap pre-filter for a value >= 1e30: exponent +30..+99, a three-digit exponent +# written without 'E' (Fortran), Infinity, or a field overflow written as asterisks +_SFK_BIG = re.compile(rb"[Ee]\+(?:3\d|[4-9]\d)|\d\+\d{3}|Infinity|\*{3,}") + + +def scan_large_values(path: Path) -> dict: + """Find netCDF fill values and values above K_LIMIT in a .sf_k, by section. + + Returns {(block, kind, index): {"lines", "fill", "other", "bands"}}, where block + is the .sf_k block name (e.g. "k-table", "continuum k-table"), kind is "gas" or + "continuum", and index is the absorber or continuum index of block 0 of the .sf + (kind "header" with index 0 for the lookup grid before the first section). + """ + bad = {} + cur = ("", "header", 0, 0) # block, kind, index, band + + def _section(m, c): + if m.group(1) is not None: + return (m.group(1).decode(errors="replace"), "header", 0, 0) + return (c[0], m.group(3).decode(), int(m.group(4)), int(m.group(2))) + + carry = b"" + with path.open("rb") as f: + while True: + chunk = f.read(1 << 24) + buf = carry + chunk + if not buf: + break + if chunk: # keep a partial last line for the next chunk + cut = buf.rfind(b"\n") + 1 + if cut == 0: + carry = buf + continue + buf, carry = buf[:cut], buf[cut:] + else: + carry = b"" + if not _SFK_BIG.search(buf): # fast path: only track the section headers + for m in _SFK_SECTION.finditer(buf): + cur = _section(m, cur) + else: + for line in buf.split(b"\n"): + m = _SFK_SECTION.match(line) + if m: + cur = _section(m, cur) + continue + if not _SFK_BIG.search(line): + continue + n_fill = n_other = 0 + for tok in line.split(): + try: + v = float(tok) + except ValueError: + v = math.inf + if math.isclose(v, FILL_VALUE, rel_tol=1e-6): + n_fill += 1 + elif not v <= K_LIMIT: + n_other += 1 + if n_fill or n_other: + rec = bad.setdefault(cur[:3], {"lines": 0, "fill": 0, "other": 0, "bands": set()}) + rec["lines"] += 1 + rec["fill"] += n_fill + rec["other"] += n_other + rec["bands"].add(cur[3]) + if not chunk: + break + return bad + + +def describe_large_values(bad: dict, b0: dict, nband: int) -> str: + """One phrase per affected section, naming the gas or continuum from block 0.""" + parts = [] + for (block, kind, index), r in sorted(bad.items()): + if kind == "gas" and 1 <= index <= len(b0["absorbers"]): + what = f"gas {index} ({b0['absorbers'][index - 1]})" + elif kind == "continuum" and 1 <= index <= len(b0["continua"]): + what = f"continuum {index} ({b0['continua'][index - 1]})" + else: + what = f"{kind} {index}" + vals = [] + if r["fill"]: + vals.append(f"{r['fill']} netCDF fill values 9.969210E+36") + if r["other"]: + vals.append(f"{r['other']} other values above {K_LIMIT:.0e}") + parts.append(f"'{block}' {what}: {r['lines']} lines in {len(r['bands'])} of {nband} bands " + f"({', '.join(vals)})") + return "; ".join(parts) + + +# --------------------------------------------------------------------------- +# Spectral file block 0 and the SOCRATES gas list +# --------------------------------------------------------------------------- + +def gas_list_path() -> Path: + """Find gas_list_pcf.F90 in this SOCRATES tree, or below RAD_DIR.""" + rel = Path("src") / "radiance_core" / "gas_list_pcf.F90" + candidates = [Path(__file__).resolve().parent.parent / rel] + if os.environ.get("RAD_DIR"): + candidates.append(Path(os.environ["RAD_DIR"]) / rel) + for c in candidates: + if c.is_file(): + return c + raise CheckError("Cannot find gas_list_pcf.F90 (looked in: %s)" + % ", ".join(str(c) for c in candidates)) + + +def read_gas_list(path: Path) -> tuple[list, list]: + """Return the formulae (header_gas) and long names (name_absorb), indexed by identifier-1.""" + text = path.read_text() + + def _array(name: str) -> list: + m = re.search(r"PARAMETER\s*::\s*%s\(npd_gases\)\s*=\s*\(/(.*?)/\)" % name, text, re.S) + if m is None: + raise CheckError(f"Cannot find {name} in {path}") + return [s.strip() for s in re.findall(r"['\"]([^'\"]*)['\"]", m.group(1))] + + formulae, names = _array("header_gas"), _array("name_absorb") + if len(formulae) != len(names) or not formulae: + raise CheckError(f"header_gas and name_absorb differ in length in {path}") + return formulae, names + + +def parse_block0(sf: Path, formulae: list, names: list) -> dict: + """Read the band count, absorbers and continua from block 0 of a spectral file.""" + with sf.open("r", errors="replace") as f: + first = f.readline() + if not re.match(r"\*BLOCK:\s*TYPE\s*=\s*0\s*:", first): + raise CheckError(f"{sf.name}: does not start with block 0") + lines = [] + for line in f: + if line.startswith("*END"): + break + lines.append(line.rstrip("\n")) + else: + raise CheckError(f"{sf.name}: block 0 has no *END") + text = "\n".join(lines) + + def _int(pattern: str, default=None) -> int: + m = re.search(pattern, text) + if m is None: + if default is None: + raise CheckError(f"{sf.name}: block 0 lacks '{pattern}'") + return default + return int(m.group(1)) + + nband = _int(r"Number of spectral bands\s*=\s*(\d+)") + n_abs = _int(r"Total number of gaseous absorbers\s*=\s*(\d+)") + n_cont = _int(r"Total number of generalised continua\s*=\s*(\d+)", default=0) + + absorbers, long_names = [], [] + i = next((k for k, l in enumerate(lines) if "Absorber(identifier and name)" in l), None) + if n_abs and i is None: + raise CheckError(f"{sf.name}: block 0 lacks the list of absorbers") + for k in range(n_abs): + m = re.match(r"\s*(\d+)\s+(\d+)\s+(\S.*?)\s*$", lines[i + 1 + k]) + if m is None or int(m.group(1)) != k + 1: + raise CheckError(f"{sf.name}: cannot read absorber line '{lines[i + 1 + k]}'") + ident, name = int(m.group(2)), m.group(3) + if not 1 <= ident <= len(formulae): + raise CheckError(f"{sf.name}: absorber identifier {ident} is not in the SOCRATES gas list") + if names[ident - 1] != name: + raise CheckError(f"{sf.name}: absorber {ident} is '{name}' in block 0 but " + f"'{names[ident - 1]}' in gas_list_pcf.F90") + absorbers.append(formulae[ident - 1]) + long_names.append(name) + + continua = [] + if n_cont: + j = next((k for k, l in enumerate(lines) if "Gas 1(index and name)" in l), None) + if j is None: + raise CheckError(f"{sf.name}: block 0 lacks the list of continua") + for k in range(n_cont): + line = lines[j + 1 + k] + m = re.match(r"\s*(\d+)\s+(\d+)\s+(\S.*?)\s{2,}(\d+)\s+(\S.*?)\s*$", line) + if m is None or int(m.group(1)) != k + 1: + raise CheckError(f"{sf.name}: cannot read continuum line '{line}'") + g1, g2 = int(m.group(2)), int(m.group(4)) + for g, name in ((g1, m.group(3)), (g2, m.group(5))): + if not 1 <= g <= n_abs or long_names[g - 1] != name: + raise CheckError(f"{sf.name}: continuum line '{line}' does not match the absorbers") + continua.append(f"{absorbers[g1 - 1]}-{absorbers[g2 - 1]}") + + return {"nband": nband, "absorbers": absorbers, "continua": continua} + + +# --------------------------------------------------------------------------- +# Generator log (written by Tmake_spectralfile.py) +# --------------------------------------------------------------------------- + +def parse_log(path: Path) -> LogInfo: + m = re.search(r"_Tmake_spectralfile_(\d{8}T\d{6})\.log$", path.name) + if m is None: + raise CheckError(f"{path.name}: no time stamp in the log name") + info = LogInfo(path=path, build_time=dt.datetime.strptime(m.group(1), "%Y%m%dT%H%M%S")) + + current_cia = None + for raw in path.read_text(errors="replace").splitlines(): + line = re.sub(r"^\[[^\]]*\]\s?", "", raw) # drop "[hh:mm:ss LEVEL] " + s = line.strip() + if m := re.search(r"Spectral Tools Wizard \(version (\S+)\)", s): + info.tools_version = m.group(1) + elif m := re.match(r"SOCRATES version:\s*(\S+)", s): + info.socrates_version = m.group(1) + elif m := re.match(r"SOCRATES git hash:\s*(\S+)", s): + info.git_hash = m.group(1) + elif m := re.match(r"source:\s+(\S+)$", s): + info.source = m.group(1) + elif m := re.match(r"gases:\s+\(N=(\d+)\)", s): + info.n_gases = int(m.group(1)) + elif m := re.match(r"(\S+) from (\S+)\s+maxpath\s+(\S+) kg/m2$", s): + info.gases.append((m.group(1), m.group(2), m.group(3))) + elif m := re.match(r"alias:\s+(\S+)$", s): + info.alias = m.group(1) + elif m := re.match(r"nband:\s+(\d+)$", s): + info.nband = int(m.group(1)) + elif m := re.match(r"numin, numax, dnu\s*:\s*(\S+), (\S+), (\S+) cm-1", s): + info.numin, info.numax, info.dnu = m.groups() + elif m := re.match(r"method:\s+(\d+)$", s): + info.method = int(m.group(1)) + elif m := re.match(r"masspath:\s+(\S+) kg/m2$", s): + info.masspath = m.group(1) + elif m := re.match(r"UV:\s+(True|False)$", s): + info.uv = m.group(1) == "True" + elif m := re.match(r"drops:\s+(True|False)$", s): + info.drops_param = m.group(1) == "True" + elif m := re.match(r"n_tp:\s+(\d+)$", s): + info.n_tp = int(m.group(1)) + elif m := re.match(r"line absorption:\s*(.*)$", s): + info.line_absorbers = [] if "(none)" in m.group(1) else m.group(1).split() + elif m := re.match(r"CIA:\s*(.*)$", s): + info.continua = [] if "(none)" in m.group(1) else m.group(1).split() + elif m := re.match(r"water droplets:\s*(yes|no)$", s): + info.droplets = m.group(1) == "yes" + elif m := re.match(r"Calculating k-coefficients for '([^']+)' CIA", s): + current_cia = m.group(1) + elif current_cia and "Using HITRAN CIA database" in s: + info.continuum_sources[current_cia] = "HITRAN CIA" + current_cia = None + elif current_cia and "MT_CKD" in s: + info.continuum_sources[current_cia] = "MT_CKD" + current_cia = None + + missing = [k for k, v in (("SOCRATES version", info.socrates_version), + ("SOCRATES git hash", info.git_hash), + ("alias", info.alias), ("nband", info.nband), + ("method", info.method >= 0), ("masspath", info.masspath), + ("gases", info.gases), ("line absorption", info.line_absorbers)) + if not v] + if missing: + raise CheckError(f"{path.name}: cannot find {', '.join(missing)} in the log") + return info + + +# --------------------------------------------------------------------------- +# Generator script (backed up by Tpackage_spectralfile.py) +# --------------------------------------------------------------------------- + +SCRIPT_SETTINGS = ("alias", "vols", "source", "vol_source", "method", "drops", "UV", + "numin", "numax", "dnu", "maxpath", "vol_maxpath") + + +def script_mismatches(path: Path, codename: str, info: LogInfo) -> list: + """Compare the settings in a generator script with its log; return the differences. + + Tpackage_spectralfile.py stores the Tmake_spectralfile.py present at packaging + time, which may have been edited for another spectral file since. The script is + parsed, never run: each setting must have exactly one literal assignment (later + derived reassignments such as 'numin = max(numin, ...)' are ignored). + """ + try: + tree = ast.parse(path.read_text()) + except SyntaxError as exc: + return [f"cannot parse ({exc})"] + values = {} + for node in ast.walk(tree): + if (isinstance(node, ast.Assign) and len(node.targets) == 1 + and isinstance(node.targets[0], ast.Name) and node.targets[0].id in SCRIPT_SETTINGS): + try: + values.setdefault(node.targets[0].id, []).append(ast.literal_eval(node.value)) + except ValueError: + pass + problems = [f"{k} has {len(values.get(k, []))} literal assignments" + for k in SCRIPT_SETTINGS if len(values.get(k, [])) != 1] + if problems: + return problems + s = {k: v[0] for k, v in values.items()} + + def close(a, b) -> bool: # the log prints 3 significant figures + return math.isclose(float(a), float(b), rel_tol=1e-2) + + if s["alias"] != codename: + problems.append(f"alias '{s['alias']}'") + if sorted(s["vols"]) != sorted(g for g, _, _ in info.gases): + problems.append(f"gases {s['vols']}") + else: + for gas, src, path_str in info.gases: + if s["vol_source"].get(gas, s["source"]).lower() != src.lower(): + problems.append(f"source of {gas}") + if not close(s["vol_maxpath"].get(gas, s["maxpath"]), path_str): + problems.append(f"maximum mass path of {gas}") + if s["method"] != info.method: + problems.append(f"method {s['method']}") + if info.uv is not None and s["UV"] != info.uv: + problems.append(f"UV {s['UV']}") + if info.drops_param is not None and s["drops"] != info.drops_param: + problems.append(f"drops {s['drops']}") + if not close(s["maxpath"], info.masspath): + problems.append(f"maxpath {s['maxpath']}") + for key in ("numin", "numax", "dnu"): + if getattr(info, key) and not close(s[key], getattr(info, key)): + problems.append(f"{key} {s[key]}") + return problems + + +# --------------------------------------------------------------------------- +# Discovery and checks +# --------------------------------------------------------------------------- + +def discover(root: Path, families: list | None, nbands: list | None) -> list: + """Return (codename, nband, folder) for every ROOT///.sf.""" + if not root.is_dir(): + raise CheckError(f"Root folder '{root}' does not exist") + found = [] + for fam in sorted(p for p in root.iterdir() if p.is_dir()): + if fam.name.startswith(("_", ".")): + continue + for nb in sorted((p for p in fam.iterdir() if p.is_dir() and p.name.isdigit()), + key=lambda p: int(p.name)): + if (nb / f"{fam.name}.sf").is_file(): + found.append((fam.name, int(nb.name), nb)) + if families: + known = sorted({c for c, _, _ in found}) + unknown = [f for f in families if f not in known] + if unknown: + raise CheckError(f"Unknown family {unknown}; found {known}") + found = [x for x in found if x[0] in families] + if nbands: + known = sorted({n for _, n, _ in found}) + unknown = [n for n in nbands if n not in known] + if unknown: + raise CheckError(f"Band count {unknown} not found for the selected families; found {known}") + found = [x for x in found if x[1] in nbands] + if not found: + raise CheckError(f"No spectral files found below '{root}'") + return found + + +def build_item(codename: str, nband: int, folder: Path, formulae: list, names: list) -> Item: + item = Item(codename=codename, nband=nband, folder=folder) + + # Files to upload, in a fixed order + required = [f"{codename}.sf", f"{codename}.sf_k", f"{codename}.chk", f"{codename}.chk_k"] + for name in required: + if not (folder / name).is_file(): + raise CheckError(f"{item.key}: missing {name}") + logs = sorted(folder.glob(f"{codename}_Tmake_spectralfile_*.log")) + if len(logs) != 1: + raise CheckError(f"{item.key}: expected one {codename}_Tmake_spectralfile_*.log, found {len(logs)}") + item.log = info = parse_log(logs[0]) + names_up = required + [logs[0].name] + + # Every other log of the build (prep_spec, Ccorr_k and Cscatter_average, with their monitor logs), except + # the Cscatter_average monitor log, which is far larger than the spectral file itself + for path in sorted(folder.glob("*.log")): + if path.name in names_up: + continue + if path.name == f"{codename}_droplet_mon.log": + item.excluded.append((path.name, f"Cscatter_average monitor log, {human_size(path.stat().st_size)}")) + elif path.stat().st_size == 0: + item.excluded.append((path.name, "empty file")) + else: + names_up.append(path.name) + + # The generator script is uploaded only if its settings agree with the log + script = folder / f"{codename}_Tmake_spectralfile.py" + if script.is_file(): + problems = script_mismatches(script, codename, info) + if problems: + item.excluded.append((script.name, "settings differ from the log: " + ", ".join(problems))) + else: + names_up.append(script.name) + else: + item.excluded.append((script.name, "not found")) + for name, why in item.excluded: + log.warning("%s: not uploading %s (%s)", item.key, name, why) + + item.files = [LocalFile(name=n, path=folder / n) for n in names_up] + for lf in item.files: + hash_file(lf, scan_nan=lf.name in (f"{codename}.sf", f"{codename}.sf_k")) + + sf, sfk, chk, chkk = item.files[:4] + + # BLAKE2b against the .chk files + for data, chkfile in ((sf, chk), (sfk, chkk)): + stored = chkfile.path.read_text().strip() + if stored != data.blake2b: + raise CheckError(f"{item.key}: BLAKE2b of {data.name} does not match {chkfile.name}") + + # No NaN in the files to be distributed + for lf in (sf, sfk): + if lf.nan_count: + raise CheckError(f"{item.key}: {lf.name} contains {lf.nan_count} 'NaN'") + + # Block 0 against the folder and the log + item.block0 = parse_block0(sf.path, formulae, names) + if item.block0["nband"] != nband: + raise CheckError(f"{item.key}: block 0 has {item.block0['nband']} bands") + + # No unfilled netCDF variable and no absurd value in the k-coefficient file + bad = scan_large_values(sfk.path) + if bad: + raise CheckError(f"{item.key}: {sfk.name} holds implausible values: " + + describe_large_values(bad, item.block0, nband)) + if info.nband != nband or info.alias != codename: + raise CheckError(f"{item.key}: log is for alias '{info.alias}' with {info.nband} bands") + if info.n_gases and info.n_gases != len(info.gases): + raise CheckError(f"{item.key}: log lists N={info.n_gases} gases but {len(info.gases)} gas lines") + if (sorted(item.block0["absorbers"]) != sorted(info.line_absorbers) + or sorted(g[0] for g in info.gases) != sorted(info.line_absorbers)): + raise CheckError(f"{item.key}: absorbers differ between block 0 {item.block0['absorbers']}, " + f"the log's gas list and its assembled list {info.line_absorbers}") + + def _pairs(lst): + return sorted(tuple(sorted(p.split("-"))) for p in lst) + if _pairs(item.block0["continua"]) != _pairs(info.continua): + raise CheckError(f"{item.key}: continua differ between block 0 {item.block0['continua']} " + f"and the log {info.continua}") + + # Compare with the packaged zip (Tpackage_spectralfile.py), if present + zpath = folder / f"{codename}.zip" + if zpath.is_file(): + with zipfile.ZipFile(zpath) as zf: + for lf in item.files: + try: + zi = zf.getinfo(lf.name) + except KeyError: + raise CheckError(f"{item.key}: {lf.name} is not in {zpath.name}") from None + if zi.file_size != lf.size or zi.CRC != lf.crc32: + raise CheckError(f"{item.key}: {lf.name} differs from its copy in {zpath.name}") + item.zip_checked = True + return item + + +# --------------------------------------------------------------------------- +# Metadata +# --------------------------------------------------------------------------- + +def display_name(name: str) -> str: + """'Family, Given' -> 'Given Family'.""" + if ", " in name: + family, given = name.split(", ", 1) + return f"{given} {family}" + return name + + +def source_name(src: str) -> str: + return SOURCE_NAMES.get(src.lower(), src) + + +def describe_html(item: Item, creator_name: str) -> str: + """Description in the style of the existing records, plus provenance from the log.""" + info, b0 = item.log, item.block0 + e = html.escape + sf, sfk = item.files[0], item.files[1] + + sources = [] + for _, src, _ in info.gases: + if source_name(src) not in sources: + sources.append(source_name(src)) + paras = [ + f"SOCRATES spectral file fitted to {e(' and '.join(sources))} opacities, " + f"created by {e(display_name(creator_name))}.", + f"Bands: {b0['nband']}.", + f"Line absorbers: {e(', '.join(b0['absorbers']))}.", + "Continuum absorbers: " + (e(", ".join(b0["continua"])) if b0["continua"] else "none") + ".", + ] + if info.droplets is not None: + paras.append("Water droplet scattering: " + ("included." if info.droplets else "not included.")) + if info.uv is not None: + paras.append("Ultraviolet cross-sections: " + ("included." if info.uv else "not included.")) + + gas_txt = "; ".join(f"{e(g)}: {e(source_name(s))}, maximum mass path {e(p)} kg/m2" + for g, s, p in info.gases) + paras.append(f"Line absorption data: {gas_txt}.") + if b0["continua"]: + cont_txt = "; ".join(f"{e(c)}: {e(info.continuum_sources.get(c, 'source not stated in the log'))}" + for c in b0["continua"]) + paras.append(f"Continuum data: {cont_txt}.") + + method = BAND_METHODS.get(info.method) + method_txt = f"{info.method}" + (f" ({e(method)})" if method else "") + build = info.build_time.strftime("%Y-%m-%d %H:%M:%S") + gen = (f"Generated with SOCRATES {e(info.socrates_version)} (git hash {e(info.git_hash)})" + + (f" and spectraltools {e(info.tools_version)}" if info.tools_version else "") + + f", run started {build} (time stamp of the generator log). " + f"Band-selection method {method_txt}; default maximum mass path {e(info.masspath)} kg/m2") + if info.numin: + gen += (f"; wavenumber range {e(info.numin)} to {e(info.numax)} cm-1, " + f"sampled at {e(info.dnu)} cm-1") + if info.n_tp: + gen += f"; {info.n_tp} pressure-temperature points" + paras.append(gen + ".") + + paras.append(f"BLAKE2b checksums (also in {e(sf.name.replace('.sf', '.chk'))} and " + f"{e(sfk.name.replace('.sf_k', '.chk_k'))}): " + f"{e(sf.name)} {sf.blake2b}; {e(sfk.name)} {sfk.blake2b}.") + has_script = any(lf.name.endswith("_Tmake_spectralfile.py") for lf in item.files) + programs = ["prep_spec", "Ccorr_k"] + (["Cscatter_average"] if any( + lf.name.endswith("_droplet.log") for lf in item.files) else []) + paras.append(f"Files: {e(sf.name)} and {e(sfk.name)} (spectral file and k-coefficients), " + "their checksums, the generator log, the logs of the SOCRATES programs run during the build " + f"({', '.join(programs[:-1])} and {programs[-1]})" + + (", and the generator script." if has_script else ".")) + paras.append(f'Documentation: PROTEUS spectral files reference ' + "in the SOCRATES documentation.") + return "".join(f"

{p}

" for p in paras) + + +def html_to_text(s: str) -> list: + s = s.replace("

", "\n") + s = re.sub(r'([^<]*)', r"\2 (\1)", s) + s = re.sub(r"<[^>]+>", "", s) + return [html.unescape(x) for x in s.splitlines() if x.strip()] + + +def build_metadata(item: Item, creator: dict, community: str) -> dict: + md = { + "upload_type": UPLOAD_TYPE, + "title": item.title, + "creators": [creator], + "description": describe_html(item, creator["name"]), + "access_right": ACCESS_RIGHT, + "license": LICENSE, + "keywords": list(KEYWORDS), + "version": item.log.build_time.strftime("%Y%m%dT%H%M%S"), + # The date the spectral file was built (time stamp of the generator log) + "publication_date": item.log.build_time.strftime("%Y-%m-%d"), + # Reserve the record's DOI on the draft, so that it is known before publishing. Zenodo returns it in + # metadata.prereserve_doi and registers it with DataCite only when the record is published. + "prereserve_doi": True, + "custom": {"code:codeRepository": REPO_URL}, + } + if community: + md["communities"] = [{"identifier": community}] + return md + + +# --------------------------------------------------------------------------- +# Records found on Zenodo during this run +# --------------------------------------------------------------------------- + +class Records: + """What this run has found or done on Zenodo for each record, keyed '/'. Nothing is + written to disk: the next run finds the drafts and published records again by title.""" + + def __init__(self): + self.data = {} + + def get(self, key: str) -> dict | None: + return self.data.get(key) + + def update(self, key: str, **values) -> None: + self.data.setdefault(key, {}).update(values) + + +# --------------------------------------------------------------------------- +# Zenodo client (legacy deposit API) +# --------------------------------------------------------------------------- + +class _UploadStream: + """File reader with a length (so requests sends Content-Length) and progress logging.""" + + def __init__(self, path: Path, size: int, name: str): + self._f = path.open("rb") + self._size = size + self._name = name + self._sent = 0 + self._next = 0.25 + + def __len__(self) -> int: + return self._size + + def __iter__(self): + while chunk := self.read(1 << 20): + yield chunk + + def read(self, n: int = -1) -> bytes: + chunk = self._f.read(n) + self._sent += len(chunk) + if self._size and self._sent / self._size >= self._next: + log.info(" %s: %3.0f%% sent", self._name, 100.0 * self._sent / self._size) + while self._sent / self._size >= self._next: + self._next += 0.25 + return chunk + + def close(self) -> None: + self._f.close() + + +def _strip_md5(checksum) -> str: + return str(checksum or "").removeprefix("md5:") + + +def _error_text(r) -> str: + try: + j = r.json() + msg = j.get("message", "") + errs = j.get("errors") + return f"{msg} {json.dumps(errs)}" if errs else str(msg) + except ValueError: + return r.text[:500] + + +class ZenodoClient: + def __init__(self, host: str, token: str, timeout: float): + import requests # only needed for network actions + self._requests = requests + self.host = host.rstrip("/") + self.api = self.host + "/api" + self.timeout = timeout + self.session = requests.Session() + self.session.headers.update({"Authorization": f"Bearer {token}", "User-Agent": USER_AGENT}) + + def _call(self, method: str, url: str, expect: tuple, retry: bool = True, **kw): + kw.setdefault("timeout", (CONNECT_TIMEOUT, self.timeout)) + for attempt in (1, 2, 3): + try: + r = self.session.request(method, url, **kw) + except self._requests.RequestException as exc: + raise ZenodoError(f"{method} {url} failed: {type(exc).__name__}: {exc}") from None + if r.status_code == 429 and retry and attempt < 3: + wait = r.headers.get("Retry-After") + try: + wait = float(wait) + except (TypeError, ValueError): + reset = r.headers.get("X-RateLimit-Reset") + wait = float(reset) - time.time() if reset and reset.isdigit() else 60.0 + wait = min(max(wait, 1.0), 120.0) + log.warning("Rate limited by Zenodo; waiting %.0f s", wait) + time.sleep(wait) + continue + if r.status_code in (401, 403) and r.status_code not in expect: + raise ZenodoError(f"{method} {url} returned HTTP {r.status_code}: {_error_text(r)} " + f"(the token was not accepted: check that it was created on {self.host} " + "with the scopes deposit:write and deposit:actions)") + if r.status_code not in expect: + raise ZenodoError(f"{method} {url} returned HTTP {r.status_code}: {_error_text(r)}") + return r + raise ZenodoError(f"{method} {url}: still rate limited after 3 attempts") + + def list_depositions(self, page_size: int = 25, max_pages: int = 200) -> list: + # Zenodo refuses a page size above 25 for any request it does not count as authenticated + # (HTTP 400), so pages of 25 are requested + out = [] + for page in range(1, max_pages + 1): + r = self._call("GET", f"{self.api}/deposit/depositions", (200,), + params={"size": page_size, "page": page}) + batch = r.json() + out.extend(batch) + if len(batch) < page_size: + break + else: + raise ZenodoError(f"More than {page_size * max_pages} depositions; increase max_pages") + return out + + def create(self) -> dict: + # POST is not idempotent: never retried, so a lost response cannot create two drafts + return self._call("POST", f"{self.api}/deposit/depositions", (201,), retry=False, json={}).json() + + def get(self, dep_id) -> dict: + return self._call("GET", f"{self.api}/deposit/depositions/{dep_id}", (200,)).json() + + def set_metadata(self, dep_id, metadata: dict) -> dict: + return self._call("PUT", f"{self.api}/deposit/depositions/{dep_id}", (200,), + json={"metadata": metadata}).json() + + def delete_file(self, dep_id, file_id) -> None: + self._call("DELETE", f"{self.api}/deposit/depositions/{dep_id}/files/{file_id}", (204,)) + + def upload(self, bucket: str, lf: LocalFile) -> dict: + stream = _UploadStream(lf.path, lf.size, lf.name) + try: + r = self._call("PUT", f"{bucket}/{quote(lf.name)}", (200, 201), retry=False, + data=stream, headers={"Content-Type": "application/octet-stream"}) + finally: + stream.close() + return r.json() + + def publish(self, dep_id) -> dict: + return self._call("POST", f"{self.api}/deposit/depositions/{dep_id}/actions/publish", + (202,), retry=False).json() + + def get_record(self, rec_id) -> dict | None: + try: + return self._call("GET", f"{self.api}/records/{rec_id}", (200,)).json() + except ZenodoError as exc: + log.warning("Could not read the published record: %s", exc) + return None + + +def _remote_files(dep: dict) -> dict: + out = {} + for f in dep.get("files") or []: + name = f.get("filename") or f.get("key") + out[name] = {"id": f.get("id"), "md5": _strip_md5(f.get("checksum")), + "size": int(f.get("filesize", f.get("size", -1)))} + return out + + +def sync_files(client: ZenodoClient, dep: dict, item: Item) -> dict: + """Upload missing or differing files, verify every MD5, and return the deposition.""" + dep_id = dep["id"] + bucket = (dep.get("links") or {}).get("bucket") + if not bucket: + raise ZenodoError(f"{item.key}: deposition {dep_id} has no bucket link") + expected = {lf.name: lf for lf in item.files} + remote = _remote_files(dep) + extra = sorted(set(remote) - set(expected)) + if extra: + raise ZenodoError(f"{item.key}: deposition {dep_id} holds unexpected files {extra}; " + "remove them on Zenodo, then run again") + for lf in item.files: + rf = remote.get(lf.name) + if rf and rf["md5"] == lf.md5 and rf["size"] == lf.size: + log.info(" %s: already uploaded, MD5 matches", lf.name) + continue + if rf: + log.warning(" %s: remote copy differs (MD5 %s), deleting it", lf.name, rf["md5"]) + client.delete_file(dep_id, rf["id"]) + log.info(" %s: uploading %s", lf.name, human_size(lf.size)) + t0 = time.time() + j = client.upload(bucket, lf) + got_md5, got_size = _strip_md5(j.get("checksum")), j.get("size") + if got_md5 != lf.md5 or (got_size is not None and int(got_size) != lf.size): + raise ZenodoError(f"{item.key}: {lf.name} uploaded with MD5 {got_md5} and size {got_size}, " + f"expected {lf.md5} and {lf.size}. Stopping.") + log.info(" %s: MD5 verified (%.0f s)", lf.name, time.time() - t0) + + # Independent check: list the deposition's files again + dep = client.get(dep_id) + remote = _remote_files(dep) + if set(remote) != set(expected): + raise ZenodoError(f"{item.key}: deposition {dep_id} lists {sorted(remote)}, " + f"expected {sorted(expected)}") + for name, lf in expected.items(): + if remote[name]["md5"] != lf.md5: + raise ZenodoError(f"{item.key}: {name} has MD5 {remote[name]['md5']} on Zenodo, " + f"expected {lf.md5}") + return dep + + +def prepare_draft(client: ZenodoClient, records: Records, item: Item, existing: dict) -> bool: + """Create the draft of one record, or resume the one with the same title, and upload its files. + False if a record with this title is already published.""" + matches = existing.get(item.title, []) + published = [d for d in matches if d.get("submitted")] + drafts = [d for d in matches if not d.get("submitted")] + if published: + log.info("%s: already published (deposition %s); not creating another", item.key, published[0]["id"]) + _record_published(client, records, item, published[0]) + return False + if len(drafts) > 1: + raise ZenodoError(f"{item.key}: {len(drafts)} drafts titled '{item.title}' exist " + f"({[d['id'] for d in drafts]}); delete the extra ones on Zenodo first") + if drafts: + dep = drafts[0] + log.info("%s: resuming draft %s", item.key, dep["id"]) + else: + dep = client.create() + log.info("%s: created draft %s", item.key, dep["id"]) + records.update(item.key, deposit_id=dep["id"], status="draft", + bucket=(dep.get("links") or {}).get("bucket"), + draft_url=(dep.get("links") or {}).get("html")) + + dep = client.set_metadata(dep["id"], item.metadata) + log.info("%s: metadata set", item.key) + kept = ((dep.get("metadata") or {}).get("custom") or {}).get("code:codeRepository") + if kept != REPO_URL: + log.warning("%s: Zenodo did not keep the repository URL (draft has %r); set it in the web form", + item.key, kept) + dep = sync_files(client, dep, item) + reserved = ((dep.get("metadata") or {}).get("prereserve_doi") or {}).get("doi") + if reserved: + log.info("%s: reserved DOI %s", item.key, reserved) + else: + log.warning("%s: Zenodo did not return a reserved DOI for draft %s", item.key, dep["id"]) + records.update(item.key, deposit_id=dep["id"], status="draft", + bucket=(dep.get("links") or {}).get("bucket"), + draft_url=(dep.get("links") or {}).get("html"), + reserved_doi=reserved) + log.info("%s: draft complete, all files verified", item.key) + return True + + +def _record_published(client: ZenodoClient, records: Records, item: Item, dep: dict) -> None: + rec_id = dep.get("record_id") or dep.get("id") + doi = dep.get("doi") or (dep.get("metadata") or {}).get("doi") + reserved = (records.get(item.key) or {}).get("reserved_doi") + if reserved and doi and doi.lower() != reserved.lower(): + log.warning("%s: published with DOI %s, not the reserved DOI %s", item.key, doi, reserved) + url = (dep.get("links") or {}).get("record_html") or f"{client.host}/records/{rec_id}" + records.update(item.key, deposit_id=dep.get("id"), record_id=rec_id, status="published", + record_url=url, doi=doi) + + +def publish_one(client: ZenodoClient, records: Records, item: Item, community: str) -> None: + entry = records.get(item.key) + dep_id = entry["deposit_id"] + # Re-check the draft immediately before the irreversible step + dep = client.get(dep_id) + if dep.get("submitted"): + _record_published(client, records, item, dep) + return + remote = _remote_files(dep) + if {k: v["md5"] for k, v in remote.items()} != {lf.name: lf.md5 for lf in item.files}: + raise ZenodoError(f"{item.key}: files of draft {dep_id} changed since upload; not publishing") + title = dep.get("title") or (dep.get("metadata") or {}).get("title") + if title != item.title: + raise ZenodoError(f"{item.key}: draft {dep_id} is titled '{title}'; not publishing") + dep = client.publish(dep_id) + _record_published(client, records, item, dep) + entry = records.get(item.key) + log.info("%s: published %s (DOI %s)", item.key, entry["record_url"], entry.get("doi")) + + if community: + rec = client.get_record(entry["record_id"]) + comms = [c.get("id") or c.get("identifier") for c in ((rec or {}).get("metadata") or {}).get("communities", [])] + if community in comms: + log.info("%s: record is in community '%s'", item.key, community) + records.update(item.key, community=community, community_status="included") + else: + log.warning("%s: record does not list community '%s' yet; the request may await a curator", + item.key, community) + records.update(item.key, community=community, community_status="pending or unknown") + + +# --------------------------------------------------------------------------- +# Output +# --------------------------------------------------------------------------- + +def print_item(item: Item, show_json: bool) -> None: + md = item.metadata + p = print + p(f"== {item.title}") + p(f" folder: {item.folder}") + c = md["creators"][0] + p(f" title: {md['title']}") + p(f" version: {md['version']}") + p(f" date: {md['publication_date']} (publication date: build date of the file)") + p(f" DOI request: {'reserve on upload' if md.get('prereserve_doi') else 'none'}") + p(f" repository: {(md.get('custom') or {}).get('code:codeRepository', '(none)')}") + p(f" creator: {c['name']}; ORCID {c.get('orcid', '(none)')}; " + f"affiliation {c.get('affiliation', '(none)')}") + p(f" type: {md['upload_type']}; access {md['access_right']}; licence {md['license']}") + p(f" keywords: {', '.join(md['keywords'])}") + p(f" communities: {', '.join(x['identifier'] for x in md.get('communities', [])) or '(none)'}") + p(" description:") + for line in html_to_text(md["description"]): + p(f" | {line}") + p(f" files ({len(item.files)}, {human_size(item.total_size)}):") + w = max(len(lf.name) for lf in item.files) + for lf in item.files: + p(f" {lf.name:<{w}} {lf.size:>11d} B md5 {lf.md5}") + for name, why in item.excluded: + p(f" NOT uploaded: {name}: {why}") + checks = ["block 0 = log (bands, absorbers, continua)", "BLAKE2b = .chk/.chk_k", "no NaN in .sf/.sf_k", + f"no netCDF fill value or value > {K_LIMIT:.0e} in .sf_k"] + checks.append("files = zip members (size, CRC32)" if item.zip_checked else "no zip to compare") + p(f" checks: {'; '.join(checks)}") + if show_json: + p(" metadata JSON:") + for line in json.dumps({"metadata": md}, indent=2).splitlines(): + p(f" {line}") + p("") + + +def print_table(items: list, records: Records) -> None: + print("| Codename | Bands | Download | DOI |") + print("|----------|-------|----------|-----|") + for item in items: + entry = records.get(item.key) + if entry and entry.get("status") == "published": + url = f"[{item.codename} {item.nband} on Zenodo]({entry.get('record_url', '')})" + doi = entry.get("doi") or "" + elif entry: + url = f"(draft) {entry.get('draft_url') or entry.get('deposit_id')}" + doi = f"{entry['reserved_doi']} (reserved)" if entry.get("reserved_doi") else "" + else: + url, doi = "(not uploaded)", "" + print(f"| {item.codename} | {item.nband} | {url} | {doi} |") + + # Bands cells for the table in docs/Reference/proteus_spectral_file_reference.md, one row per codename, + # with each published band count linked to its record + print("") + print("| Codename | Bands |") + print("|----------|-------|") + for codename in dict.fromkeys(item.codename for item in items): + cells = [] + for item in sorted((i for i in items if i.codename == codename), key=lambda i: -i.nband): + entry = records.get(item.key) + if entry and entry.get("status") == "published": + cells.append(f"[{item.nband}]({entry.get('record_url', '')} \"{codename} {item.nband} on Zenodo\")") + else: + cells.append(f"{item.nband}") + print(f"| {codename} | {', '.join(cells)} |") + + +def confirm(question: str, answer: str, assume_yes: bool) -> bool: + if assume_yes: + return True + if not sys.stdin.isatty(): + log.error("Confirmation needed but stdin is not a terminal; pass --yes to proceed") + return False + return input(f"{question} Type '{answer}' to continue: ").strip() == answer + + +# --------------------------------------------------------------------------- +# Main +# --------------------------------------------------------------------------- + +def parse_args(argv=None) -> argparse.Namespace: + p = argparse.ArgumentParser( + prog="Tupload_zenodo.py", + description="Upload PROTEUS spectral files (one Zenodo record per codename and band count) " + "to Zenodo and the PROTEUS community. Without --upload this is a dry run that " + "makes no network request.", + epilog=__doc__.split("Steps\n-----\n", 1)[1], + formatter_class=argparse.RawDescriptionHelpFormatter) + p.add_argument("root", type=Path, + help="folder holding // sub-folders, e.g. .../nogit_new_spectralfiles") + p.add_argument("--family", nargs="+", metavar="CODENAME", + help="only these families (default: every family found below ROOT)") + p.add_argument("--nband", nargs="+", type=int, metavar="N", + help="only these band counts (default: every band count found)") + tgt = p.add_mutually_exclusive_group() + tgt.add_argument("--sandbox", dest="target", action="store_const", const="sandbox", + help="target %s with $%s (the default)" % (HOSTS["sandbox"], TOKEN_VARS["sandbox"])) + tgt.add_argument("--production", dest="target", action="store_const", const="production", + help="target %s with $%s" % (HOSTS["production"], TOKEN_VARS["production"])) + p.set_defaults(target="sandbox") + p.add_argument("--upload", action="store_true", + help="create or resume drafts and upload the files (default: dry run)") + p.add_argument("--publish", action="store_true", + help="publish the drafts after their files are verified; needs --upload. " + "A published record cannot be deleted") + p.add_argument("--yes", action="store_true", + help="do not ask for confirmation before production actions") + p.add_argument("--community", default=None, + help=f"community identifier (default: {COMMUNITY} on production, none on the sandbox, " + "where it does not exist); '' for none") + p.add_argument("--creator", default=None, + help="creator as 'Family, Given' (required with --upload)") + p.add_argument("--orcid", default="", + help="creator ORCID (default: none)") + p.add_argument("--affiliation", default="", + help="creator affiliation (default: none)") + p.add_argument("--timeout", type=float, default=900.0, + help="read timeout of each request in seconds (default: %(default)s)") + p.add_argument("--show-json", action="store_true", + help="also print the metadata JSON that would be sent") + args = p.parse_args(argv) + if args.publish and not args.upload: + p.error("--publish needs --upload (drafts are created or resumed and verified first)") + if args.upload and not args.creator: + p.error("--upload needs --creator") + return args + + +def main(argv=None) -> int: + args = parse_args(argv) + root_logger = logging.getLogger() + root_logger.setLevel(logging.INFO) + console = logging.StreamHandler() + console.setFormatter(_LOG_FORMAT) + root_logger.addHandler(console) + + host = HOSTS[args.target] + community = args.community if args.community is not None else ( + COMMUNITY if args.target == "production" else "") + creator = {"name": args.creator or "(not set; use --creator)"} + if args.affiliation: + creator["affiliation"] = args.affiliation + if args.orcid: + creator["orcid"] = args.orcid + root = args.root.absolute() + + # 1. Discover and check (offline) + try: + formulae, names = read_gas_list(gas_list_path()) + found = discover(root, args.family, args.nband) + except CheckError as exc: + log.error("%s", exc) + return 1 + log.info("Checking %d records below %s", len(found), root) + items, errors = [], [] + for codename, nband, folder in found: + try: + item = build_item(codename, nband, folder, formulae, names) + item.metadata = build_metadata(item, creator, community) + items.append(item) + except (CheckError, OSError, zipfile.BadZipFile) as exc: + msg = str(exc) + errors.append(msg if msg.startswith(f"{codename}/{nband}:") else f"{codename}/{nband}: {msg}") + for e in errors: + log.error("%s", e) + if errors and (args.upload or not items): + log.error("%d of %d records failed the checks; nothing done. Fix them, or leave them out " + "with --family/--nband", len(errors), len(found)) + return 1 + + print("") + for item in items: + print_item(item, args.show_json) + nfiles = sum(len(i.files) for i in items) + total = sum(i.total_size for i in items) + largest = max((lf for i in items for lf in i.files), key=lambda lf: lf.size) + print(f"Target: {host} ({args.target}); community: {community or '(none)'}") + print(f"Records: {len(items)} passed the checks, {len(errors)} failed; files: {nfiles}; " + f"total {human_size(total)} ({total} B); " + f"largest file {human_size(largest.size)} ({largest.path.parent.parent.name}/" + f"{largest.path.parent.name}/{largest.name})") + if not args.creator: + print("Note: no creator set (use --creator; required with --upload)") + if not args.affiliation: + print("Note: no creator affiliation set (use --affiliation to add one)") + + # 2. Dry run + if not args.upload: + print("\nDry run: no network request made and no file written. " + "Use --upload to create drafts (sandbox unless --production).") + if errors: + print(f"\nFAILED the checks ({len(errors)} records; --upload refuses to run while " + "any selected record fails):") + for e in errors: + print(f" - {e}") + return 1 + return 0 + + # 3. Network actions + token = os.environ.get(TOKEN_VARS[args.target], "").strip() + if not token: + log.error("Set the environment variable %s to a Zenodo access token for %s " + "(scopes deposit:write and deposit:actions)", TOKEN_VARS[args.target], host) + return 1 + if args.target == "production" and not confirm( + f"\nThis will create or update {len(items)} draft records on {host} and upload " + f"{human_size(total)}{' (publishing is asked separately)' if args.publish else ''}.", + "yes", args.yes): + log.info("Aborted; nothing done") + return 1 + + logfile = root / f"Tupload_zenodo_{args.target}_{dt.datetime.now():%Y%m%dT%H%M%S}.log" + fh = logging.FileHandler(logfile, mode="w") + fh.setFormatter(_LOG_FORMAT) + root_logger.addHandler(fh) + log.info("Logging to %s", logfile) + + client = ZenodoClient(host, token, args.timeout) + del token + status = 0 + ready = [] + records = Records() + try: + # Zenodo is the only record of earlier runs: drafts and published records are found by title + existing = {} + log.info("Listing your depositions to find drafts and records made earlier") + for d in client.list_depositions(): + t = d.get("title") or (d.get("metadata") or {}).get("title") + existing.setdefault(t, []).append(d) + for item in items: + if prepare_draft(client, records, item, existing): + ready.append(item) + + if args.publish and ready: + if args.target == "production" and not confirm( + f"\nPublish {len(ready)} records on {host}? Published records get a DOI and " + "cannot be deleted.", "publish", args.yes): + log.info("Not publishing; the drafts stay as they are") + else: + for item in ready: + publish_one(client, records, item, community) + elif ready: + log.info("%d drafts ready; not published (use --publish)", len(ready)) + except ZenodoError as exc: + log.error("%s", exc) + log.error("Stopped. Run the same command again to resume: drafts are found again by title") + status = 1 + except KeyboardInterrupt: + log.error("Interrupted. Run the same command again to resume: drafts are found again by title") + status = 1 + + print("") + print_table(items, records) + return status + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/spectraltools/src/cross.py b/spectraltools/src/cross.py index e3cd14b8..74639da9 100644 --- a/spectraltools/src/cross.py +++ b/spectraltools/src/cross.py @@ -3,9 +3,7 @@ # Libraries import logging import numpy as np -import struct import os -import io # Files import src.phys as phys @@ -119,41 +117,30 @@ def readbin(self, UV:bool, numin=0.0, numax=np.inf, dnu=0.0): if not os.access(self.fname, os.R_OK): raise Exception("Cannot read file '%s'" % self.fname) - # get number of bins - nbins = 0 - with open(self.fname, "rb") as hdl: - hdl.seek(0, io.SEEK_END) - nbins = int(hdl.tell()/4) + # Read filename info + self.parse_binname() + res = 0.01 # expected resolution from DACE [cm-1] + + # Get cross-sections for each bin (native-endian Float32, as written by dace.download) + k_read = np.fromfile(self.fname, dtype=np.float32) + nbins = len(k_read) # check value is reasonable if (nbins < 100) or (nbins > 1e12): raise Exception("Error reading DACE file; too many/few bins.") - self.nbins = nbins - - # Get cross-sections for each bin - k_read = [] - with open(self.fname, "rb") as hdl: - for _ in range(nbins): - k_read.append(struct.unpack('f', hdl.read(4))[0]) # 4 bytes at a time (Float32) - - # Check lengths - if len(k_read) != self.nbins: - raise Exception("Invalid array length when reading DACE bin file") - - # Read filename info - self.parse_binname() - # Set nu array - res = 0.01 # expected resolution from DACE [cm-1] + # check file is complete, given the wavenumber range in its name + nbins_expect = int(round((self.numax - self.numin) / res)) + if nbins != nbins_expect: + raise Exception("DACE file '%s' has %d bins but its name implies %d; incomplete download?" + % (self.fname, nbins, nbins_expect)) + self.nbins = nbins - tmp_nu = [] - tmp_k = [] - nulast = -999999999.0 - for i, nu in enumerate(np.arange(self.numin, self.numax, res)): - if (numin <= nu <= numax) and (nu + dnu > nulast): - tmp_nu.append(nu) - tmp_k.append(k_read[i]) - nulast= nu + # Set nu array, and clip to range + nu_read = self.numin + res * np.arange(nbins) + mask = (numin <= nu_read) & (nu_read <= numax) + tmp_nu = nu_read[mask].tolist() + tmp_k = k_read[mask].astype(float).tolist() ### UV ADD-ON ### # Reads the UV files from the moleculesUV folder @@ -224,7 +211,22 @@ def readUV(formula:str, tmp_nu:list, tmp_k:list, res:float, wavenumber_min:float tmp_nu, tmp_k = readUV(self.form, tmp_nu, tmp_k, res, wavenumber_min) except TypeError: None - + + # Resample onto a grid of multiples of dnu, if coarser than native resolution. + # This matches the ExoCross grid (e.g. 10.000, 10.025, ...) so that sources can be mixed. + # Nearest-neighbour is used rather than linear interpolation: lines narrower than the + # native grid would otherwise be smeared onto midpoints, which biases the k-distribution. + if dnu > res * (1.0 + 1.0e-6): + nu_src = np.array(tmp_nu, dtype=float) + jmin = int(np.ceil(nu_src[0] / dnu - 1.0e-6)) + jmax = int(np.floor(nu_src[-1] / dnu + 1.0e-6)) + nu_new = dnu * np.arange(jmin, jmax + 1) + i = np.clip(np.searchsorted(nu_src, nu_new), 1, len(nu_src) - 1) + i = np.where(nu_new - nu_src[i-1] < nu_src[i] - nu_new - 1.0e-9, i - 1, i) + tmp_k = np.array(tmp_k, dtype=float)[i].tolist() + tmp_nu = nu_new.tolist() + res = dnu + # derive k limit dynamically self.tmp_k = np.array(tmp_k, dtype=float) if len(self.tmp_k) < 2: @@ -319,7 +321,7 @@ def readsigma(self, numin:float=0.0, numax:float=np.inf, dnu:float=0.0): tmp_k = [] nulast = -999999999.0 for i,nu in enumerate(self.arr_nu): - if (numin <= nu <= numax) and (nu + dnu > nulast): + if (numin <= nu <= numax) and (nu - nulast > dnu * (1.0 - 1.0e-6)): tmp_nu.append(nu) tmp_k.append(self.arr_k[i]) nulast= nu @@ -381,7 +383,7 @@ def readexocross(self, numin:float=0.0, numax:float=np.inf, dnu:float=0.0): tmp_k = [] nulast = -999999999.0 for i,nu in enumerate(self.arr_nu): - if (numin <= nu <= numax) and (nu + dnu > nulast): + if (numin <= nu <= numax) and (nu - nulast > dnu * (1.0 - 1.0e-6)): tmp_nu.append(nu) tmp_k.append(self.arr_k[i]) nulast= nu @@ -409,7 +411,7 @@ def readdirect(self, p:float, t:float, nu_arr:list, k_arr:list, numin:float=0.0, tmp_k = [] nulast = -999999999.0 for i,nu in enumerate(nu_arr): - if (numin <= nu <= numax) and (nu + dnu > nulast): + if (numin <= nu <= numax) and (nu - nulast > dnu * (1.0 - 1.0e-6)): tmp_nu.append(nu) tmp_k.append(k_arr[i]) nulast= nu diff --git a/spectraltools/src/phys.py b/spectraltools/src/phys.py index 3f68c77c..b7ca0bdd 100644 --- a/spectraltools/src/phys.py +++ b/spectraltools/src/phys.py @@ -71,7 +71,7 @@ def iso_to_formula(iso:str): "CFC113" :"CFC113", "HCFC22" :"HCFC22", "HFC125" :"HFC125", - "HFC134A" :"HFC134a", + "HFC134A" :"HFC134A", "CFC114" :"CFC114", "Titanium oxide" :"TiO", "Vanadium oxide" :"VO", @@ -90,7 +90,7 @@ def iso_to_formula(iso:str): "Hydrogen cyanide" :"HCN", "Hydrogen sulphide" :"H2S", "Argon" :"Ar", - "Dry air" :"Dry air", + "Dry air" :"AIR", "Atomic oxygen" :"O", "Atomic nitrogen" :"N", "Nitrate radical" :"NO3", @@ -105,9 +105,9 @@ def iso_to_formula(iso:str): "Semiheavy water" :"HDO", "Hydrogen chloride" :"HCl", "Hydrogen fluoride" :"HF", - "cis-OSSO" :"cis-OSSO", - "trans-OSSO" :"trans-OSSO", - "OSO-S" :"OSO-S", + "cis-OSSO" :"cOSSO", + "trans-OSSO" :"tOSSO", + "OSO-S" :"yOSOS", "Acetaldehyde" :"CH3CHO", "Methylhydroperoxide" :"CH3OOH", "Acetone" :"CH3COCH3", @@ -193,35 +193,35 @@ def chemsafe(name:str): "NH3" : 17.0306, "HNO3" : 63.0129, "N2" : 28.0134, - "CFC11" : 137.368, - "CFC12" : 120.914, - "CFC113" : 187.376, - "HCFC22" : 86.4689, - "HFC125" : 120.022, - "HFC134a" : 102.031, + "CFC11" : 137.3686, + "CFC12" : 120.9140, + "CFC113" : 187.3765, + "HCFC22" : 86.46892, + "HFC125" : 120.02227, + "HFC134A" : 102.03184, "CFC114" : 170.921, "TiO" : 63.866, "VO" : 66.9409, "H2" : 2.01588, - "He" : 4.00260, + "He" : 4.002602, "OCS" : 60.075, - "Na" : 22.9897, + "Na" : 22.98976928, "K" : 39.0983, "FeH" : 56.853, "CrH" : 53.004, "Li" : 6.941, "Rb" : 85.4678, - "Cs" : 132.905, - "PH3" : 33.9975, + "Cs" : 132.9054519, + "PH3" : 33.99758, "C2H2" : 26.0373, "HCN" : 27.0253, "H2S" : 34.081, "Ar" : 39.948, - "Dry air" : 28.966, + "AIR" : 28.966, "O" : 15.9994, - "N" : 14.0067, + "N" : 14.00674, "NO3" : 63.0128, - "N2O5" : 108.010, + "N2O5" : 108.0104, "HONO" : 47.0134, "HO2NO2" : 79.0122, "H2O2" : 34.0147, @@ -231,10 +231,10 @@ def chemsafe(name:str): "HO2" : 33.0067, "HDO" : 19.0214, "HCl" : 36.461, - "HF" : 20.0068, - "cis-OSSO" : 96.129, - "trans-OSSO": 96.129, - "OSO-S" : 96.129, + "HF" : 20.00689, + "cOSSO" : 96.129, + "tOSSO" : 96.129, + "yOSOS" : 96.129, "CH3CHO" : 44.0526, "CH3OOH" : 48.0413, "CH3COCH3" : 58.0791, @@ -245,7 +245,7 @@ def chemsafe(name:str): "C2H5COCH3" : 72.1057, "MVK" : 70.0898, "MACR" : 70.0898, - "PAN" : 121.048, + "PAN" : 121.0489, "CH3ONO2" : 77.0394, "C2H3" : 27.0452, "C2H4" : 28.0532, @@ -257,31 +257,31 @@ def chemsafe(name:str): "N2O3" : 76.0116, "SiO" : 44.0849, "Si" : 28.0855, - "TiO2" : 79.8658, + "TiO2" : 79.8660, "Ca" : 40.0780, - "CaO" : 56.0774, + "CaO" : 56.0770, "AlO" : 42.9809, "NaOH" : 39.9971, "KOH" : 56.1056, - "H-" : 1.00794, - "PS" : 63.0389, + "H-" : 1.0085, + "PS" : 63.0390, "PO" : 46.9732, "PN" : 44.9805, - "CH3SH" : 48.1075, - "CH3S" : 47.0996, - "C2H6S" : 62.1343, - "C2H6S2" : 94.1994, + "CH3SH" : 48.1070, + "CH3S" : 47.1000, + "C2H6S" : 62.1340, + "C2H6S2" : 94.1990, "C3H4" : 40.0638, - "C4H3" : 51.0717, + "C4H3" : 51.0680, "SiH4" : 32.1173, - "S2" : 64.1302, - "SF6" : 146.0554, - "CS2" : 76.1409, - "S8" : 256.5208, + "S2" : 64.1300, + "SF6" : 146.0550, + "CS2" : 76.1410, + "S8" : 256.5200, "CN" : 26.0174, - "CH3Cl" : 50.4875, + "CH3Cl" : 50.4880, "CH3F" : 34.0329, - "CH3Br" : 94.9385, + "CH3Br" : 94.9390, "SiO2" : 60.0843, "Fe" : 55.8450, "FeO" : 71.8440, diff --git a/spectraltools/src/spectral.py b/spectraltools/src/spectral.py index 8ed351d4..8ebdcd89 100644 --- a/spectraltools/src/spectral.py +++ b/spectraltools/src/spectral.py @@ -3,8 +3,10 @@ import logging import numpy as np import os +import re import subprocess import time +from netCDF4 import Dataset import src.utils as utils import src.phys as phys import src.netcdf as netcdf @@ -12,7 +14,7 @@ log = logging.getLogger("fwl."+__name__) CCORRK_NPROC = 40 # Number of processes to use for Ccorr_k. -CCORRK_MAXPATH = 1.0e1 # Maximum absorptive pathlength (kg/m2) for the gas. +CCORRK_MAXPATH = 1.0e3 # Default maximum absorptive pathlength (kg/m2) for the gas. Also used for CIA pairs (kg2/m5). CCORRK_CIA_CUTOFF = 2500.0 # Line cutoff [m-1] # Tolerence type for Ccorr_k when calculating k-terms. Options: @@ -41,14 +43,23 @@ BANDS_TMPS = [(180.0,0.45), (1800.0,0.3), (6500.0,0.25)] # (temperature, weight) pairs for method=5 # Version of MT-CKD continua to use. Options: mt_ckd3p2, mt_ckd4p3 +# mt_ckd3p2 uses text tables at 296 K and 260 K, which Ccorr_k interpolates exponentially in temperature. +# mt_ckd4p3 uses the reference netCDF file from MT_CKD for both temperatures, so that Ccorr_k applies +# its temperature exponents, (296/T)^texp. Both hold coefficients without the radiation term +# nu*tanh(hc*nu/2kT), which Ccorr_k applies itself. MT_CKD_VERSION = "mt_ckd4p3" +MT_CKD_FILES = { + "mt_ckd3p2": ("mt_ckd3p2_s296", "mt_ckd3p2_s260"), + "mt_ckd4p3": ("absco-ref_wv-mt-ckd4p3.nc", "absco-ref_wv-mt-ckd4p3.nc"), +} # Minimum CIA temperature when H2O is included [K]. # Planck weights exp(-hc*nu/kT) underflow for hc*nu/kT > ~708, i.e. T < ~40 K at 19900 cm-1 CIA_TMIN_H2O = 50.0 -# Replace NaN values in the cross-section data with zeros -REPLACE_NAN = True +# Replace NaN values in the assembled spectral file. NaNs in the k-table are filled from +# valid neighbours in temperature (see fill_nan_lookup); any others are set to zero. +REPLACE_NAN = True # Pade fit coefficients for water droplet scattering. PADE_FIT_MIN = "1.50000E-06" @@ -329,7 +340,7 @@ def read_ckd_range(ckdpath:str) -> list: Parameters ---------- ckdpath : str - Path to MT_CKD continuum file + Path to MT_CKD continuum file: a text table, or the reference netCDF file Returns ------- @@ -337,6 +348,11 @@ def read_ckd_range(ckdpath:str) -> list: Start and end of table, in units of [cm-1] """ + if ckdpath.endswith(".nc"): + with Dataset(ckdpath, "r") as ds: + nu = np.array(ds.variables["wavenumbers"][:], dtype=float) + return [float(nu[0]), float(nu[-1])] + nu_start = None nu_end = None with open(ckdpath,'r') as hdl: @@ -352,6 +368,66 @@ def read_ckd_range(ckdpath:str) -> list: return [nu_start, nu_end] +def write_cia_fixed(path_in:str, path_out:str) -> int: + """Rewrite a HITRAN CIA file in the fixed columns that Ccorr_k reads. + + Ccorr_k reads each CIA header as (a20,2f10.4,i7,f7.2,...) and each data line as + (f10.4,1x,e10.3). Several HITRAN files do not follow these columns: some write the + wavenumber limits and temperature as integers, which an F edit descriptor reads with + an implied decimal point (e.g. 296 becomes 2.96 K); some write five-digit mantissas, + which lose the last digit of the exponent; and some have left-aligned columns. Here + each line is split on whitespace and written back in the expected columns. Fields of + the header after the temperature are not used by Ccorr_k and are left blank. + + Parameters + ---------- + path_in : str + Path to the HITRAN CIA file + path_out : str + Path to the rewritten file + + Returns + ------- + int + Number of data sets written + """ + + with open(path_in,'r') as hdl: + lines = [l.strip() for l in hdl.readlines()] + + out = [] + nset = 0 + i = 0 + while i < len(lines): + if lines[i] == "": + i += 1 + continue + + # header: name, wavenumber min and max [cm-1], number of points, temperature [K], ... + tok = lines[i].split() + npts = int(tok[3]) + line = "%20s%10.4f%10.4f%7d%7.2f" % (tok[0][:20], float(tok[1]), float(tok[2]), npts, float(tok[4])) + if len(line) != 54: + raise Exception("CIA header does not fit Ccorr_k's columns in '%s': '%s'"%(path_in, lines[i])) + out.append(line) + + # data: wavenumber [cm-1], cross-section [cm5 molecule-2] + for l in lines[i+1:i+1+npts]: + nu, xs = l.split()[:2] + line = "%10.4f %10.3E" % (float(nu), float(xs)) + if len(line) != 21: + raise Exception("CIA value does not fit Ccorr_k's columns in '%s': '%s'"%(path_in, l)) + out.append(line) + + i += npts + 1 + nset += 1 + + with open(path_out,'w') as hdl: + hdl.write("\n".join(out) + "\n") + + return nset + + def create_skeleton(alias:str, p_points:np.ndarray, t_points:np.ndarray, volatile_list:list, band_edges:list, dry:bool=False): @@ -524,7 +600,7 @@ def create_skeleton(alias:str, p_points:np.ndarray, t_points:np.ndarray, log.info(" done writing to '%s'", skel_path) return skel_path -def calc_kcoeff_lbl(alias:str, formula:str, nc_xsc_path:str, dry:bool=False): +def calc_kcoeff_lbl(alias:str, formula:str, nc_xsc_path:str, dry:bool=False, maxpath:float=None): """Calculate k-coefficients for line absorption Takes netCDF file containing cross-sections as input. Outputs k-terms at given p,t points and bands specified in the skeleton file @@ -540,6 +616,8 @@ def calc_kcoeff_lbl(alias:str, formula:str, nc_xsc_path:str, dry:bool=False): dry : bool Dry run? + maxpath : float + Maximum absorptive pathlength [kg/m2] for this gas. Uses CCORRK_MAXPATH if None. Returns ---------- @@ -570,6 +648,9 @@ def calc_kcoeff_lbl(alias:str, formula:str, nc_xsc_path:str, dry:bool=False): formula = formula.strip() absid = utils.absorber_id[formula] + if maxpath is None: + maxpath = CCORRK_MAXPATH + log.info(" maxpath: %.2e kg/m2", maxpath) kcoeff_path = os.path.join(utils.dirs["output"],"%s_%s_lbl.sf_k"%(alias,formula)); utils.rmsafe(kcoeff_path) monitor_path = os.path.join(utils.dirs["output"],"%s_%s_mon.log"%(alias,formula)); utils.rmsafe(monitor_path) @@ -603,7 +684,7 @@ def calc_kcoeff_lbl(alias:str, formula:str, nc_xsc_path:str, dry:bool=False): f.write("Ccorr_k") f.write(" -F %s"%pt_lbl) # (Input) Pathname of file containing pressures and temperatures at which to calculate coefficients. f.write(" -R %d %d"%(iband[0],iband[1])) # The range of spectral bands to be used - f.write(" -l %s %.3e"%(absid, CCORRK_MAXPATH)) # Generate line absorption data. gas is the type number (identifier) of the gas to be considered. max−path is the maximum absorptive pathlength (kg/m2) for the gas + f.write(" -l %s %.3e"%(absid, maxpath)) # Generate line absorption data. gas is the type number (identifier) of the gas to be considered. max−path is the maximum absorptive pathlength (kg/m2) for the gas f.write(" -tt %.3e"%CCORRK_TRANSPARENT_TOL) # Threshold below which a band is treated as transparent match CCORRK_LBL_TOLTYPE: @@ -695,8 +776,10 @@ def calc_kcoeff_cia(alias:str, formula_A:str, formula_B:str, dnu:float, dry:bool if both_water: lbl_map_path = os.path.join(utils.dirs["output"],"%s_H2O_map.nc"% alias) - mt_ckd_296 = os.path.join( utils.dirs["socrates"], "data", "continua", MT_CKD_VERSION+"_s296") - mt_ckd_260 = os.path.join( utils.dirs["socrates"], "data", "continua", MT_CKD_VERSION+"_s260") + if MT_CKD_VERSION not in MT_CKD_FILES: + raise Exception("Invalid MT_CKD_VERSION: '%s'"%MT_CKD_VERSION) + mt_ckd_296 = os.path.join( utils.dirs["socrates"], "data", "continua", MT_CKD_FILES[MT_CKD_VERSION][0]) + mt_ckd_260 = os.path.join( utils.dirs["socrates"], "data", "continua", MT_CKD_FILES[MT_CKD_VERSION][1]) check_files.extend([lbl_map_path, mt_ckd_260, mt_ckd_296]) else: db_cia = os.path.join(utils.dirs["cia"], pair_str+".cia") @@ -794,9 +877,14 @@ def calc_kcoeff_cia(alias:str, formula_A:str, formula_B:str, dnu:float, dry:bool log.info(" Using HITRAN CIA database") + # Copy of the database in the columns that Ccorr_k reads + db_fixed = os.path.join(utils.dirs["output"],"%s_%s.cia"%(alias,pair_str)); utils.rmsafe(db_fixed) + nset = write_cia_fixed(db_cia, db_fixed) + log.info(" rewrote %d data sets to '%s'", nset, db_fixed) + f.write("Ccorr_k") f.write(" -F %s"%pt_cia) - f.write(" -CIA %s"%db_cia) + f.write(" -CIA %s"%db_fixed) f.write(" -R %d %d"%(iband[0], iband[1])) f.write(" -i %.3f"%dnu) f.write(" -ct %s %s %.3e"%(pair_ids[0], pair_ids[1], CCORRK_MAXPATH)) @@ -907,6 +995,151 @@ def calc_waterdroplets(alias:str, dry:bool=False): return fit_path +def _fmt_e13(x:float) -> str: + """Format a value like Fortran 1PE13.6, as read back by read_spectrum.""" + s = "%.6E" % x + m, e = s.split("E") + if len(e) > 3: + # Fortran Ew.d drops the 'E' for exponents beyond two digits + s = m + e + return "%13s" % s + +def _parse_fortran_float(tok:str) -> float: + """Parse a number written with Fortran E editing, including the form 1.0-120.""" + try: + return float(tok) + except ValueError: + return float(re.sub(r"(?<=[0-9.])([+-][0-9]+)$", r"E\1", tok)) + +def _parse_fortran_line(line:str) -> np.ndarray: + """Parse all numbers on a line of Fortran E-edited values.""" + return np.array([_parse_fortran_float(t) for t in line.split()], dtype=float) + +def _read_lookup_numbers(lines:list, i:int, n:int): + """Read n whitespace-separated numbers starting at line i. Returns (values, next line).""" + vals = [] + while len(vals) < n: + vals += list(_parse_fortran_line(lines[i])) + i += 1 + if len(vals) != n: + raise Exception("Unexpected number of values in lookup table near line %d" % i) + return np.array(vals, dtype=float), i + +def _is_numeric_line(line:str) -> bool: + """Whether a line is non-empty and holds only numbers (including NaN).""" + if len(line.split()) == 0: + return False + try: + _parse_fortran_line(line) + except ValueError: + return False + return True + +def fill_nan_lookup(kpath:str) -> tuple: + """Fill NaN values in the k-coefficient lookup tables of an assembled spectral file. + + Ccorr_k can give NaN k-terms where its Planck weights underflow at low temperature + (exp(-hc*nu/kT) < ~1e-308, e.g. T=25 K for nu > ~12300 cm-1). Each NaN is replaced + by linear interpolation in temperature along its row of the table (same band, gas, + k-term, pressure), with constant extrapolation beyond the outermost valid values. + This matches how SOCRATES interpolates the table, and clamps temperatures to its + range, so a layer colder than the lowest valid point sees that point's value. + Rows with no valid values at all are set to zero. + + Parameters + ---------- + kpath : str + Path to the k-coefficient file (.sf_k) written by prep_spec + + Returns + ---------- + tuple + Number of values interpolated, number of values set to zero + """ + + with open(kpath,'r') as hdl: + lines = hdl.readlines() + + block_types = {"k-table":"gas", "continuum k-table":"cont", "temperature k-tables":"tgas"} + block = None # type of the current lookup block + t_grid = None # temperatures of each row, indexed by pressure [n_pre, n_tmp] + t_gas = {} # temperatures per gas, for the temperature k-tables + n_fill = 0 + n_zero = 0 + + i = 0 + while i < len(lines): + s = lines[i].strip() + + if s.startswith("*BLOCK"): + block = block_types.get(s.split(":",1)[1].strip(), None) + i += 1 + continue + if (block is None) or (s == ""): + i += 1 + continue + + if s.startswith("Lookup table:") and ("pressures" in s): + # pressure-temperature grid: each row is p followed by its temperatures + n_pre = int(s.split(":")[1].split()[0]) + n_tmp = int(s.split(",")[1].split()[0]) + vals, i = _read_lookup_numbers(lines, i+1, n_pre*(n_tmp+1)) + t_grid = vals.reshape(n_pre, n_tmp+1)[:,1:] + continue + if s.startswith("Lookup table:") and s.endswith("temperatures."): + # continuum temperature grid + n_tmp = int(s.split(":")[1].split()[0]) + vals, i = _read_lookup_numbers(lines, i+1, n_tmp) + t_grid = vals.reshape(1, n_tmp) + continue + if s.startswith("Lookup table for gas"): + igas = int(s.split("gas")[1].split(":")[0]) + n_tmp = int(s.split(":")[1].split()[0]) + t_gas[igas], i = _read_lookup_numbers(lines, i+1, n_tmp) + continue + + if s.startswith("Band:"): + if block == "tgas": + igas = int(s.split("gas:")[1].split(",")[0]) + t_grid = t_gas[igas].reshape(1, -1) + if t_grid is None: + raise Exception("Lookup table data before its grid in '%s'" % kpath) + n_pre, n_tmp = t_grid.shape + + # Data lines run until the next blank or header line + j = i+1 + while (j < len(lines)) and _is_numeric_line(lines[j]): + j += 1 + + # Each row of n_tmp values starts on a new line, six values per line + lpr = (n_tmp + 5) // 6 + if (j-i-1) % lpr != 0: + raise Exception("Malformed lookup table at line %d of '%s'" % (i+1, kpath)) + for r, l0 in enumerate(range(i+1, j, lpr)): + if "NaN" not in "".join(lines[l0:l0+lpr]): + continue + row = _parse_fortran_line("".join(lines[l0:l0+lpr])) + bad = np.isnan(row) + if np.all(bad): + row[:] = 0.0 + n_zero += n_tmp + else: + # rows are ordered with pressure as the fastest-varying index + t = t_grid[r % n_pre] + row[bad] = np.interp(t[bad], t[~bad], row[~bad]) + n_fill += np.count_nonzero(bad) + for k in range(lpr): + lines[l0+k] = "".join(_fmt_e13(v) for v in row[6*k:6*k+6]) + "\n" + i = j + continue + + i += 1 + + with open(kpath,'w') as hdl: + hdl.writelines(lines) + + return n_fill, n_zero + def assemble(alias:str, volatile_list:list, dry:bool=False): """Assemble final spectral file. @@ -1076,7 +1309,16 @@ def assemble(alias:str, volatile_list:list, dry:bool=False): log.error("Assembled spectral file '%s' contains NaN values" % check_path) log.error("-------------------------------------------") - # Replace NaNs if requested + # Fill NaNs in the lookup tables from valid neighbours in temperature + if REPLACE_NAN and contains_nan and (ext == "_k"): + n_fill, n_zero = fill_nan_lookup(check_path) + log.warning("Filled %d NaN values in '%s' by interpolation in temperature" % (n_fill, check_path)) + if n_zero > 0: + log.warning("Set %d NaN values to zero in '%s' (rows with no valid values)" % (n_zero, check_path)) + with open(check_path,'r') as hdl: + contains_nan = "NaN" in hdl.read() + + # Replace any remaining NaNs with zeros if REPLACE_NAN and contains_nan: log.warning("Replacing NaN value in '%s'" % check_path) with open(check_path,'r') as hdl: diff --git a/spectraltools/src/utils.py b/spectraltools/src/utils.py index 551af0bc..3efe0cbc 100644 --- a/spectraltools/src/utils.py +++ b/spectraltools/src/utils.py @@ -8,7 +8,7 @@ import hashlib # Version -__version__ = "1.0.0" +__version__ = "1.1.0" log = logging.getLogger("fwl."+__name__) @@ -297,14 +297,16 @@ def git_hash(): ["N2", "He"], ["N2", "N2"], ["N2", "H2O"], + ["N2", "CH4"], ["O2", "CO2"], - # ["O2", "N2"], # shows strange behaviour + ["O2", "N2"], ["O2", "O2"], ["CO2", "CO2"], ["CO2", "H2"], ["CO2", "He"], ["CO2", "CH4"], ["CO2", "Ar"], + ["CO2", "H2O"], # HITRAN data at 296 K only (used at all temperatures), 5700-6300 cm-1 ["CH4", "He"], ["CH4", "Ar" ], ["CH4", "CH4"], diff --git a/src/correlated_k/ck_parm_acf.f90 b/src/correlated_k/ck_parm_acf.f90 index 9cddfd60..7518ec25 100644 --- a/src/correlated_k/ck_parm_acf.f90 +++ b/src/correlated_k/ck_parm_acf.f90 @@ -23,7 +23,7 @@ MODULE ck_parm_acf INTEGER, PARAMETER :: n_path_kopt_default = 20 ! Default number of absorptive paths - INTEGER, PARAMETER :: np_kopt_max_iter = 100 + INTEGER, PARAMETER :: np_kopt_max_iter = 200 ! Maximum number of iterations of the Newton-Raphson algorithm ! to find the optimal value of k REAL (RealK), PARAMETER :: umin_kopt_default = 1.0E-09_RealK diff --git a/version b/version index cd72add4..5d8668ca 100644 --- a/version +++ b/version @@ -1 +1 @@ -2607.3 +2607.4