How to use the drizzlepac.astrodrizzle.adrizzle.do_driz 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 / multifit.py View on Github external
### Contamination-cleaned
        adrizzle.do_driz(beam_data, beam_wcs, wht, output_wcs, 
                         outsci, outwht, outctx, 1., 'cps', 1,
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Continuum
        adrizzle.do_driz(beam_continuum, beam_wcs, wht, output_wcs, 
                         coutsci, coutwht, coutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Contamination
        adrizzle.do_driz(beam.contam, beam_wcs, wht, output_wcs, 
                         xoutsci, xoutwht, xoutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Direct thumbnail
        if direct_extension == 'REF':
            if beam.direct['REF'] is None:
                direct_extension = 'SCI'
                
        if direct_extension == 'REF':
            thumb = beam.direct['REF']
            thumb_wht = np.cast[np.float32]((thumb != 0)*1)
        else:
            thumb = beam.direct[direct_extension]#/beam.direct.photflam
            thumb_wht = 1./(beam.direct.data['ERR']/beam.direct.photflam)**2
github gbrammer / grizli / grizli / multifit.py View on Github external
wht[~np.isfinite(data_i+scl)] = 0
            contam_weight[~np.isfinite(data_i+scl)] = 0
            data_i[~np.isfinite(data_i+scl)] = 0
        
        ###### Go drizzle
        
        ### Contamination-cleaned
        adrizzle.do_driz(data_i, beam_wcs, wht, output_wcs, 
                         outsci, outwht, outctx, 1., 'cps', 1,
                         wcslin_pscale=1.0, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        # For variance
        adrizzle.do_driz(contam_weight, beam_wcs, wht, output_wcs, 
                         outvar, outwv, outcv, 1., 'cps', 1,
                         wcslin_pscale=1.0, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        if ds9 is not None:
            ds9.view(outsci/output_wcs.pscale**2, header=out_header)
    
    ### Correct for drizzle scaling
    outsci /= output_wcs.pscale**2
    
    # variance
    outvar /= outwv*output_wcs.pscale**2
    outwht = 1/outvar
    outwht[(outvar == 0) | (~np.isfinite(outwht))] = 0
github gbrammer / grizli / grizli / multifit.py View on Github external
else:
            wht *= sens**2
            beam_data /= sens
            beam_continuum /= sens
        
        ###### Go drizzle
        
        ### Contamination-cleaned
        adrizzle.do_driz(beam_data, beam_wcs, wht, output_wcs, 
                         outsci, outwht, outctx, 1., 'cps', 1,
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Continuum
        adrizzle.do_driz(beam_continuum, beam_wcs, wht, output_wcs, 
                         coutsci, coutwht, coutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Contamination
        adrizzle.do_driz(beam.contam, beam_wcs, wht, output_wcs, 
                         xoutsci, xoutwht, xoutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Direct thumbnail
        if direct_extension == 'REF':
            if beam.direct['REF'] is None:
                direct_extension = 'SCI'
github gbrammer / grizli / grizli / multifit.py View on Github external
dlam = np.interp(wave, beam.beam.lam[1:], np.diff(beam.beam.lam))
        # 1e-17 erg/s/cm2 #, scaling closer to e-/s
        sens *= 1./dlam
        
        if sens == 0:
            continue
        else:
            wht *= sens**2
            beam_data /= sens
            beam_continuum /= sens
        
        ###### Go drizzle
        
        ### Contamination-cleaned
        adrizzle.do_driz(beam_data, beam_wcs, wht, output_wcs, 
                         outsci, outwht, outctx, 1., 'cps', 1,
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Continuum
        adrizzle.do_driz(beam_continuum, beam_wcs, wht, output_wcs, 
                         coutsci, coutwht, coutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        ### Contamination
        adrizzle.do_driz(beam.contam, beam_wcs, wht, output_wcs, 
                         xoutsci, xoutwht, xoutctx, 1., 'cps', 1, 
                         wcslin_pscale=beam.grism.wcs.pscale, uniqid=1,
github gbrammer / grizli / grizli / multifit.py View on Github external
scl = convert_to_flambda*beam.beam.total_flux/1.e-17
            scl *= 1./beam.flat_flam.reshape(beam.beam.sh_beam).sum(axis=0)
            #scl = convert_to_flambda/beam.beam.sensitivity
            
            data_i *= scl
            wht *= (1/scl)**2            
            #contam_weight *= scl
            
            wht[~np.isfinite(data_i+scl)] = 0
            contam_weight[~np.isfinite(data_i+scl)] = 0
            data_i[~np.isfinite(data_i+scl)] = 0
        
        ###### Go drizzle
        
        ### Contamination-cleaned
        adrizzle.do_driz(data_i, beam_wcs, wht, output_wcs, 
                         outsci, outwht, outctx, 1., 'cps', 1,
                         wcslin_pscale=1.0, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        # For variance
        adrizzle.do_driz(contam_weight, beam_wcs, wht, output_wcs, 
                         outvar, outwv, outcv, 1., 'cps', 1,
                         wcslin_pscale=1.0, uniqid=1, 
                         pixfrac=pixfrac, kernel=kernel, fillval=0, 
                         stepsize=10, wcsmap=None)
        
        if ds9 is not None:
            ds9.view(outsci/output_wcs.pscale**2, header=out_header)
    
    ### Correct for drizzle scaling

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 1 month ago

Package Health Score

84 / 100
Full package analysis