code: def getdarkimg(self,chip):
          
          sci_chip = self._image[self.scienceExt,chip]
  
          # First attempt to get the dark image specified by the "DARKFILE"
          # keyword in the primary keyword of the science data.
          try:
              filename = self.header["DARKFILE"]
              handle = fileutil.openImage(filename, mode='readonly', memmap=False)
              hdu = fileutil.getExtn(handle,extn="sci,1")
              darkobj = hdu.data[sci_chip.ltv2:sci_chip.size2,sci_chip.ltv1:sci_chip.size1]
  
          # If the darkfile cannot be located, create the dark image from
          # what we know about the detector dark current and assume a
          # constant dark current for the whole image.
          except:
              darkobj = (np.ones(sci_chip.image_shape,
                                 dtype=sci_chip.image_dtype) *
                         self.getdarkcurrent())
          return darkobj
docs: Return an array representing the dark image for the detector.
  
          Returns
          -------
          dark: array
              Dark image array in the same shape as the input image with **units of cps**