20 lines
452 B
Python
Executable file
20 lines
452 B
Python
Executable file
#! /usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
from xmet.db import Database
|
|
from xmet.igra import IGRAReader
|
|
|
|
db = Database.connect(sys.argv[1])
|
|
db.execute('begin transaction')
|
|
|
|
for path in sys.argv[2:]:
|
|
with open(path, 'r') as fh:
|
|
for sounding in IGRAReader.each_from_file(path):
|
|
db.add(sounding)
|
|
|
|
for sample in sounding.samples:
|
|
sample.sounding_id = sounding.id
|
|
db.add(sample)
|
|
|
|
db.commit()
|