author | A.M. Thurnherr <athurnherr@yahoo.com> |
Tue, 18 Jun 2013 11:51:32 +0000 | |
changeset 5 | 033a169071de |
permissions | -rw-r--r-- |
5 | 1 |
#!/usr/bin/env python |
2 |
||
3 |
""" |
|
4 |
Quick script to generate an include file from a model coefficient file, |
|
5 |
so we can include the current set of models in the compiled program. |
|
6 |
""" |
|
7 |
||
8 |
lines = open("IGRF11.COF").readlines() |
|
9 |
outfile = open("igrf11.h", "w") |
|
10 |
||
11 |
outfile.write("char *model_lines[] = {\n") |
|
12 |
||
13 |
for line in lines: |
|
14 |
line = line.rstrip() |
|
15 |
outfile.write('"%s",\n' % (line,)) |
|
16 |
||
17 |
outfile.write('""};\n') # empty line as a terminator |
|
18 |
||
19 |
outfile.close() |
|
20 |