def _to_spherical(flds, header):
cth = np.cos(header['<STR_LIT>'][:, :, :-<NUM_LIT:1>])<EOL>sth = np.sin(header['<STR_LIT>'][:, :, :-<NUM_LIT:1>])<EOL>cph = np.cos(header['<STR_LIT>'][:, :, :-<NUM_LIT:1>])<EOL>sph = np.sin(header['<STR_LIT>'][:, :, :-<NUM_LIT:1>])<EOL>fout = np.copy(flds)<EOL>fout[<NUM_LIT:0>] = cth * cph * flds[<NUM_LIT:0>] + cth * sph * flds[<NUM_LIT:1>] - sth * flds[<NUM_LIT:2>]<EOL>fout[<NUM_LIT:1>] = sph * flds[<NUM_LIT:0>] - cph * flds[<NUM_LIT:1>]  <EOL>fout[<NUM_LIT:2>] = sth * cph * flds[<NUM_LIT:0>] + sth * sph * flds[<NUM_LIT:1>] + cth * flds[<NUM_LIT:2>]<EOL>return fout<EOL>
Convert vector field to spherical.