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

Commit id: 8d7e9a4a9aefd408a7e30cbfba06f483ab179ec7

deletions | additions      

       

\end{table}  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 \verb|units.set_length('AU')| \verb|units.set_length()|  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}. Examples of both approaches to unit conversions are shown in Figure \ref{fig:units}.