Skip to content

Commit

Permalink
Catch the issue of not accessing the LC
Browse files Browse the repository at this point in the history
  • Loading branch information
annayqho committed Apr 27, 2019
1 parent c35f497 commit 61b208b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ztf_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,16 @@ def get_finder(ra, dec, name, rad, debug=False, starlist=None, print_starlist=Tr

# Do you need to use a reference image?
need_ref = len(out) == 0
need_ref = 1
if need_ref is False:
print("Trying to using a science image")
try:
imfile, catfile = choose_sci(zquery, out, name, ra, dec)
except:
print("retrieving science image failed")
need_ref = True
if need_ref:
print("Using a reference image")
imfile, catfile = choose_ref(zquery, ra, dec)
else:
print("Using a science image")
imfile, catfile = choose_sci(zquery, out, name, ra, dec)

# get the cutout
inputf = pyfits.open(imfile)
Expand Down

0 comments on commit 61b208b

Please sign in to comment.