How to use the stwcs.updatewcs.updatewcs function in stwcs

To help you get started, we’ve selected a few stwcs 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 / prep.py View on Github external
TBD
    """
    from drizzlepac import updatehdr
    from stwcs import updatewcs
    from drizzlepac.astrodrizzle import AstroDrizzle
    
    wcs_log = Table.read('{0}_wcs.log'.format(direct['product']),
                         format='ascii.commented_header')
                         
    wcs_hdu = pyfits.open('{0}_wcs.fits'.format(direct['product']))
    
    if get_fresh_flt:
        for file in grism['files']:
            fresh_flt_file(file)
            updatewcs.updatewcs(file, verbose=False)
        
    direct_flt = pyfits.open(direct['files'][0])
    ref_catalog = direct_flt['SCI',1].header['WCSNAME']
    
    #### User-defined shifts
    if xyscale is not None:
        # Use user-defined shifts
        xsh, ysh, rot, scale = xyscale
        
        tmp_wcs = '/tmp/{0}_tmpwcs.fits'.format(str(direct['product']))
        ext = len(wcs_hdu)-1
        wcs_hdu[ext].writeto(tmp_wcs, clobber=True)
        
        for file in grism['files']:
            updatehdr.updatewcs_with_shift(file, tmp_wcs,
                                      xsh=xsh,

stwcs

Computes the WCS of HST images.

BSD-2-Clause
Latest version published 8 months ago

Package Health Score

68 / 100
Full package analysis