Here is a brief explanation of the "Re-declaration of arepo code units attempted within same Python session" error message that Paicos throws when a user tries to load two arepo snapshots that have differing unit systems.
Paicos is currently unable to handle this because the arepo code units, such as e.g. 'arepo_mass', need to be
uniquely defined. This limitation of Paicos might become a problem if someone wants to compare snapshots from simulations using different unit systems. One approach would be to initialize the arepo code units only when they are actually needed. Users could then for each simulation make derived hdf5-files in e.g. cgs and then make their comparison using these derived hdf5-files.
Below is a more detailed description of the problem:
We use astropy to handle units. The strategy is to load data with the numeric values in the hdf5-files, i.e., we do not convert e.g. CGS during loading. This has the advantage that one can work with the code units, if one so wishes. In order to support this, we define Python session wide arepo units, e.g.,
Here is a brief explanation of the "Re-declaration of arepo code units attempted within same Python session" error message that Paicos throws when a user tries to load two arepo snapshots that have differing unit systems.
Paicos is currently unable to handle this because the arepo code units, such as e.g. 'arepo_mass', need to be uniquely defined. This limitation of Paicos might become a problem if someone wants to compare snapshots from simulations using different unit systems. One approach would be to initialize the arepo code units only when they are actually needed. Users could then for each simulation make derived hdf5-files in e.g. cgs and then make their comparison using these derived hdf5-files.
Below is a more detailed description of the problem:
We use astropy to handle units. The strategy is to load data with the numeric values in the hdf5-files, i.e., we do not convert e.g. CGS during loading. This has the advantage that one can work with the code units, if one so wishes. In order to support this, we define Python session wide arepo units, e.g.,
where
unit_mass
is definedunit_mass = self.Parameters['UnitMass_in_g'] * u.g
.This becomes a problem if another snapshot is loaded which has a differing value of self.Parameters['UnitMass_in_g'].