Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
psf = self.ePSF.eval_ePSF(psf_xy, xp, yp, extended_data=extended_data)
# if get_weight:
# fltim = pyfits.open(file)
# flt_weight = fltim[0].header['EXPTIME']
# else:
# flt_weight = 1
flt_weight = self.wcs[key].expweight
N = 13
psf_wcs = model.ImageData.get_slice_wcs(self.wcs[key], slice(xyp[0]-N, xyp[0]+N+1), slice(xyp[1]-N, xyp[1]+N+1))
psf_wcs.pscale = utils.get_wcs_pscale(self.wcs[key])
try:
adrizzle.do_driz(psf, psf_wcs, psf*0+flt_weight,
wcs_slice,
outsci, outwht, outctx, 1., 'cps', 1,
wcslin_pscale=1., uniqid=1,
pixfrac=pixfrac, kernel=kernel, fillval=0,
stepsize=10, wcsmap=None)
except:
psf_wcs._naxis1, psf_wcs._naxis2 = psf_wcs._naxis
adrizzle.do_driz(psf, psf_wcs, psf*0+flt_weight,
wcs_slice,
outsci, outwht, outctx, 1., 'cps', 1,
wcslin_pscale=1., uniqid=1,
pixfrac=pixfrac, kernel=kernel, fillval=0,
stepsize=10, wcsmap=None)
if False:
N = 13
psf_wcs = model.ImageData.get_slice_wcs(self.wcs[key], slice(xyp[0]-N, xyp[0]+N+1), slice(xyp[1]-N, xyp[1]+N+1))
psf_wcs.pscale = utils.get_wcs_pscale(self.wcs[key])
try:
adrizzle.do_driz(psf, psf_wcs, psf*0+flt_weight,
wcs_slice,
outsci, outwht, outctx, 1., 'cps', 1,
wcslin_pscale=1., uniqid=1,
pixfrac=pixfrac, kernel=kernel, fillval=0,
stepsize=10, wcsmap=None)
except:
psf_wcs._naxis1, psf_wcs._naxis2 = psf_wcs._naxis
adrizzle.do_driz(psf, psf_wcs, psf*0+flt_weight,
wcs_slice,
outsci, outwht, outctx, 1., 'cps', 1,
wcslin_pscale=1., uniqid=1,
pixfrac=pixfrac, kernel=kernel, fillval=0,
stepsize=10, wcsmap=None)
if False:
count += 1
hdu = pyfits.HDUList([pyfits.PrimaryHDU(), pyfits.ImageHDU(data=psf*100, header=utils.to_header(psf_wcs))])
ds9.set('frame {0}'.format(count+1))
ds9.set_pyfits(hdu)
#ss = 1000000/2
ss = 1./outsci.sum()
hdu = pyfits.HDUList([pyfits.PrimaryHDU(), pyfits.ImageHDU(data=outsci*ss, header=utils.to_header(wcs_slice))])
if False: