{"action":"created","comment":{"url":"https://api.github.com/repos/gammapy/gammapy/pulls/comments/34315268","id":34315268,"diff_hunk":"@@ -71,3 +81,825 @@ def evaluate(self, x, y):\n         y = np.asanyarray(y, dtype=float)\n         parvals = self.parvals(x)\n         return self._evaluate_y(y, parvals)\n+\n+\n+def _make_bin_edges_array(lo, hi):\n+    \"\"\"Make bin edges array from a low values and a high values array.\n+\n+    TODO: move this function to somewhere else? (i.e. utils?)\n+\n+    Parameters\n+    ----------\n+    lo : `~numpy.array`\n+        lower boundaries\n+    hi : `~numpy.array`\n+        higher boundaries\n+\n+    Returns\n+    -------\n+    bin_edges : `~numpy.array`\n+        array of bin edges as [[low], [high]]\n+    \"\"\"\n+    return np.append(lo.flatten(), hi.flatten()[-1:])\n+\n+\n+def make_linear_bin_edges_arrays_from_wcs(w, nbins_x, nbins_y):\n+    \"\"\"Make a 2D linear binning from a WCS object.\n+\n+    This method gives the correct answer only for linear X, Y binning.\n+    The method expects angular quantities in the WCS object.\n+    X is identified with WCS axis 1, Y is identified with WCS axis 2.\n+    The method needs the number of bins as input, since it is not in\n+    the WCS object.\n+\n+    TODO: move this function to somewhere else? (i.e. utils?)\n+\n+    Parameters\n+    ----------\n+    w : `~astropy.wcs.WCS`\n+        WCS object describing the bin coordinates\n+    nbins_x : `~int`\n+        number of bins in X coordinate\n+    nbins_y : `~int`\n+        number of bins in Y coordinate\n+\n+    Returns\n+    -------\n+    bins_x : `~numpy.array` of `~astropy.coordinates.Angle`\n+        array with the bin edges for the X coordinate\n+    bins_y : `~numpy.array` of `~astropy.coordinates.Angle`\n+        array with the bin edges for the Y coordinate\n+    \"\"\"\n+    # check number of dimensions\n+    if w.wcs.naxis != 2:\n+        raise ValueError(\"Expected exactly 2 dimensions, got {}\".format(\n+            w.wcs.naxis))\n+\n+    unit_x, unit_y = w.wcs.cunit\n+    delta_x, delta_y = w.wcs.cdelt\n+    delta_x = Angle(delta_x, unit_x)\n+    delta_y = Angle(delta_y, unit_y)\n+    bins_x = np.arange(nbins_x + 1)*delta_x\n+    bins_y = np.arange(nbins_y + 1)*delta_y\n+    # translate bins to correct values according to WCS reference\n+    # coordinate start empiricaly determined at pix = 0.5: why 0.5?\n+    refpix_x, refpix_y = w.wcs.crpix\n+    refval_x, refval_y = w.wcs.crval\n+    refval_x = Angle(refval_x, unit_x)\n+    refval_y = Angle(refval_y, unit_y)\n+    bins_x += refval_x - (refpix_x - 0.5)*delta_x\n+    bins_y += refval_y - (refpix_y - 0.5)*delta_y\n+\n+    return bins_x, bins_y\n+\n+\n+def make_linear_wcs_from_bin_edges_arrays(name_x, name_y, bins_x, bins_y):\n+    \"\"\"Make a 2D linear WCS object from arrays of bin edges.\n+\n+    This method gives the correct answer only for linear X, Y binning.\n+    X is identified with WCS axis 1, Y is identified with WCS axis 2.\n+\n+    TODO: move this function to somewhere else? (i.e. utils?)\n+\n+    Parameters\n+    ----------\n+    name_x : `~string`\n+        name of X coordinate, to be used as 'CTYPE' value\n+    name_y : `~string`\n+        name of Y coordinate, to be used as 'CTYPE' value\n+    bins_x : `~numpy.array` of `~astropy.coordinates.Angle`\n+        array with the bin edges for the X coordinate\n+    bins_y : `~numpy.array` of `~astropy.coordinates.Angle`\n+        array with the bin edges for the Y coordinate\n+\n+    Returns\n+    -------\n+    w : `~astropy.wcs.WCS`\n+        WCS object describing the bin coordinates\n+    \"\"\"\n+    # check units\n+    unit_x = bins_x.unit\n+    unit_y = bins_y.unit\n+    if unit_x != unit_y:\n+        ss_error = \"Units of X ({0}) and Y ({1}) bins do not match!\".format(\n+            unit_x, unit_y)\n+        ss_error += \" Is this expected?\"\n+        raise ValueError(ss_error)\n+\n+    # Create a new WCS object. The number of axes must be set from the start\n+    w = wcs.WCS(naxis=2)\n+\n+    # Set up DET coordinates in degrees\n+    nbins_x = len(bins_x) - 1\n+    nbins_y = len(bins_y) - 1\n+    range_x = Angle([bins_x[0], bins_x[-1]])\n+    range_y = Angle([bins_y[0], bins_y[-1]])\n+    delta_x = (range_x[1] - range_x[0])/nbins_x\n+    delta_y = (range_y[1] - range_y[0])/nbins_y\n+    w.wcs.ctype = [name_x, name_y]\n+    w.wcs.cunit = [unit_x, unit_y]\n+    w.wcs.cdelt = [delta_x.to(unit_x).value, delta_y.to(unit_y).value]\n+    # ref as lower left corner (start of (X, Y) bin coordinates)\n+    # coordinate start empiricaly determined at pix = 0.5: why 0.5?\n+    w.wcs.crpix = [0.5, 0.5]\n+    w.wcs.crval = [(bins_x[0] + (w.wcs.crpix[0] - 0.5)*delta_x).to(unit_x).value,\n+                   (bins_y[0] + (w.wcs.crpix[1] - 0.5)*delta_y).to(unit_y).value]\n+\n+    return w\n+\n+\n+class CubeBackgroundModel(object):\n+\n+    \"\"\"Cube background model.\n+\n+    Container class for cube background model (X, Y, energy).\n+    (X, Y) are detector coordinates (a.k.a. nominal system).\n+    The class hass methods for reading a model from a fits file,\n+    write a model to a fits file and plot the models.\n+\n+    Parameters\n+    ----------\n+    detx_bins : `~astropy.coordinates.Angle`\n+        Spatial bin edges vector (low and high). X coordinate.\n+    dety_bins : `~astropy.coordinates.Angle`\n+        Spatial bin edges vector (low and high). Y coordinate.\n+    energy_bins : `~astropy.units.Quantity`\n+        Energy bin edges vector (low and high).\n+    background : `~astropy.units.Quantity`\n+        Background cube in (energy, X, Y) format.\n+    \"\"\"\n+\n+    def __init__(self, detx_bins, dety_bins, energy_bins, background):\n+        self.detx_bins = detx_bins\n+        self.dety_bins = dety_bins\n+        self.energy_bins = energy_bins\n+\n+        self.background = background\n+\n+    @staticmethod\n+    def from_fits_bin_table(tbhdu):\n+        \"\"\"Read cube background model from binary table in fits file.\n+\n+        Parameters\n+        ----------\n+        tbhdu : `~astropy.io.fits.BinTableHDU`\n+            HDU binary table for the bg cube\n+\n+        Returns\n+        -------\n+        bg_cube : `~gammapy.models.CubeBackgroundModel`\n+            bg model cube object\n+        \"\"\"\n+        hdu = tbhdu['BACKGROUND']\n+\n+        header = hdu.header\n+        data = hdu.data\n+\n+        # check correct axis order: 1st X, 2nd Y, 3rd energy, 4th bg\n+        if (header['TTYPE1'] != 'DETX_LO') or (header['TTYPE2'] != 'DETX_HI'):\n+            raise ValueError(\"Expecting X axis in first 2 places, not ({0}, {1})\"\n+                             .format(header['TTYPE1'], header['TTYPE2']))\n+        if (header['TTYPE3'] != 'DETY_LO') or (header['TTYPE4'] != 'DETY_HI'):\n+            raise ValueError(\"Expecting Y axis in second 2 places, not ({0}, {1})\"\n+                             .format(header['TTYPE3'], header['TTYPE4']))\n+        if (header['TTYPE5'] != 'ENERG_LO') or (header['TTYPE6'] != 'ENERG_HI'):\n+            raise ValueError(\"Expecting E axis in third 2 places, not ({0}, {1})\"\n+                             .format(header['TTYPE5'], header['TTYPE6']))\n+        if (header['TTYPE7'] != 'Bgd'):\n+            raise ValueError(\"Expecting bg axis in fourth place, not ({})\"\n+                             .format(header['TTYPE7']))\n+\n+        # get det X, Y binning\n+        detx_bins = _make_bin_edges_array(data['DETX_LO'], data['DETX_HI'])\n+        dety_bins = _make_bin_edges_array(data['DETY_LO'], data['DETY_HI'])\n+        if header['TUNIT1'] == header['TUNIT2']:\n+            detx_unit = header['TUNIT1']\n+        else:\n+            raise ValueError(\"Detector X units not matching ({0}, {1})\"\n+                             .format(header['TUNIT1'], header['TUNIT2']))\n+        if header['TUNIT3'] == header['TUNIT4']:\n+            dety_unit = header['TUNIT3']\n+        else:\n+            raise ValueError(\"Detector Y units not matching ({0}, {1})\"\n+                             .format(header['TUNIT3'], header['TUNIT4']))\n+        if not detx_unit == dety_unit:\n+            ss_error = \"This is odd: detector X and Y units not matching\"\n+            ss_error += \"({0}, {1})\".format(detx_unit, dety_unit)\n+            raise ValueError(ss_error)\n+        detx_bins = Angle(detx_bins, detx_unit)\n+        dety_bins = Angle(dety_bins, dety_unit)\n+\n+        # get energy binning\n+        energy_bins = _make_bin_edges_array(data['ENERG_LO'], data['ENERG_HI'])\n+        if header['TUNIT5'] == header['TUNIT6']:\n+            energy_unit = header['TUNIT5']\n+        else:\n+            raise ValueError(\"Energy units not matching ({0}, {1})\"\n+                             .format(header['TUNIT5'], header['TUNIT6']))\n+        energy_bins = Quantity(energy_bins, energy_unit)\n+\n+        # get background data\n+        background = data['Bgd'][0]\n+        background_unit = header['TUNIT7']\n+        TeV_units = ['1/s/TeV/sr', 's-1 sr-1 TeV-1', '1 / (s sr TeV)',\n+                     '1 / (TeV s sr)']\n+        MeV_units = ['1/s/MeV/sr', 'MeV-1 s-1 sr-1', '1 / (s sr MeV)',\n+                     '1 / (MeV s sr)']\n+        if background_unit in TeV_units:\n+            background_unit = '1 / (s TeV sr)'\n+        elif background_unit in MeV_units:\n+            background_unit = '1 / (s MeV sr)'\n+        else:\n+            raise ValueError(\"Cannot interpret units ({})\".format(background_unit))\n+        background = Quantity(background, background_unit)\n+\n+        return CubeBackgroundModel(detx_bins=detx_bins,\n+                                   dety_bins=dety_bins,\n+                                   energy_bins=energy_bins,\n+                                   background=background)\n+\n+    @staticmethod\n+    def from_fits_image(tbhdu):\n+        \"\"\"Read cube background model from image in fits file.\n+\n+        Parameters\n+        ----------\n+        tbhdu : `~astropy.io.fits.BinTableHDU`\n+            HDU binary table for the bg cube\n+\n+        Returns\n+        -------\n+        bg_cube : `~gammapy.models.CubeBackgroundModel`\n+            bg model cube object\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    @staticmethod\n+    def read_bin_table(filename):\n+        \"\"\"Read cube background model from binary table in fits file.\n+\n+        Parameters\n+        ----------\n+        filename : `~string`\n+            name of file with the bg cube\n+\n+        Returns\n+        -------\n+        bg_cube : `~gammapy.models.CubeBackgroundModel`\n+            bg model cube object\n+        \"\"\"\n+        hdu = fits.open(filename)\n+        return CubeBackgroundModel.from_fits_bin_table(hdu)\n+\n+    @staticmethod\n+    def read_image(filename):\n+        \"\"\"Read cube background model from image in fits file.\n+\n+        Parameters\n+        ----------\n+        filename : `~string`\n+            name of file with the bg cube\n+\n+        Returns\n+        -------\n+        bg_cube : `~gammapy.models.CubeBackgroundModel`\n+            bg model cube object\n+        \"\"\"\n+        hdu = fits.open(filename)\n+        return CubeBackgroundModel.from_fits_image(hdu)\n+\n+    def to_astropy_table(self):\n+        \"\"\"Convert cube background model to astropy table format.\n+\n+        Returns\n+        -------\n+        name : `~string`\n+            name of the table\n+        table : `~astropy..table.Table`\n+            table containing the bg cube\n+        \"\"\"\n+        # fits unit string\n+        u_detx = '{0.unit:FITS}'.format(self.detx_bins)\n+        u_dety = '{0.unit:FITS}'.format(self.dety_bins)\n+        u_energy = '{0.unit:FITS}'.format(self.energy_bins)\n+        u_bg = '{0.unit:FITS}'.format(self.background)\n+\n+        # data arrays\n+        a_detx_lo = Quantity([self.detx_bins[:-1]])\n+        a_detx_hi = Quantity([self.detx_bins[1:]])\n+        a_dety_lo = Quantity([self.dety_bins[:-1]])\n+        a_dety_hi = Quantity([self.dety_bins[1:]])\n+        a_energy_lo = Quantity([self.energy_bins[:-1]])\n+        a_energy_hi = Quantity([self.energy_bins[1:]])\n+        a_bg = Quantity([self.background])\n+\n+        # name\n+        name = 'BACKGROUND'\n+        # TODO: is it possible to give a name to a `~astropy.table.Table`?\n+        #       (without writing it in the header)\n+\n+        # table\n+        table = Table()\n+        table['DETX_LO'] = a_detx_lo\n+        table['DETX_HI'] = a_detx_hi\n+        table['DETY_LO'] = a_dety_lo\n+        table['DETY_HI'] = a_dety_hi\n+        table['ENERG_LO'] = a_energy_lo\n+        table['ENERG_HI'] = a_energy_hi\n+        table['Bgd'] = a_bg\n+\n+        table.meta['E_THRES'] = a_energy_lo.flatten()[0].value\n+\n+        return name, table\n+\n+    def to_fits_bin_table(self):\n+        \"\"\"Convert cube background model to binary table fits format.\n+\n+        Returns\n+        -------\n+        tbhdu : `~astropy.io.fits.BinTableHDU`\n+            table containing the bg cube\n+        \"\"\"\n+        # build astropy table\n+        name, table = self.to_astropy_table()\n+\n+        data = table.as_array()\n+\n+        header = fits.Header()\n+        header.update(table.meta)\n+\n+        tbhdu = fits.BinTableHDU(data, header, name=name)\n+\n+        # Copy over column meta-data\n+        for colname in table.colnames:\n+            tbhdu.columns[colname].unit = str(table[colname].unit)\n+\n+        # TODO: this method works fine but the order of keywords in the table","path":"gammapy/background/models.py","position":382,"original_position":382,"commit_id":"708e3e727bb2798da99eb74ffb6dc2d79d632cda","original_commit_id":"708e3e727bb2798da99eb74ffb6dc2d79d632cda","user":{"login":"mapazarr","id":11326731,"avatar_url":"https://avatars.githubusercontent.com/u/11326731?v=3","gravatar_id":"","url":"https://api.github.com/users/mapazarr","html_url":"https://github.com/mapazarr","followers_url":"https://api.github.com/users/mapazarr/followers","following_url":"https://api.github.com/users/mapazarr/following{/other_user}","gists_url":"https://api.github.com/users/mapazarr/gists{/gist_id}","starred_url":"https://api.github.com/users/mapazarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapazarr/subscriptions","organizations_url":"https://api.github.com/users/mapazarr/orgs","repos_url":"https://api.github.com/users/mapazarr/repos","events_url":"https://api.github.com/users/mapazarr/events{/privacy}","received_events_url":"https://api.github.com/users/mapazarr/received_events","type":"User","site_admin":false},"body":"Ok, I adde the issue and a link to it in the code.","created_at":"2015-07-09T23:24:41Z","updated_at":"2015-07-09T23:24:41Z","html_url":"https://github.com/gammapy/gammapy/pull/292#discussion_r34315268","pull_request_url":"https://api.github.com/repos/gammapy/gammapy/pulls/292","_links":{"self":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/comments/34315268"},"html":{"href":"https://github.com/gammapy/gammapy/pull/292#discussion_r34315268"},"pull_request":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/292"}}},"pull_request":{"url":"https://api.github.com/repos/gammapy/gammapy/pulls/292","id":38447543,"html_url":"https://github.com/gammapy/gammapy/pull/292","diff_url":"https://github.com/gammapy/gammapy/pull/292.diff","patch_url":"https://github.com/gammapy/gammapy/pull/292.patch","issue_url":"https://api.github.com/repos/gammapy/gammapy/issues/292","number":292,"state":"open","locked":false,"title":"Cube bg model container class: CubeBackgroundModel","user":{"login":"mapazarr","id":11326731,"avatar_url":"https://avatars.githubusercontent.com/u/11326731?v=3","gravatar_id":"","url":"https://api.github.com/users/mapazarr","html_url":"https://github.com/mapazarr","followers_url":"https://api.github.com/users/mapazarr/followers","following_url":"https://api.github.com/users/mapazarr/following{/other_user}","gists_url":"https://api.github.com/users/mapazarr/gists{/gist_id}","starred_url":"https://api.github.com/users/mapazarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapazarr/subscriptions","organizations_url":"https://api.github.com/users/mapazarr/orgs","repos_url":"https://api.github.com/users/mapazarr/repos","events_url":"https://api.github.com/users/mapazarr/events{/privacy}","received_events_url":"https://api.github.com/users/mapazarr/received_events","type":"User","site_admin":false},"body":"I still need to work on:\r\n\r\n - [x] the write method (and a test for it)\r\n - [x] porting the test file to `~gammapy-extra`\r\n - [x] make the test that use external files work\r\n - [ ] implement `read_image` and `write_image` with a `WCS` object and a HDU table for the energy bin edges; tests\r\n - [ ] separate the plot functions into `do_one_plot` and `do_many_plots` functions\r\n - [ ] clean the code and autopep it\r\n - [ ] the sphinx doc; add link to `examples/plot_background_model.py`\r\n\r\nFurther methods like histograming of event lists will come at a later stage.\r\n@cdeil For now, I'm adding a small file (taken from the `GammaLib` repo) to `background/tests/data` for the tests. This can be changed later if you don't like it.\r\n\r\nI'm having trouble with the test for the read function for 2 reasons:\r\n\r\n 1. I can't get the `get_pkg_data_filename` method to work: it can't find the file, so it thinks I'm trying to get data from a remote location.\r\n 2. The test file doesn't have defined units for DETX, DETY coordinates. Once the write function is ready I can solve this issue.\r\n\r\nYou can try the examples/plot_background_model.py script to see the plots. It takes a while (couple of minutes).","created_at":"2015-06-24T14:26:27Z","updated_at":"2015-07-09T23:24:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8f5cb35d2a99028746edf6665c0df7bda95ab86","assignee":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/gammapy/gammapy/milestones/2","html_url":"https://github.com/gammapy/gammapy/milestones/0.3","labels_url":"https://api.github.com/repos/gammapy/gammapy/milestones/2/labels","id":377787,"number":2,"title":"0.3","description":"","creator":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":22,"state":"open","created_at":"2013-07-14T16:38:18Z","updated_at":"2015-07-02T10:12:27Z","due_on":"2015-07-08T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/gammapy/gammapy/pulls/292/commits","review_comments_url":"https://api.github.com/repos/gammapy/gammapy/pulls/292/comments","review_comment_url":"https://api.github.com/repos/gammapy/gammapy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gammapy/gammapy/issues/292/comments","statuses_url":"https://api.github.com/repos/gammapy/gammapy/statuses/708e3e727bb2798da99eb74ffb6dc2d79d632cda","head":{"label":"mapazarr:bg-container-classes","ref":"bg-container-classes","sha":"708e3e727bb2798da99eb74ffb6dc2d79d632cda","user":{"login":"mapazarr","id":11326731,"avatar_url":"https://avatars.githubusercontent.com/u/11326731?v=3","gravatar_id":"","url":"https://api.github.com/users/mapazarr","html_url":"https://github.com/mapazarr","followers_url":"https://api.github.com/users/mapazarr/followers","following_url":"https://api.github.com/users/mapazarr/following{/other_user}","gists_url":"https://api.github.com/users/mapazarr/gists{/gist_id}","starred_url":"https://api.github.com/users/mapazarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapazarr/subscriptions","organizations_url":"https://api.github.com/users/mapazarr/orgs","repos_url":"https://api.github.com/users/mapazarr/repos","events_url":"https://api.github.com/users/mapazarr/events{/privacy}","received_events_url":"https://api.github.com/users/mapazarr/received_events","type":"User","site_admin":false},"repo":{"id":32351501,"name":"gammapy","full_name":"mapazarr/gammapy","owner":{"login":"mapazarr","id":11326731,"avatar_url":"https://avatars.githubusercontent.com/u/11326731?v=3","gravatar_id":"","url":"https://api.github.com/users/mapazarr","html_url":"https://github.com/mapazarr","followers_url":"https://api.github.com/users/mapazarr/followers","following_url":"https://api.github.com/users/mapazarr/following{/other_user}","gists_url":"https://api.github.com/users/mapazarr/gists{/gist_id}","starred_url":"https://api.github.com/users/mapazarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapazarr/subscriptions","organizations_url":"https://api.github.com/users/mapazarr/orgs","repos_url":"https://api.github.com/users/mapazarr/repos","events_url":"https://api.github.com/users/mapazarr/events{/privacy}","received_events_url":"https://api.github.com/users/mapazarr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mapazarr/gammapy","description":"A Python package for gamma-ray astronomy","fork":true,"url":"https://api.github.com/repos/mapazarr/gammapy","forks_url":"https://api.github.com/repos/mapazarr/gammapy/forks","keys_url":"https://api.github.com/repos/mapazarr/gammapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapazarr/gammapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapazarr/gammapy/teams","hooks_url":"https://api.github.com/repos/mapazarr/gammapy/hooks","issue_events_url":"https://api.github.com/repos/mapazarr/gammapy/issues/events{/number}","events_url":"https://api.github.com/repos/mapazarr/gammapy/events","assignees_url":"https://api.github.com/repos/mapazarr/gammapy/assignees{/user}","branches_url":"https://api.github.com/repos/mapazarr/gammapy/branches{/branch}","tags_url":"https://api.github.com/repos/mapazarr/gammapy/tags","blobs_url":"https://api.github.com/repos/mapazarr/gammapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapazarr/gammapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapazarr/gammapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapazarr/gammapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapazarr/gammapy/statuses/{sha}","languages_url":"https://api.github.com/repos/mapazarr/gammapy/languages","stargazers_url":"https://api.github.com/repos/mapazarr/gammapy/stargazers","contributors_url":"https://api.github.com/repos/mapazarr/gammapy/contributors","subscribers_url":"https://api.github.com/repos/mapazarr/gammapy/subscribers","subscription_url":"https://api.github.com/repos/mapazarr/gammapy/subscription","commits_url":"https://api.github.com/repos/mapazarr/gammapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapazarr/gammapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapazarr/gammapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapazarr/gammapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapazarr/gammapy/contents/{+path}","compare_url":"https://api.github.com/repos/mapazarr/gammapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapazarr/gammapy/merges","archive_url":"https://api.github.com/repos/mapazarr/gammapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapazarr/gammapy/downloads","issues_url":"https://api.github.com/repos/mapazarr/gammapy/issues{/number}","pulls_url":"https://api.github.com/repos/mapazarr/gammapy/pulls{/number}","milestones_url":"https://api.github.com/repos/mapazarr/gammapy/milestones{/number}","notifications_url":"https://api.github.com/repos/mapazarr/gammapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapazarr/gammapy/labels{/name}","releases_url":"https://api.github.com/repos/mapazarr/gammapy/releases{/id}","created_at":"2015-03-16T20:36:43Z","updated_at":"2015-04-09T23:35:39Z","pushed_at":"2015-07-09T17:18:13Z","git_url":"git://github.com/mapazarr/gammapy.git","ssh_url":"git@github.com:mapazarr/gammapy.git","clone_url":"https://github.com/mapazarr/gammapy.git","svn_url":"https://github.com/mapazarr/gammapy","homepage":"https://gammapy.readthedocs.org/","size":3088,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gammapy:master","ref":"master","sha":"b04fdaa1154889d2d95697f21c95bbc029a22fa9","user":{"login":"gammapy","id":852764,"avatar_url":"https://avatars.githubusercontent.com/u/852764?v=3","gravatar_id":"","url":"https://api.github.com/users/gammapy","html_url":"https://github.com/gammapy","followers_url":"https://api.github.com/users/gammapy/followers","following_url":"https://api.github.com/users/gammapy/following{/other_user}","gists_url":"https://api.github.com/users/gammapy/gists{/gist_id}","starred_url":"https://api.github.com/users/gammapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gammapy/subscriptions","organizations_url":"https://api.github.com/users/gammapy/orgs","repos_url":"https://api.github.com/users/gammapy/repos","events_url":"https://api.github.com/users/gammapy/events{/privacy}","received_events_url":"https://api.github.com/users/gammapy/received_events","type":"Organization","site_admin":false},"repo":{"id":10073640,"name":"gammapy","full_name":"gammapy/gammapy","owner":{"login":"gammapy","id":852764,"avatar_url":"https://avatars.githubusercontent.com/u/852764?v=3","gravatar_id":"","url":"https://api.github.com/users/gammapy","html_url":"https://github.com/gammapy","followers_url":"https://api.github.com/users/gammapy/followers","following_url":"https://api.github.com/users/gammapy/following{/other_user}","gists_url":"https://api.github.com/users/gammapy/gists{/gist_id}","starred_url":"https://api.github.com/users/gammapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gammapy/subscriptions","organizations_url":"https://api.github.com/users/gammapy/orgs","repos_url":"https://api.github.com/users/gammapy/repos","events_url":"https://api.github.com/users/gammapy/events{/privacy}","received_events_url":"https://api.github.com/users/gammapy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gammapy/gammapy","description":"A Python package for gamma-ray astronomy","fork":false,"url":"https://api.github.com/repos/gammapy/gammapy","forks_url":"https://api.github.com/repos/gammapy/gammapy/forks","keys_url":"https://api.github.com/repos/gammapy/gammapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gammapy/gammapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gammapy/gammapy/teams","hooks_url":"https://api.github.com/repos/gammapy/gammapy/hooks","issue_events_url":"https://api.github.com/repos/gammapy/gammapy/issues/events{/number}","events_url":"https://api.github.com/repos/gammapy/gammapy/events","assignees_url":"https://api.github.com/repos/gammapy/gammapy/assignees{/user}","branches_url":"https://api.github.com/repos/gammapy/gammapy/branches{/branch}","tags_url":"https://api.github.com/repos/gammapy/gammapy/tags","blobs_url":"https://api.github.com/repos/gammapy/gammapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gammapy/gammapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gammapy/gammapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/gammapy/gammapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gammapy/gammapy/statuses/{sha}","languages_url":"https://api.github.com/repos/gammapy/gammapy/languages","stargazers_url":"https://api.github.com/repos/gammapy/gammapy/stargazers","contributors_url":"https://api.github.com/repos/gammapy/gammapy/contributors","subscribers_url":"https://api.github.com/repos/gammapy/gammapy/subscribers","subscription_url":"https://api.github.com/repos/gammapy/gammapy/subscription","commits_url":"https://api.github.com/repos/gammapy/gammapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/gammapy/gammapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/gammapy/gammapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/gammapy/gammapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/gammapy/gammapy/contents/{+path}","compare_url":"https://api.github.com/repos/gammapy/gammapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gammapy/gammapy/merges","archive_url":"https://api.github.com/repos/gammapy/gammapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gammapy/gammapy/downloads","issues_url":"https://api.github.com/repos/gammapy/gammapy/issues{/number}","pulls_url":"https://api.github.com/repos/gammapy/gammapy/pulls{/number}","milestones_url":"https://api.github.com/repos/gammapy/gammapy/milestones{/number}","notifications_url":"https://api.github.com/repos/gammapy/gammapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gammapy/gammapy/labels{/name}","releases_url":"https://api.github.com/repos/gammapy/gammapy/releases{/id}","created_at":"2013-05-15T07:50:40Z","updated_at":"2015-06-06T13:39:51Z","pushed_at":"2015-07-09T17:18:14Z","git_url":"git://github.com/gammapy/gammapy.git","ssh_url":"git@github.com:gammapy/gammapy.git","clone_url":"https://github.com/gammapy/gammapy.git","svn_url":"https://github.com/gammapy/gammapy","homepage":"https://gammapy.readthedocs.org/","size":5466,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":105,"forks":20,"open_issues":105,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/292"},"html":{"href":"https://github.com/gammapy/gammapy/pull/292"},"issue":{"href":"https://api.github.com/repos/gammapy/gammapy/issues/292"},"comments":{"href":"https://api.github.com/repos/gammapy/gammapy/issues/292/comments"},"review_comments":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/292/comments"},"review_comment":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/292/commits"},"statuses":{"href":"https://api.github.com/repos/gammapy/gammapy/statuses/708e3e727bb2798da99eb74ffb6dc2d79d632cda"}}}}