Jacob Hummel edited 2-Units.tex  about 8 years ago

Commit id: 877ce83e5f97597fedd5ad77b95b347468fe7f80

deletions | additions      

       

Conversion from code units to the physical units system of choice is handled at loading.  The default units for length, time, mass, etc. can be specified at initialization, along with whether to use physical or comoving coordinates (for cosmological simulations) and whether to factor the Hubble constant out of the reported units (i.e., units of Mpc vs. Mpc/h).  While defaults are set at startup, they can be modified at any time, either by calling \code{units.set_length('AU')} \verb|units.set_length('AU')|  for example, which alters the default length unit for all subsequently loaded fields, or by calling a particle field's load function with the optional \code{units} keyword argument. Changing the units of an existing field can be done by simply reloading it; the field will remain properly indexed as described in Section \ref{sec:fileIO}.