this is for holding javascript data
Jacob Hummel edited 2-Units.tex
about 8 years ago
Commit id: a360b8edf62013eb35421b63137a841306b34967
deletions | additions
diff --git a/2-Units.tex b/2-Units.tex
index ed4a026..d7a8701 100644
--- a/2-Units.tex
+++ b/2-Units.tex
...
\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()| for example, \verb|units.set_length()|, 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}.