Magnetic field model with one epoch can't be interpolated
uses a model with only one epoch, which leads to a segfault when attempting to interpolate for the selected epoch:
(lldb) up 5
frame #5: 0x00000001000143e8 corsika`corsika::GeomagneticModel::getField(this=0x000000016fd90a70, year=2020.5, altitude=(m_value = 10000), latitude=49, longitude=8.4000000000000004) at GeomagneticModel.inl:130 [opt]
127 double const epoch = double(iEpoch->first);
128 auto iNextEpoch = iEpoch; // next epoch for interpolation
129 // there is only one epoch in the demo
-> 130 --iNextEpoch;
131 bool const lastEpoch = (iEpoch == parameters_.rbegin());
132 auto const delta_t = year - epoch;
133 CORSIKA_LOG_DEBUG(
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
frame #0: 0x00000001000143f8 corsika`corsika::GeomagneticModel::getField(double, phys::units::quantity<phys::units::dimensions<1, 0, 0, 0, 0, 0, 0, 0>, double>, double, double) [inlined] std::__1::__tree_node_base<void*>* std::__1::__tree_min<std::__1::__tree_node_base<void*>*>(__x=0x0000000000000001) at __tree:147:17 [opt]
frame #1: 0x00000001000143f8 corsika`corsika::GeomagneticModel::getField(double, phys::units::quantity<phys::units::dimensions<1, 0, 0, 0, 0, 0, 0, 0>, double>, double, double) [inlined] std::__1::__tree_end_node<std::__1::__tree_node_base<void*>*>* std::__1::__tree_next_iter<std::__1::__tree_end_node<std::__1::__tree_node_base<void*>*>*, std::__1::__tree_node_base<void*>*>(__x=0x000000016fd90aa0) at __tree:183 [opt]
frame #2: 0x00000001000143e8 corsika`corsika::GeomagneticModel::getField(double, phys::units::quantity<phys::units::dimensions<1, 0, 0, 0, 0, 0, 0, 0>, double>, double, double) [inlined] std::__1::__tree_iterator<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, std::__1::__tree_node<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, void*>*, long>::operator++(this=<unavailable>) at __tree:848 [opt]
frame #3: 0x00000001000143e8 corsika`corsika::GeomagneticModel::getField(double, phys::units::quantity<phys::units::dimensions<1, 0, 0, 0, 0, 0, 0, 0>, double>, double, double) [inlined] std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, std::__1::__tree_node<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, void*>*, long> >::operator++(this=<unavailable>) at map:804 [opt]
frame #4: 0x00000001000143e8 corsika`corsika::GeomagneticModel::getField(double, phys::units::quantity<phys::units::dimensions<1, 0, 0, 0, 0, 0, 0, 0>, double>, double, double) [inlined] std::__1::reverse_iterator<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, std::__1::__tree_node<std::__1::__value_type<int, std::__1::vector<corsika::GeomagneticModel::ParameterLine, std::__1::allocator<corsika::GeomagneticModel::ParameterLine> > >, void*>*, long> > >::operator--(this=<unavailable>) at iterator:788 [opt]
* frame #5: 0x00000001000143e8 corsika`corsika::GeomagneticModel::getField(this=0x000000016fd90a70, year=2020.5, altitude=(m_value = 10000), latitude=49, longitude=8.4000000000000004) at GeomagneticModel.inl:130 [opt]
frame #6: 0x000000010000a018 corsika`main(argc=<unavailable>, argv=<unavailable>) at corsika.cpp:210:11 [opt]
frame #7: 0x000000018af11430 libdyld.dylib`start + 4