Remove unsed HpxGeom.write() and related methods
@@ -1464,70 +1464,6 @@ class HpxGeom(MapGeom):
cols += [fits.Column("NSIDE", "I", array=np.ravel(self.nside))]
return cols
- def make_ebounds_hdu(self, hdu="EBOUNDS"):
- """Make a FITS HDU with the energy bin boundaries.
-
- Parameters
- ----------
- hdu : str
- The HDU extension name
- """
- # TODO: Assert if the number of axes is wrong?
-
- energy_axis = self._axes[0]
- emin = energy_axis.edges[:-1]
- emax = energy_axis.edges[1:]
-
- cols = [
- fits.Column("CHANNEL", "I", array=np.arange(1, energy_axis.nbin)),
- # FIXME: this only works for axis unit MeV. Broken for TeV
- # See https://github.com/gammapy/gammapy/issues/1734#issuecomment-415119105
- fits.Column("E_MIN", "1E", unit="keV", array=1000 * emin),
- fits.Column("E_MAX", "1E", unit="keV", array=1000 * emax),
- ]
- return fits.BinTableHDU.from_columns(cols, self.make_header(), name=hdu)
-
- def make_energies_hdu(self, hdu="ENERGIES"):
- """Make a FITS HDU with the energy bin centers.
-
- Parameters
- ----------
- hdu : str
- The HDU extension name
- """
- # FIXME: this method is untested and broken.
- # See https://github.com/gammapy/gammapy/issues/1734#issuecomment-415119105
- ectr = np.sqrt(self._axes[0][1:] * self._axes[0][:-1])
- cols = [fits.Column("ENERGY", "1E", unit="MeV", array=ectr)]
- return fits.BinTableHDU.from_columns(cols, self.make_header(), name=hdu)
-
- def write(self, data, outfile, hdu="SKYMAP", overwrite=False):
- """Write input data to a FITS file.
-
- Parameters
- ----------
- data :
- The data being stored
- outfile : str
- The name of the output file
- hdu : str
- The HDU extension name
- overwrite : bool
- Overwrite existing file?
- """
- hdu_hpx = self.make_hdu(data, hdu=hdu)
- hdu_list = fits.HDUList([fits.PrimaryHDU(), hdu_hpx])
-
- if self.conv.bands_hdu == "EBOUNDS":
- hdu_energy = self.make_ebounds_hdu()
- elif self.conv.bands_hdu == "ENERGIES":
- hdu_energy = self.make_energies_hdu()
-
- if hdu_energy is not None:
- hdu_list.append(hdu_energy)
-
- hdu_list.writeto(outfile, overwrite=overwrite)
-
@staticmethod
def get_index_list(nside, nest, region):
"""Get list of pixels indices for all the pixels in a region.
