diff --git a/tardis/atomic.py b/tardis/atomic.py index ec5d8b9e670..46cc285ed5d 100644 --- a/tardis/atomic.py +++ b/tardis/atomic.py @@ -416,7 +416,12 @@ def __init__(self, atom_data, ionization_data, levels_data, lines_data, macro_at self.atom_data = DataFrame(atom_data.__array__()) self.atom_data.set_index('atomic_number', inplace=True) - self.atom_data.mass = units.Quantity(self.atom_data.mass.values, 'u').cgs + # We have to use constants.u because astropy uses different values for the unit u and the constant. + # This is changed in later versions of astropy (the value of constants.u is used in all cases) + if units.u.cgs == constants.u.cgs: + self.atom_data.mass = units.Quantity(self.atom_data.mass.values, 'u').cgs + else: + self.atom_data.mass = constants.u.cgs * self.atom_data.mass.values self.ionization_data = DataFrame(ionization_data.__array__()) self.ionization_data.set_index(['atomic_number', 'ion_number'], inplace=True) diff --git a/tardis/plasma/tests/data/plasma_test_data.h5 b/tardis/plasma/tests/data/plasma_test_data.h5 index 18f1a4bff77..4d4a5bfd223 100644 Binary files a/tardis/plasma/tests/data/plasma_test_data.h5 and b/tardis/plasma/tests/data/plasma_test_data.h5 differ diff --git a/tardis/tests/data/simple_test_j_blue_estimator.npy b/tardis/tests/data/simple_test_j_blue_estimator.npy index 9576cfe11a5..2d0f62517eb 100644 Binary files a/tardis/tests/data/simple_test_j_blue_estimator.npy and b/tardis/tests/data/simple_test_j_blue_estimator.npy differ diff --git a/tardis/tests/data/simple_test_luminosity_density_lambda.npy b/tardis/tests/data/simple_test_luminosity_density_lambda.npy index 69315e51847..94b50a0b371 100644 Binary files a/tardis/tests/data/simple_test_luminosity_density_lambda.npy and b/tardis/tests/data/simple_test_luminosity_density_lambda.npy differ diff --git a/tardis/tests/data/simple_test_virtual_luminosity_density_lambda.npy b/tardis/tests/data/simple_test_virtual_luminosity_density_lambda.npy index 23dce7e2871..51d513d2aac 100644 Binary files a/tardis/tests/data/simple_test_virtual_luminosity_density_lambda.npy and b/tardis/tests/data/simple_test_virtual_luminosity_density_lambda.npy differ