From 611b966db663dd0ce2c94679c610cc4f8e034aeb Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu>
Date: Thu, 13 Apr 2023 15:40:31 +0200
Subject: [PATCH] introduce standardAirComposition object

---
 corsika/detail/media/CORSIKA7Atmospheres.inl | 8 +-------
 corsika/media/CORSIKA7Atmospheres.hpp        | 7 ++++++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/corsika/detail/media/CORSIKA7Atmospheres.inl b/corsika/detail/media/CORSIKA7Atmospheres.inl
index 1e18dffb3..3e5c86e76 100644
--- a/corsika/detail/media/CORSIKA7Atmospheres.inl
+++ b/corsika/detail/media/CORSIKA7Atmospheres.inl
@@ -20,13 +20,7 @@ namespace corsika {
         TEnvironmentInterface, TExtraEnv>::create(center, constants::EarthRadius::Mean,
                                                   std::forward<TArgs>(args)...);
 
-    // composition values from AIRES manual
-    builder.setNuclearComposition({{
-                                       Code::Nitrogen,
-                                       Code::Argon,
-                                       Code::Oxygen,
-                                   },
-                                   {0.7847, 0.0047, 1. - 0.7847 - 0.0047}});
+    builder.setNuclearComposition(standardAirComposition);
 
     // add the standard atmosphere layers
     auto const params = atmosphereParameterList[static_cast<uint8_t>(atmId)];
diff --git a/corsika/media/CORSIKA7Atmospheres.hpp b/corsika/media/CORSIKA7Atmospheres.hpp
index 0eb0b6a7a..cba81771f 100644
--- a/corsika/media/CORSIKA7Atmospheres.hpp
+++ b/corsika/media/CORSIKA7Atmospheres.hpp
@@ -11,6 +11,7 @@
 #include <corsika/media/IRefractiveIndexModel.hpp>
 #include <corsika/media/LayeredSphericalAtmosphereBuilder.hpp>
 #include <corsika/framework/utility/ImplementsMixin.hpp>
+#include <corsika/media/NuclearComposition.hpp>
 
 // for detail namespace, NoExtraModelInner, NoExtraModel and traits
 #include <corsika/detail/media/LayeredSphericalAtmosphereBuilder.hpp>
@@ -204,6 +205,10 @@ namespace corsika {
   void create_5layer_atmosphere(TEnvironment& env, AtmosphereId const atmId,
                                 Point const& center, TArgs... args);
 
+  //! The standard/default air composition with fraction values based on CORSIKA 7
+  static inline NuclearComposition const standardAirComposition{
+      {Code::Nitrogen, Code::Oxygen, Code::Argon}, {0.78479, .21052, 0.00469}};
+
 } // namespace corsika
 
-#include <corsika/detail/media/CORSIKA7Atmospheres.inl>
\ No newline at end of file
+#include <corsika/detail/media/CORSIKA7Atmospheres.inl>
-- 
GitLab