How to use the drizzlepac.adrizzle function in drizzlepac

To help you get started, we’ve selected a few drizzlepac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gbrammer / grizli / grizli / galfit / psf.py View on Github external
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:
github gbrammer / grizli / grizli / galfit / psf.py View on Github external
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:

drizzlepac

HST image combination using the drizzle algorithm to combine astronomical images, to model image distortion, to remove cosmic rays, and generally to improve the fidelity of data in the final image.

BSD-3-Clause
Latest version published 6 days ago

Package Health Score

81 / 100
Full package analysis