code: def get_skydir_lthist(self, skydir, cth_bins):
          
          ra = skydir.ra.deg
          dec = skydir.dec.deg
  
          npts = 1
          bins = utils.split_bin_edges(cth_bins, npts)
  
          center = edge_to_center(bins)
          width = edge_to_width(bins)
          ipix = hp.ang2pix(self.hpx.nside, np.pi / 2. - np.radians(dec),
                            np.radians(ra), nest=self.hpx.nest)
          lt = np.histogram(self._cth_center,
                            weights=self.data[:, ipix], bins=bins)[0]
          lt = np.sum(lt.reshape(-1, npts), axis=1)
          return lt
docs: Get the livetime distribution (observing profile) for a given sky
          direction with binning in incidence angle defined by
          ``cth_bins``.
  
          Parameters
          ----------
          skydir : `~astropy.coordinates.SkyCoord`
              Sky coordinate for which the observing profile will be
              computed.
  
          cth_bins : `~numpy.ndarray`
              Bin edges in cosine of the incidence angle.