Normally sea duty alternated with periods of duty ashore. In 1950, Shepard was selected to attend the United States Naval Test Pilot School at Naval Air Station Patuxent River in Maryland. As a test pilot he conducted high-altitude tests to obtain information about the light and air masses at different altitudes over North America; carrier suitability certification of the McDonnell F2H Banshee; experiments with the Navy's new in-flight refueling system; and tests of the angled flight deck. He narrowly avoided being court-martialed by the station commander, Rear Admiral Alfred M. Pride, after looping the Chesapeake Bay Bridge and making low passes over the beach at Ocean City, Maryland, and the base; but Shepard's superiors, John Hyland and Robert M. Elder, interceded on his behalf.