Skip to content

Commit

Permalink
updates to bitpix and default date
Browse files Browse the repository at this point in the history
  • Loading branch information
fedhere committed Sep 30, 2014
1 parent 2f20052 commit 7b5ede6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions coaddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
help='interactive plotting (with ion) and option to reject the last coadded image')
parser.add_option('--noalign', default=False, action="store_true",
help='just stack images without aligning')
parser.add_option('--norescale', default=False, action="store_true",
help='do not rescale image: otherwise the BITSCALE is set to 16')
parser.add_option('--nosatmask', default=False, action="store_true",
help='do not mask saturation')
parser.add_option('--mask', default=None, type="string",
Expand Down Expand Up @@ -193,7 +195,8 @@
mydate = header0[value]
except:
print "missing keyword ",k,value
mydate='2000-01-01'
import datetime
mydate=str(datetime.date.today())
print "date:",mydate

elif k == 'telescope':
Expand Down Expand Up @@ -348,6 +351,9 @@
myexposure=exposure
nimgs+=1
acceptedlist.append(allimgs[i].split("/")[-1])
print tmp
raw_input("here")
pl.imshow(tmp)
print mymjd,type(mymjd), int(float(mymjd))
mymjd=float(mymjd)
imid=int((mymjd-int(mymjd))*1e4)
Expand Down Expand Up @@ -407,12 +413,10 @@
try: int(existing.split('_')[-1].split('.')[0])
except: existing=existing[1:]
outfile = base+'_' + str(np.max([int(ii.split('_')[-1].split('.')[0]) for ii in existing]) + 1) + '.fits'
# print "try again sometime..."
# sys.exit()


out_fits = PF.PrimaryHDU(header=header0,data=tmp)
out_fits.scale(type=out_fits.NumCode[16],bzero=32768.0,bscale=1.0)
if not options.norescale: out_fits.scale(type=out_fits.NumCode[16],bzero=32768.0,bscale=1.0)
print 'writing',outfile
if SAFE:
out_fits.writeto(outfile, clobber=False)
Expand Down

0 comments on commit 7b5ede6

Please sign in to comment.