1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
#import sqlite3
#import commands
from __future__ import print_function
import os
import sys
def backtick(cmd):
(childin, childout) = os.popen2(cmd)
childin.close()
out = childout.read()
return out
def getval(fn, key):
cmd = "sqlite " + fn + " \"select val from jobdata where key like '" + key + "'\""
out = backtick(cmd)
return out
#fn = '/home/gmaps/ontheweb-data/alpha/200705/00001872/jobdata.db'
#email = getval(fn, 'email');
#status = getval(fn, 'checked-done')
#print email, status
outdir = "/data2/apod-solves/"
for month in sys.argv[1:]:
#print month
jobs = os.listdir(month)
for job in jobs:
path = month + '/' + job + '/'
fn = path + "jobdata.db"
#print fn
email = getval(fn, 'email').strip()
#print email
if email != 'ckochanek@astronomy.ohio-state.edu':
continue
solvedfn = path + 'solved'
if not os.path.exists(solvedfn):
continue
#status = getval(fn, 'checked-done')
#print job, status
#wcsfn = path + "wcs.fits"
#print wcsfn
#print job
print(path)
cmd = "pngtopnm " + path + "fullsize.png | pnmtojpeg > " + outdir + "csk-" + job + ".jpg"
backtick(cmd)
cmd = "cp " + path + "wcs.fits " + outdir + "csk-" + job + ".wcs"
backtick(cmd)
#conn = sqlite3.connect(fn)
#cur = conn.cursor()
#cur.execute("select val from jobdata where key like 'user-email'")
|