The NOAA has a commissioned officer corps so that the personnel have status as military officers, to give them protection of laws of war and prevent them from being treated as spies
Health and Human Services also has an officer corps.
Oddly enough, the Surgeon General ranks as a vice admiral. The admiral is, also oddly, the Assistant Secretary of Health. The latter because it's a commissioned position rather than an appointed and confirmed one like the Secretary of Health.
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.