1 '''INCOMPLETE! This will read read the refractiveindex.info yaml files
2 and transforms the database into a C source.'''
7 from yaml
import CLoader
as Loader
, CDumper
as Dumper
9 from yaml
import Loader
, Dumper
11 # Right now, we can process only the 'tabulated nk' data
12 searchfor
= '- type: tabulated nk'
13 searchfor
= re
.compile(searchfor
)
15 ridatadir
= "/u/46/necadam1/unix/repo/refractiveindex.info-database/database/data"
19 def find_files_by_pattern (pattern
, dir):
20 r
= re
.compile(pattern
)
21 for parent
, dnames
, fnames
in os
.walk(ridatadir
):
23 filename
= os
.path
.join(parent
, fname
)
24 if os
.path
.isfile(filename
):
25 with
open(filename
) as f
: