code: def observer_position(time, lon, lat, alt):
      
  
      lon = np.deg2rad(lon)
      lat = np.deg2rad(lat)
  
      theta = (gmst(time) + lon) % (2 * np.pi)
      c = 1 / np.sqrt(1 + F * (F - 2) * np.sin(lat)**2)
      sq = c * (1 - F)**2
  
      achcp = (A * c + alt) * np.cos(lat)
      x = achcp * np.cos(theta)  # kilometers
      y = achcp * np.sin(theta)
      z = (A * sq + alt) * np.sin(lat)
  
      vx = -MFACTOR * y  # kilometers/second
      vy = MFACTOR * x
      vz = 0
  
      return (x, y, z), (vx, vy, vz)
docs: Calculate observer ECI position.
  
      http://celestrak.com/columns/v02n03/