.. include:: ../references.txt .. _utils: ***************** utils - Utilities ***************** Introduction ============ ``gammapy.utils`` is a collection of utility functions that are used in many places or don't fit in one of the other packages. Since the various sub-modules of ``gammapy.utils`` are mostly unrelated, they are not imported into the top-level namespace. Here are some examples of how to import functionality from the ``gammapy.utils`` sub-modules: .. code-block:: python from gammapy.utils.random import sample_sphere sample_sphere(size=10) from gammapy.utils import random random.sample_sphere(size=10) .. _time_handling: Time handling in Gammapy ======================== See `gammapy.utils.time`. Time format and scale --------------------- In Gammapy, `astropy.time.Time` objects are used to represent times: .. code-block:: python >>> from astropy.time import Time >>> Time(['1999-01-01T00:00:00.123456789', '2010-01-01T00:00:00'])