Skip to content
Snippets Groups Projects
Commit 73c0747e authored by Carl Schaffer's avatar Carl Schaffer
Browse files

switching to db instead of csv

parent 1eed8a6b
No related branches found
No related tags found
2 merge requests!165Coord study,!163ci fix, utils for coord study
......@@ -14,10 +14,15 @@ pos = pos_from_filename(fn)
run = gris_run_number(fn)
date = date_from_fn(fn)
outfile = Path(__file__).parent / 'gris_l0_coords.csv'
outfile = Path(__file__).parent / 'gris_coords.db'
df = pd.DataFrame()
ser = pd.Series(pos)
df[f'gris_{date.strftime("%Y%m%d")}_{run:03d}'] = ser
df = df.T
df.index.name = 'obs_name'
df.to_csv(outfile, mode='a', header=(not outfile.exists()))
from sqlalchemy import create_engine
db_name = 'sqlite:///' + str(outfile)
engine = create_engine(str(db_name))
df.to_sql('raw_from_l0', con=engine, if_exists='append', index_label='obs_name')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment