NASA prepares Mars spacecraft for close brush with comet