Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Jensen committed Oct 26, 2024
1 parent d45af98 commit 0ae92a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion run_download_ztf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def main():
continue

# Write table to file:
tab.write(ztf_lightcurve_path, format='ascii.ecsv', delimiter=',')
tab.write(ztf_lightcurve_path, format='ascii.ecsv', delimiter=',', overwrite=True) # TODO: overwrite=True has not always been necessary, do we want to overwrite or not?

# Find time of maxmimum and 14 days from that:
indx_min = np.argmin(tab['mag'])
Expand Down
12 changes: 9 additions & 3 deletions run_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,19 @@ def ingest_from_inbox():
if not fpath.endswith('-e00.fits'):
create_plot(newpath, target_coord=target_coord, target_position=target_pixels)

db.cursor.execute("INSERT INTO flows.files (archive,path,targetid,datatype,site,filesize,filehash,obstime,photfilter,exptime,version,available) VALUES (%(archive)s,%(relpath)s,%(targetid)s,%(datatype)s,%(site)s,%(filesize)s,%(filehash)s,%(obstime)s,%(photfilter)s,%(exptime)s,%(version)s,1) RETURNING fileid;", {
db.cursor.execute("""INSERT INTO flows.files (
archive,path,targetid,datatype,site,filesize,filehash,obstime,photfilter,exptime,version,available
)
VALUES (
%(archive)s,%(relpath)s,%(targetid)s,%(datatype)s,%(site)s,%(filesize)s,%(filehash)s,%(obstime)s,%(photfilter)s,%(exptime)s,%(version)s,1
)
RETURNING fileid;""", {
'archive': archive,
'relpath': relpath,
'targetid': targetid,
'datatype': datatype,
'site': img.site['siteid'], 'filesize': filesize, 'filehash': filehash, 'obstime': obstime,
'photfilter': img.photfilter, 'exptime': img.exptime, 'version': version})
'site': img.site['siteid'], 'filesize': filesize, 'filehash': filehash, 'obstime': float(obstime),
'photfilter': img.photfilter, 'exptime': float(img.exptime), 'version': version})
fileid = db.cursor.fetchone()[0]

if datatype == 4:
Expand Down

0 comments on commit 0ae92a7

Please sign in to comment.