linear_arrays_to_wcs

gammapy.utils.wcs.linear_arrays_to_wcs(name_x, name_y, bin_edges_x, bin_edges_y)[source]

Make a 2D linear WCS object from arrays of bin edges.

This method gives the correct answer only for linear X, Y binning. X is identified with WCS axis 1, Y is identified with WCS axis 2.

Parameters:
name_x : str

name of X coordinate, to be used as ‘CTYPE’ value

name_y : str

name of Y coordinate, to be used as ‘CTYPE’ value

bin_edges_x : Angle

array with the bin edges for the X coordinate

bin_edges_y : Angle

array with the bin edges for the Y coordinate

Returns:
wcs : WCS

WCS object describing the bin coordinates