The world’s most advanced cosmic-ray detector took 16 years and $2 billion to build, and not long ago it looked as though it would wind up mothballed in some warehouse. NASA, directed to finish building the space station and retire the space shuttle by the end of 2010, said it simply did not have room in its schedule to launch the instrument anymore. Saving it took a lobbying campaign by physicists and intervention by Congress to extend the shuttle program. And so the shuttle ­Endeavour is scheduled to take off on April 19 for the express purpose of delivering the Alpha Magnetic Spectrometer (AMS) to the International Space Station.