From Wikipedia:
During the American Civil War, Army officers were withdrawn from Coast Survey duty, never to return, while all but two Navy officers also were withdrawn from Coast Survey service for the duration of the war. Since most men of the Survey had Union sympathies, most stayed on with the Survey rather than resigning to serve the Confederate States of America; their work shifted in emphasis to support of the United States Navy and Union Army, and these Coast Surveyors are the professional ancestors of today’s NOAA Corps. Those Coast Surveyors supporting the Union Army were given assimilated military rank while attached to a specific command, but those supporting the U.S. Navy operated as civilians and ran the risk of being executed as spies if captured by the Confederates while working in support of Union forces.
deleted by creator