the units module

class pNbody.units.PhysCte(value, Unit)

Physical constant

pNbody.units.Set_SystemUnits_From_File(unitsfile)

return a system of units from given file coding units

unitsfile file is either a gadget parameter file or a pNbody units file

pNbody.units.Set_SystemUnits_From_Params(params)

return a system of units from given parameters

params is a dictionary that must contain at least

params[‘UnitVelocity_in_cm_per_s’],

params[‘UnitMass_in_g’],

params[‘UnitLength_in_cm’]

class pNbody.units.UnitSystem(UnitSysName, UnitLst)

Units system

convertionFactorTo(newUnits)

return the conversion factor to obtain the new units

info()

print some info

into(newUnits)

return into the new units

class pNbody.units.Units(symbol, factor=1.0, power=1, ulist=None)

Units class.

GatherBaseUnits()

create the self.bases list (recursively)

get_basefactor()

return the factor relative to the base units

actually, it is stored as the factor of the first base unit

class pNbody.units.unitSystem(ULength=<Quantity 3.085678e+21 cm>, UMass=<Quantity 1.989e+43 g>, UVelocity=<Quantity 100000. cm / s>)

New system units, compatible with astropy. By default the units are the Gadget-2 ones.