Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhandberg committed Jun 10, 2021
2 parents 8024a4a + 3faed1e commit 0302729
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master-v0.7.1
master-v0.7.2
10 changes: 9 additions & 1 deletion flows/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,24 @@ def download_catalog(target=None, radius=24*u.arcmin, radius_ztf=3*u.arcsec, dis
target_name = row['target_name']
dd = row['discovery_date']
if dd is not None:
dd = Time(dd, format='iso', scale='utc')
dd = Time(dd, format='datetime', scale='utc')

# Coordinate of the target, which is the centre of the search cone:
coo_centre = SkyCoord(ra=row['ra'], dec=row['decl'], unit=u.deg, frame='icrs')

# Download combined catalog from all sources:
results = query_all(coo_centre, radius=radius, dist_cutoff=dist_cutoff)

# Query for a ZTF identifier for this target:
ztf_id = query_ztf_id(coo_centre, radius=radius_ztf, discovery_date=dd)

# Because the database is picky with datatypes, we need to change things
# before they are passed on to the database:
for row in results:
for key, val in row.items():
if isinstance(val, (np.int64, np.int32)):
row[key] = int(val)

# Insert the catalog into the local database:
try:
db.cursor.executemany("""INSERT INTO flows.refcat2 (
Expand Down

0 comments on commit 0302729

Please sign in to comment.