code: def coordInImage(x_coord, y_coord, numPix, deltapix):
      
      idex=[]
      min = -deltapix*numPix/2
      max = deltapix*numPix/2
      for i in range(len(x_coord)): #sum over image positions
          if (x_coord[i] < min or x_coord[i] > max or y_coord[i] < min or y_coord[i] > max):
              idex.append(i)
      x_coord = np.delete(x_coord, idex, axis=0)
      y_coord = np.delete(y_coord, idex, axis=0)
      return x_coord, y_coord
docs: checks whether image positions are within the pixel image in units of arcsec
      if not: remove it
  
      :param imcoord: image coordinate (in units of angels)  [[x,y,delta,magnification][...]]
      :type imcoord: (n,4) numpy array
      :returns: image positions within the pixel image