In Civil War era photographs yellow usually photographed as dark due to the photographic processes then in use. I surmise that the trim is buff not yellow. If so then this is a Lieutenant Colonel in the Engineers, Adjutant General's Department, Commissary General's Department, Quartermaster General's Department, or possibly a staff officer unassigned to a branch. Try comparing the color of the trim with the trim on a photograph of a General Officer wearing buff trim.