File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,13 @@ class Nuclide
267
267
*
268
268
* \return Nothing
269
269
*/
270
- inline void setYear () const { year = Converter::StringToInt (full_data, NUBASE_START_YEAR, NUBASE_END_YEAR); }
270
+ inline void setYear () const
271
+ {
272
+ // Some isotopes have no value for the year so we need to watch for that.
273
+ // Leave it as the default if no year is given
274
+ const auto value = full_data.substr (NUBASE_START_YEAR, NUBASE_END_YEAR - NUBASE_START_YEAR);
275
+ year = std::isspace (value.front ()) != 0 ? 1900 : Converter::StringToInt (value);
276
+ }
271
277
272
278
/* *
273
279
* Extract the half life value from the data file
Original file line number Diff line number Diff line change @@ -196,6 +196,12 @@ bool MassTable::readNUBASE(const std::filesystem::path& nubaseTable)
196
196
197
197
isotope.setHalfLife ();
198
198
199
+ // Discovery year was added after 2003
200
+ if (table_year != 3 )
201
+ {
202
+ isotope.setYear ();
203
+ }
204
+
199
205
isotope.setDecayMode (pnSide, table_year);
200
206
201
207
isotope.setNeutronOrProtonRich (pnSide);
You can’t perform that action at this time.
0 commit comments