def CA_code_header(fname_out, Nca):
dir_path = os.path.dirname(os.path.realpath(__file__))<EOL>ca = loadtxt(dir_path + '<STR_LIT>', dtype=int16, usecols=(Nca - <NUM_LIT:1>,), unpack=True)<EOL>M = <NUM_LIT>  <EOL>N = <NUM_LIT>  <EOL>Sca = '<STR_LIT>' + str(Nca)<EOL>f = open(fname_out, '<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>' % M)<EOL>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>');<EOL>f.write('<STR_LIT>'% Nca);<EOL>f.write('<STR_LIT>' % Nca)<EOL>kk = <NUM_LIT:0>;<EOL>for k in range(M):<EOL><INDENT>if (kk < N - <NUM_LIT:1>) and (k < M - <NUM_LIT:1>):<EOL><INDENT>f.write('<STR_LIT>' % ca[k])<EOL>kk += <NUM_LIT:1><EOL><DEDENT>elif (kk == N - <NUM_LIT:1>) & (k < M - <NUM_LIT:1>):<EOL><INDENT>f.write('<STR_LIT>' % ca[k])<EOL>if k < M:<EOL><INDENT>if Nca < <NUM_LIT:10>:<EOL><INDENT>f.write('<STR_LIT:U+0020>')<EOL><DEDENT>else:<EOL><INDENT>f.write('<STR_LIT:U+0020>')<EOL><DEDENT>kk = <NUM_LIT:0><EOL><DEDENT><DEDENT>else:<EOL><INDENT>f.write('<STR_LIT>' % ca[k])<EOL><DEDENT><DEDENT>f.write('<STR_LIT>')<EOL>f.write('<STR_LIT>')<EOL>f.close()<EOL>
Write 1023 bit CA (Gold) Code Header Files

Mark Wickert February 2015