utils - Utilities#
gammapy.utils.coordinates Package#
Astronomical coordinate calculation utility functions.
Functions#
|
Convert polar coordinates to cartesian coordinates. |
|
Transform field-of-view coordinates to sky coordinates. |
|
Compute galactic coordinates lon, lat and distance. |
|
Compute motion of a object with given velocity, direction and age. |
|
Convert cartesian coordinates to polar coordinates. |
|
Transform sky coordinates to field-of-view coordinates. |
|
Compute projected angular velocity in galactic coordinates. |
Variables#
A |
gammapy.utils.integrate Module#
Functions#
|
Integrate using the composite trapezoidal rule in log-log space. |
gammapy.utils.interpolation Module#
Interpolation utilities
Functions#
|
Helper function to interpolate one-dimensional profiles. |
|
Interpolation scaling. |
Classes#
|
Thin wrapper around |
gammapy.utils.fits Module#
Functions#
|
Create |
Classes#
|
A lazy FITS data descriptor. |
|
HDU localisation, loading and Gammapy object mapper. |
gammapy.utils.random Package#
Random probability distribution helpers.
Functions#
|
Allows drawing of random numbers from any distribution. |
|
Get a |
|
Normalize a 1D function over a given range. |
|
One-dimensional PDF of a given radial surface density. |
|
Sample random values from a power law distribution. |
|
Sample random points on the sphere. |
|
Sample random distances if the 3-dim space density is constant. |
|
Make random times assuming a Poisson process. |
Classes#
|
Inverse CDF sampler. |
gammapy.utils.regions Module#
Regions helper functions.
Throughout Gammapy, we use regions
to represent and work with regions.
https://astropy-regions.readthedocs.io
We might add in other conveniences and features here, e.g. sky coord contains without a WCS (see “sky and pixel regions” in PIG 10), or some HEALPix integration.
TODO: before Gammapy v1.0, discuss what to do about gammapy.utils.regions
.
Options: keep as-is, hide from the docs, or to remove it completely
(if the functionality is available in astropy-regions
directly.
Functions#
|
Create list of regions from compound regions. |
|
Make a list of concentric annulus regions. |
|
Utility returning an array of regions to make orthogonal projections |
|
Create compound region from list of regions, by creating the union. |
gammapy.utils.scripts Module#
Utils to create scripts and command-line tools
Functions#
|
Generator yields a Path for each image used in notebook. |
|
Generator yields a Path for each notebook. |
|
Expand environment variables on |
|
Read YAML file. |
|
Recursively merge two dictionaries. |
|
Write YAML file. |
gammapy.utils.table Module#
Table helper utilities.
Functions#
|
Stack the column data horizontally |
|
Helper function to create table objects from row data. |
|
Make one source data dict. |
|
Standardise units for all columns in a table in a copy. |
Standardise units for all columns in a table in place. |
gammapy.utils.testing Module#
Utilities for testing
Functions#
|
Assert all-close for |
|
Assert all-close for |
|
Assert all-close for |
Matplotlib plotting test context manager. |
|
|
Decorator to declare required data for tests. |
|
Decorator to declare required dependencies for tests. |
Classes#
|
Base class for checker classes in Gammapy. |
gammapy.utils.time Module#
Time related utility functions.
Functions#
|
Convert a MET into human readable date and time. |
|
Calculate the time reference from metadata. |
|
TODO: document and test. |
|
Convert a time using an existing reference. |
gammapy.utils.units Module#
Units and Quantity related helper functions
Functions#
|
Standardise unit. |
|
Read unit from a FITS image HDU. |