code: def skydir_to_pixel(self, skydir):
          
          if self.coordsys in ['CEL', 'EQU']:
              skydir = skydir.transform_to('icrs')
              lon = skydir.ra.deg
              lat = skydir.dec.deg
          else:
              skydir = skydir.transform_to('galactic')
              lon = skydir.l.deg
              lat = skydir.b.deg
  
          return self.get_pixel_indices(lat, lon)
docs: Return the pixel index of a SkyCoord object.