Optimizing Image Alignment for Multiple HST Visits

Note: The notebook in this repository 'Initialization.ipynb' goes over many of the basic concepts such as the setup of the environment/package installation and should be read first if you are new to HST images, DrizzlePac, or Astroquery.

Introduction

This notebook demonstrates how to use TweakReg and AstroDrizzle tasks to align and combine images. While this example focuses on ACS/WFC data, the procedure can be almost identically applied to WFC3/UVIS images. This notebook is based on a prior example from the 2012 DrizzlePac Handbook, but has been updated for compatibility with the STScI AstroConda software distribution. There is a good deal of explanatory text in this notebook, and users new to DrizzlePac are encouraged to start with this tutorial. Additional DrizzlePac software documentation is available at the readthedocs webpage.

Before running the notebook, you will need to install the astroquery package, which is used to retrieve the data from the MAST archive and the ccdproc package which is used to query the image headers.

Summary of steps:

  1. Download the data from MAST using astroquery.
  2. Align the images to a common reference frame, and update the WCS using TweakReg.
  3. Combine the aligned images using AstroDrizzle.
In [1]:
import glob
import os
import shutil

from astropy.io import ascii
from astropy.io import fits
from astropy.table import Table
from astropy.visualization import ZScaleInterval
from astroquery.mast import Observations
from ccdproc import ImageFileCollection
from drizzlepac import tweakreg
from drizzlepac import astrodrizzle
from IPython.display import Image
import matplotlib.pyplot as plt

%matplotlib inline
The following task in the stsci.skypac package can be run with TEAL:
                                    skymatch                                    
The following tasks in the drizzlepac package can be run with TEAL:
    astrodrizzle       imagefindpars           mapreg              photeq       
     pixreplace           pixtopix            pixtosky        refimagefindpars  
     resetbits          runastrodriz          skytopix           tweakback      
      tweakreg           updatenpol

1. Download the Data

In this example, we align three F606W full-frame 339 second ACS/WFC images of the globular cluster NGC 104 from ACS/CAL Program 10737. These observations were acquired over a 3-month period in separate visits and at different orientations. We will use calibrated, CTE-corrected *_flc.fits files, which are available for both WFC3/UVIS and ACS/WFC detectors.

        j9irw3fwq_flc.fits
        j9irw4b1q_flc.fits
        j9irw5kaq_flc.fits

First, we use astroquery to look for the desired datasets and retrieve them from MAST.

You may query on a large number of parameters, but to obtain these specific datasets we will only need to pass in a few: obstype = 'all' to include both calibration and GO programs in the search, obs_collection = 'HST' to exclude Hubble Legacy Archive images, and finally obs_id to search for a list of the dataset IDs. We finally select only 'FLC' data products using the parameter productSubGroupDescription while downloading the files. Because the second 'FLC' file for visit W4 is part of a dithered association, the obs_id for that assocation will need to be used instead of the individual filename.

Note: The next cell may take awhile to complete or may need to be run more than once, as errors may occasionally arise from a failed server connection.

In [2]:
# Query the data
obsTable = Observations.query_criteria(obstype='all', 
    obs_collection='HST',
    obs_id=['j9irw3fwq', 'j9irw4040', 'j9irw5kaq'])

# Download the files
products = Observations.get_product_list(obsTable)
Observations.download_products(products,download_dir='',
                               mrp_only=False,
                               productSubGroupDescription='FLC')

# Move to working directory (not necessary, but outputs will all be in the same place if this is done)
input_flcs = glob.glob(os.path.join('mastDownload', 'HST', '*', '*flc.fits'))
for flc in input_flcs:
    shutil.copy(flc, os.path.basename(flc))
shutil.rmtree('mastDownload') #remove mast download dir now that we've moved the files
Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/j9irw3fwq_flc.fits to ./mastDownload/HST/j9irw3fwq/j9irw3fwq_flc.fits ... [Done]
Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/j9irw4b1q_flc.fits to ./mastDownload/HST/j9irw4b1q/j9irw4b1q_flc.fits ... [Done]
Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/j9irw4b3q_flc.fits to ./mastDownload/HST/j9irw4b3q/j9irw4b3q_flc.fits ... [Done]
Downloading URL https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/j9irw5kaq_flc.fits to ./mastDownload/HST/j9irw5kaq/j9irw5kaq_flc.fits ... [Done]

The files were downloaded into the subdirectory 'mastDownload' within the current working directory and then moved to the current working directory.

Next we use ImageFileCollection to query the image headers to show the orientation differences between frames, as reflected by the keyword 'PA_V3'.

In [3]:
collect_ACS = ImageFileCollection('./', glob_include="*flc.fits", ext=0,
                                  keywords=["asn_id","filter1","filter2","exptime","date-obs","pa_v3"])

ACS_table = collect_ACS.summary
ACS_table['exptime'].format='7.1f'
ACS_table
Out[3]:
Table masked=True length=4
fileasn_idfilter1filter2exptimedate-obspa_v3
str18str9str5str7float64str10float64
j9irw3fwq_flc.fitsNONEF606WCLEAR2L339.02006-05-3057.33387
j9irw4b1q_flc.fitsJ9IRW4040F606WCLEAR2L339.02006-07-0893.880592
j9irw4b3q_flc.fitsJ9IRW4040F606WCLEAR2L339.02006-07-0893.880592
j9irw5kaq_flc.fitsNONEF606WCLEAR2L339.02006-08-31150.723907
In [4]:
#Remove the second file in the W4 association to simplify this notebook example and define the input file list.

os.remove('j9irw4b3q_flc.fits')
input_flcs = glob.glob('*flc.fits')
print(input_flcs)
['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']

2. Align the Images with TweakReg

In order to correctly align and combine multiple images into a distortion-free final drizzled product, AstroDrizzle relies on the World Coordinate System (WCS) information stored in the header of each image. Because the WCS information for an image is tied to the positions of guide stars used for the observation, each image will have small pointing errors offsets due to the uncertainty in guide star positions. The TweakReg software can align a set of images to better than subpixel accuracy (<0.1 pixel). All input images are aligned to one chosen reference image's WCS. The reference image is typically selected as the first image in the input list, but can be chosen explicitly via the refimage parameter, if desired.

The TweakReg algorithm consists of a few steps:

1. Makes a catalog of source positions for each input (and reference) image using a source finding algorithm        similar to DAOFind. 
2. Converts the pixel position catalogs to sky position catalogs.
3. Finds common source positions between reference and input image catalogs.
4. Calculates the shifts, rotation, and scale needed to align sky positions of sources in the input images.
5. (Optionally) Updates the input image headers with the newly calculated WCS information.

TweakReg has numerous parameters that are listed in the documentation. For this first pass, we will run TweakReg with default parameters and show how it fails for this dataset. In subsequent attempts, we will change critical parameters and show how this improves the alignment. The 5 parameters listed below are commented out when left at their default values and uncommented when set to non-defaults.

'conv_width' : 2x FWHM (~3.5 pix for point sources in ACS/WFC or WFC3/UVIS)
'threshold'  : Signal-to-noise above background. Start large and reduce until number of objects is acceptable.
'peakmax'    : Source brightness cutoff, set to avoid saturated sources. 
'searchrad'  : Search radius for finding common sources between images.
'fitgeometry': Geometry used to fit offsets, rotations and/or scale changes from the matched object lists. 
               The default `fitgeometry` of 'rscale' allows for an x/y shift, scale and rotation, and the 
               'general' fit allows for an xy/shift and an independent scale and rotation for each axis.

Note that both TweakReg and AstroDrizzle will by default load in settings from any existing .cfg files if you've run them before. Default parameters are restored by setting configobj = None.

2a. First test: Use 'default' parameters

This first test may take a long time to run because the default threshold value finds >100,000 objects per image. It is included for illustration purposes only, and users may skip to step 2b if desired.

In [5]:
tweakreg.TweakReg(input_flcs, 
    #conv_width=3.5, 
    #threshold=4, 
    #peakmax=None,
    #searchrad=1.0,
    #fitgeometry='rscale',
    configobj = None, 
    interactive=False,
    shiftfile=True, 
    outshifts='shift_default.txt',              
    updatehdr=False)
INFO:drizzlepac.util:Setting up logfile :  tweakreg.log
Setting up logfile :  tweakreg.log
INFO:drizzlepac.tweakreg:TweakReg Version 1.4.7(18-April-2018) started at: 06:12:45.025 (20/03/2019) 
TweakReg Version 1.4.7(18-April-2018) started at: 06:12:45.025 (20/03/2019) 
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.util:Version Information
Version Information
INFO:drizzlepac.util:--------------------
--------------------
INFO:drizzlepac.util:Python Version [GCC 7.3.0]
Python Version [GCC 7.3.0]
INFO:drizzlepac.util:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.util:numpy Version -> 1.15.4 
numpy Version -> 1.15.4 
INFO:drizzlepac.util:astropy Version -> 3.1.2 
astropy Version -> 3.1.2 
INFO:drizzlepac.util:stwcs Version -> 1.4.2 
stwcs Version -> 1.4.2 
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	exclusions :	
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Finding shifts for: 
Finding shifts for: 
INFO:drizzlepac.tweakreg:    j9irw3fwq_flc.fits
    j9irw3fwq_flc.fits
INFO:drizzlepac.tweakreg:    j9irw4b1q_flc.fits
    j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:    j9irw5kaq_flc.fits
    j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for finding sources for each input image:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	computesig :	True
INFO:drizzlepac.tweakreg:	conv_width :	3.5
INFO:drizzlepac.tweakreg:	dqbits :	
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	fluxmax :	None
INFO:drizzlepac.tweakreg:	fluxmin :	None
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	nsigma :	1.5
INFO:drizzlepac.tweakreg:	peakmax :	None
INFO:drizzlepac.tweakreg:	peakmin :	None
INFO:drizzlepac.tweakreg:	ratio :	1.0
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	roundhi :	1.0
INFO:drizzlepac.tweakreg:	roundlo :	-1.0
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	sharphi :	1.0
INFO:drizzlepac.tweakreg:	sharplo :	0.2
INFO:drizzlepac.tweakreg:	skysigma :	0.0
INFO:drizzlepac.tweakreg:	theta :	0.0
INFO:drizzlepac.tweakreg:	threshold :	4.0
INFO:drizzlepac.tweakreg:	updatehdr :	False
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	use_sharp_round :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:	xyunits :	pixels
INFO:drizzlepac.tweakreg:
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw3fwq_flc.fits':
===  Source finding for image 'j9irw3fwq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:12:45.183 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:12:45.183 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 8.055593
INFO:drizzlepac.catalogs:###Source finding finished at: 06:12:48.088 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 62570 objects.
     Found 62570 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:12:48.544 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:12:48.544 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.690619
INFO:drizzlepac.catalogs:###Source finding finished at: 06:12:51.642 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 69812 objects.
     Found 69812 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 132382
===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 132382
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw4b1q_flc.fits':
===  Source finding for image 'j9irw4b1q_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:12:52.939 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:12:52.939 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.959351
INFO:drizzlepac.catalogs:###Source finding finished at: 06:12:56.170 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 67922 objects.
     Found 67922 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:12:56.652 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:12:56.652 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.464318
INFO:drizzlepac.catalogs:###Source finding finished at: 06:12:59.927 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 72170 objects.
     Found 72170 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 140092
===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 140092
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw5kaq_flc.fits':
===  Source finding for image 'j9irw5kaq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:13:01.129 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:13:01.129 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.314131
INFO:drizzlepac.catalogs:###Source finding finished at: 06:13:03.727 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 53608 objects.
     Found 53608 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:13:04.111 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:13:04.111 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.037025
INFO:drizzlepac.catalogs:###Source finding finished at: 06:13:06.645 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 54797 objects.
     Found 54797 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 108405
===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 108405
INFO:drizzlepac.imgclasses:

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imgclasses:Converting RA/Dec positions of reference sources from "j9irw3fwq_flc.fits" to X,Y positions in reference WCS...
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:Performing alignment in the projection plane defined by the WCS
Performing alignment in the projection plane defined by the WCS
INFO:drizzlepac.tweakreg:derived from 'j9irw3fwq_flc.fits'
derived from 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for matching sources:
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	searchrad :	1.0
INFO:drizzlepac.tweakreg:	searchunits :	arcseconds
INFO:drizzlepac.tweakreg:	see2dplot :	True
INFO:drizzlepac.tweakreg:	separation :	0.5
INFO:drizzlepac.tweakreg:	tolerance :	1.0
INFO:drizzlepac.tweakreg:	use2dhist :	True
INFO:drizzlepac.tweakreg:	xoffset :	0.0
INFO:drizzlepac.tweakreg:	yoffset :	0.0
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for fitting source lists:
INFO:drizzlepac.tweakreg:	fitgeometry :	rscale
INFO:drizzlepac.tweakreg:	labelsize :	8
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	nclip :	3
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	sigma :	3.0
INFO:drizzlepac.tweakreg:	ylimit :	None
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for creating a shiftfile:
INFO:drizzlepac.tweakreg:	outshifts :	shift_default.txt
INFO:drizzlepac.tweakreg:	outwcs :	shifts_wcs.fits
INFO:drizzlepac.tweakreg:	shiftfile :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw4b1q_flc.fits
Performing fit for: j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/drizzlepac/tweakutils.py:1025: RuntimeWarning: invalid value encountered in double_scalars
  zpqual = flux/np.sqrt(delta_flux/delta_size)

INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  10.984024538309157 -9.990798134066075
Found initial X and Y shifts of  10.984024538309157 -9.990798134066075
INFO:drizzlepac.tweakutils:    with significance of  2632.279924324159 and  1061.0  matches
    with significance of  2632.279924324159 and  1061.0  matches
INFO:drizzlepac.imgclasses:Found 6535 matches for j9irw4b1q_flc.fits...
Found 6535 matches for j9irw4b1q_flc.fits...
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.imgclasses:Computed  rscale  fit for  j9irw4b1q_flc.fits : 
Computed  rscale  fit for  j9irw4b1q_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: 10.9800  YSH: -10.0005    ROT: 359.9995778    SCALE: 1.000002
XSH: 10.9800  YSH: -10.0005    ROT: 359.9995778    SCALE: 1.000002
INFO:drizzlepac.imgclasses:XRMS: 0.74    YRMS: 0.74
XRMS: 0.74    YRMS: 0.74
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 9.8e-06 (deg)   RMS_DEC: 1.4e-05 (deg)
RMS_RA: 9.8e-06 (deg)   RMS_DEC: 1.4e-05 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  6535  objects.
Final solution based on  6535  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  6535
Total # points:  6535
INFO:drizzlepac.tweakutils:# of points after clipping:  6535
# of points after clipping:  6535
INFO:drizzlepac.tweakutils:Total # points:  6535
Total # points:  6535
INFO:drizzlepac.tweakutils:# of points after clipping:  6535
# of points after clipping:  6535
INFO:drizzlepac.updatehdr:....Updating header for j9irw4b1q_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',1]
INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[4]
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw5kaq_flc.fits
Performing fit for: j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -11.01132179044395 -16.019761670593077
Found initial X and Y shifts of  -11.01132179044395 -16.019761670593077
INFO:drizzlepac.tweakutils:    with significance of  3452.9120259095785 and  1069.0  matches
    with significance of  3452.9120259095785 and  1069.0  matches
INFO:drizzlepac.imgclasses:Found 6485 matches for j9irw5kaq_flc.fits...
Found 6485 matches for j9irw5kaq_flc.fits...
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.imgclasses:Computed  rscale  fit for  j9irw5kaq_flc.fits : 
Computed  rscale  fit for  j9irw5kaq_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -10.9987  YSH: -16.0059    ROT: 359.9997542    SCALE: 0.999996
XSH: -10.9987  YSH: -16.0059    ROT: 359.9997542    SCALE: 0.999996
INFO:drizzlepac.imgclasses:XRMS: 0.73    YRMS: 0.75
XRMS: 0.73    YRMS: 0.75
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 1e-05 (deg)   RMS_DEC: 1.4e-05 (deg)
RMS_RA: 1e-05 (deg)   RMS_DEC: 1.4e-05 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  6485  objects.
Final solution based on  6485  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  6485
Total # points:  6485
INFO:drizzlepac.tweakutils:# of points after clipping:  6485
# of points after clipping:  6485
INFO:drizzlepac.tweakutils:Total # points:  6485
Total # points:  6485
INFO:drizzlepac.tweakutils:# of points after clipping:  6485
# of points after clipping:  6485
INFO:drizzlepac.updatehdr:....Updating header for j9irw5kaq_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',1]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[4]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.tweakutils:Writing out shiftfile : shift_default.txt
Writing out shiftfile : shift_default.txt
INFO:drizzlepac.util:Trailer file written to:  tweakreg.log
Trailer file written to:  tweakreg.log

TweakReg looks for sources which are 4-sigma above the background, but this threshold value is clearly too low, since the catalogs contain ~60,000 objects per chip in each frame, and ~6500 matched sources between each exposure. Setting the threshold to a very low value generally does not translate to a better solution, since all sources are weighted equally when computing fits to match catalogs. This is especially relevant for ACS/WFC and WFC3/UVIS data where CTE tails can shift the centroid position slightly along the readout direction for faint sources and potentially bias the fit.

The shift file below shows that the xrms and yrms of the computed fit is large, ~0.7 pixels.

In [6]:
shift_tab = Table.read('shift_default.txt',
                       format='ascii.no_header',
                       names=['file','dx','dy','rot','scale','xrms','yrms'])

formats = ['.2f', '.2f', '.3f', '.5f', '.2f', '.2f']
for i, col in enumerate(shift_tab.colnames[1:]):
    shift_tab[col].format = formats[i]
shift_tab
Out[6]:
Table length=3
filedxdyrotscalexrmsyrms
str18float64float64float64float64float64float64
j9irw3fwq_flc.fits0.000.000.0001.000000.000.00
j9irw4b1q_flc.fits10.98-10.00360.0001.000000.740.74
j9irw5kaq_flc.fits-11.00-16.01360.0001.000000.730.75

When interactive = False, TweakReg outputs several diagnostic plots in the working directory for you to inspect the fit quality. For each input file, except the reference file, TweakReg creates an x/y plot of fit residuals and a vector plot. Let's take a look at one of the residuals plots first.

In [7]:
#Give the 'fit residual plots' a unique name for comparison with other tests.

os.rename('residuals_j9irw5kaq_flc.png','residuals_j9irw5kaq_flc_default.png')
Image(filename='residuals_j9irw5kaq_flc_default.png', width=500, height=600) 
Out[7]:

2b. Second test: Increase threshold, peakmax

In this test, the threshold value was manually adjusted to a larger value, and the peakmax value was set to 70,000 electrons to exclude full-well saturated objects for gain=2. TweakReg now finds a more reasonable number of sources per ACS chip (~500) but fails to find an adequate number of sources matching the reference image due to a searchrad value of 1.0", which is too small.

In [8]:
tweakreg.TweakReg(input_flcs, 
    #conv_width=3.5, 
    threshold=4000, 
    #searchrad=1.0,
    peakmax=70000,
    #fitgeometry='rscale',
    configobj = None, 
    interactive=False,
    shiftfile=True, 
    outshifts='shift_thresh.txt',              
    updatehdr=False)
INFO:drizzlepac.util:Setting up logfile :  tweakreg.log
Setting up logfile :  tweakreg.log
INFO:drizzlepac.tweakreg:TweakReg Version 1.4.7(18-April-2018) started at: 06:13:58.848 (20/03/2019) 
TweakReg Version 1.4.7(18-April-2018) started at: 06:13:58.848 (20/03/2019) 
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.util:Version Information
Version Information
INFO:drizzlepac.util:--------------------
--------------------
INFO:drizzlepac.util:Python Version [GCC 7.3.0]
Python Version [GCC 7.3.0]
INFO:drizzlepac.util:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.util:numpy Version -> 1.15.4 
numpy Version -> 1.15.4 
INFO:drizzlepac.util:astropy Version -> 3.1.2 
astropy Version -> 3.1.2 
INFO:drizzlepac.util:stwcs Version -> 1.4.2 
stwcs Version -> 1.4.2 
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	exclusions :	
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Finding shifts for: 
Finding shifts for: 
INFO:drizzlepac.tweakreg:    j9irw3fwq_flc.fits
    j9irw3fwq_flc.fits
INFO:drizzlepac.tweakreg:    j9irw4b1q_flc.fits
    j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:    j9irw5kaq_flc.fits
    j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for finding sources for each input image:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	computesig :	True
INFO:drizzlepac.tweakreg:	conv_width :	3.5
INFO:drizzlepac.tweakreg:	dqbits :	
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	fluxmax :	None
INFO:drizzlepac.tweakreg:	fluxmin :	None
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	nsigma :	1.5
INFO:drizzlepac.tweakreg:	peakmax :	70000
INFO:drizzlepac.tweakreg:	peakmin :	None
INFO:drizzlepac.tweakreg:	ratio :	1.0
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	roundhi :	1.0
INFO:drizzlepac.tweakreg:	roundlo :	-1.0
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	sharphi :	1.0
INFO:drizzlepac.tweakreg:	sharplo :	0.2
INFO:drizzlepac.tweakreg:	skysigma :	0.0
INFO:drizzlepac.tweakreg:	theta :	0.0
INFO:drizzlepac.tweakreg:	threshold :	4000
INFO:drizzlepac.tweakreg:	updatehdr :	False
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	use_sharp_round :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:	xyunits :	pixels
INFO:drizzlepac.tweakreg:
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw3fwq_flc.fits':
===  Source finding for image 'j9irw3fwq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:13:59.032 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:13:59.032 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 8.055593
INFO:drizzlepac.catalogs:###Source finding finished at: 06:13:59.754 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 626 objects.
     Found 626 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:13:59.825 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:13:59.825 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.690619
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:00.591 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw4b1q_flc.fits':
===  Source finding for image 'j9irw4b1q_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:00.799 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:00.799 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.959351
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:01.565 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 703 objects.
     Found 703 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:01.636 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:01.636 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.464318
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:02.320 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw5kaq_flc.fits':
===  Source finding for image 'j9irw5kaq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:02.549 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:02.549 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.314131
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:03.252 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 524 objects.
     Found 524 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:03.322 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:03.322 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.037025
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:04.025 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 341 objects.
     Found 341 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Converting RA/Dec positions of reference sources from "j9irw3fwq_flc.fits" to X,Y positions in reference WCS...
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:Performing alignment in the projection plane defined by the WCS
Performing alignment in the projection plane defined by the WCS
INFO:drizzlepac.tweakreg:derived from 'j9irw3fwq_flc.fits'
derived from 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for matching sources:
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	searchrad :	1.0
INFO:drizzlepac.tweakreg:	searchunits :	arcseconds
INFO:drizzlepac.tweakreg:	see2dplot :	True
INFO:drizzlepac.tweakreg:	separation :	0.5
INFO:drizzlepac.tweakreg:	tolerance :	1.0
INFO:drizzlepac.tweakreg:	use2dhist :	True
INFO:drizzlepac.tweakreg:	xoffset :	0.0
INFO:drizzlepac.tweakreg:	yoffset :	0.0
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for fitting source lists:
INFO:drizzlepac.tweakreg:	fitgeometry :	rscale
INFO:drizzlepac.tweakreg:	labelsize :	8
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	nclip :	3
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	sigma :	3.0
INFO:drizzlepac.tweakreg:	ylimit :	None
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for creating a shiftfile:
INFO:drizzlepac.tweakreg:	outshifts :	shift_thresh.txt
INFO:drizzlepac.tweakreg:	outwcs :	shifts_wcs.fits
INFO:drizzlepac.tweakreg:	shiftfile :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw4b1q_flc.fits
Performing fit for: j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:stsci.imagestats:! WARNING: Clipped data falls within 1 histogram bin
! WARNING: Clipped data falls within 1 histogram bin
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  2.0 -10.8
Found initial X and Y shifts of  2.0 -10.8
INFO:drizzlepac.tweakutils:    with significance of  116.61903789690601 and  2.0  matches
    with significance of  116.61903789690601 and  2.0  matches
WARNING:drizzlepac.imgclasses:##############################################################################
WARNING:drizzlepac.imgclasses:#                                                                            #
WARNING:drizzlepac.imgclasses:# WARNING:                                                                   #
WARNING:drizzlepac.imgclasses:# Not enough matches (< 15) found for input image: j9irw4b1q_flc.fits        #
WARNING:drizzlepac.imgclasses:#                                                                            #
WARNING:drizzlepac.imgclasses:##############################################################################
INFO:drizzlepac.imgclasses:##############################################################################
##############################################################################
INFO:drizzlepac.imgclasses:#                                                                            #
#                                                                            #
INFO:drizzlepac.imgclasses:# WARNING:                                                                   #
# WARNING:                                                                   #
INFO:drizzlepac.imgclasses:# Not enough matches (< 15) found for input image: j9irw4b1q_flc.fits        #
# Not enough matches (< 15) found for input image: j9irw4b1q_flc.fits        #
INFO:drizzlepac.imgclasses:#                                                                            #
#                                                                            #
INFO:drizzlepac.imgclasses:##############################################################################
##############################################################################
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw5kaq_flc.fits
Performing fit for: j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:stsci.imagestats:! WARNING: Clipped data falls within 1 histogram bin
! WARNING: Clipped data falls within 1 histogram bin
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  3.666666666666668 -12.0
Found initial X and Y shifts of  3.666666666666668 -12.0
INFO:drizzlepac.tweakutils:    with significance of  121.19405926034494 and  2.0  matches
    with significance of  121.19405926034494 and  2.0  matches
WARNING:drizzlepac.imgclasses:##############################################################################
WARNING:drizzlepac.imgclasses:#                                                                            #
WARNING:drizzlepac.imgclasses:# WARNING:                                                                   #
WARNING:drizzlepac.imgclasses:# Not enough matches (< 15) found for input image: j9irw5kaq_flc.fits        #
WARNING:drizzlepac.imgclasses:#                                                                            #
WARNING:drizzlepac.imgclasses:##############################################################################
INFO:drizzlepac.imgclasses:##############################################################################
##############################################################################
INFO:drizzlepac.imgclasses:#                                                                            #
#                                                                            #
INFO:drizzlepac.imgclasses:# WARNING:                                                                   #
# WARNING:                                                                   #
INFO:drizzlepac.imgclasses:# Not enough matches (< 15) found for input image: j9irw5kaq_flc.fits        #
# Not enough matches (< 15) found for input image: j9irw5kaq_flc.fits        #
INFO:drizzlepac.imgclasses:#                                                                            #
#                                                                            #
INFO:drizzlepac.imgclasses:##############################################################################
##############################################################################
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Unable to match the following images:
Unable to match the following images:
INFO:drizzlepac.tweakreg:-------------------------------------
-------------------------------------
INFO:drizzlepac.tweakreg:j9irw4b1q_flc.fits
j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:j9irw5kaq_flc.fits
j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakutils:Writing out shiftfile : shift_thresh.txt
Writing out shiftfile : shift_thresh.txt
INFO:drizzlepac.util:Trailer file written to:  tweakreg.log
Trailer file written to:  tweakreg.log

2c. Third test: Increase searchrad

In this test, the searchrad value was increased to a larger value of 4.0". This large offset is atypical for current HST observations which have more accurate Guide Star positions, but is sometimes required for older observations, such as these taken in 2006.

TweakReg finds ~500 sources per ACS chip but TweakReg fails because is not able to find an adequate number of sources matching the reference image.

In [9]:
tweakreg.TweakReg(input_flcs, 
    #conv_width=3.5, 
    threshold=4000, 
    searchrad=4.0,
    peakmax=70000,
    #fitgeometry='rscale',
    configobj = None, 
    interactive=False,
    shiftfile=True, 
    outshifts='shift_searchrad.txt',              
    updatehdr=False)
INFO:drizzlepac.util:Setting up logfile :  tweakreg.log
Setting up logfile :  tweakreg.log
INFO:drizzlepac.tweakreg:TweakReg Version 1.4.7(18-April-2018) started at: 06:14:04.739 (20/03/2019) 
TweakReg Version 1.4.7(18-April-2018) started at: 06:14:04.739 (20/03/2019) 
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.util:Version Information
Version Information
INFO:drizzlepac.util:--------------------
--------------------
INFO:drizzlepac.util:Python Version [GCC 7.3.0]
Python Version [GCC 7.3.0]
INFO:drizzlepac.util:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.util:numpy Version -> 1.15.4 
numpy Version -> 1.15.4 
INFO:drizzlepac.util:astropy Version -> 3.1.2 
astropy Version -> 3.1.2 
INFO:drizzlepac.util:stwcs Version -> 1.4.2 
stwcs Version -> 1.4.2 
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	exclusions :	
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Finding shifts for: 
Finding shifts for: 
INFO:drizzlepac.tweakreg:    j9irw3fwq_flc.fits
    j9irw3fwq_flc.fits
INFO:drizzlepac.tweakreg:    j9irw4b1q_flc.fits
    j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:    j9irw5kaq_flc.fits
    j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for finding sources for each input image:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	computesig :	True
INFO:drizzlepac.tweakreg:	conv_width :	3.5
INFO:drizzlepac.tweakreg:	dqbits :	
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	fluxmax :	None
INFO:drizzlepac.tweakreg:	fluxmin :	None
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	nsigma :	1.5
INFO:drizzlepac.tweakreg:	peakmax :	70000
INFO:drizzlepac.tweakreg:	peakmin :	None
INFO:drizzlepac.tweakreg:	ratio :	1.0
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	roundhi :	1.0
INFO:drizzlepac.tweakreg:	roundlo :	-1.0
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	sharphi :	1.0
INFO:drizzlepac.tweakreg:	sharplo :	0.2
INFO:drizzlepac.tweakreg:	skysigma :	0.0
INFO:drizzlepac.tweakreg:	theta :	0.0
INFO:drizzlepac.tweakreg:	threshold :	4000
INFO:drizzlepac.tweakreg:	updatehdr :	False
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	use_sharp_round :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:	xyunits :	pixels
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw3fwq_flc.fits':
===  Source finding for image 'j9irw3fwq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:04.901 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:04.901 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 8.055593
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:05.607 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 626 objects.
     Found 626 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:05.678 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:05.678 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.690619
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:06.39 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw4b1q_flc.fits':
===  Source finding for image 'j9irw4b1q_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:06.604 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:06.604 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.959351
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:07.311 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 703 objects.
     Found 703 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:07.382 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:07.382 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.464318
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:08.13 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw5kaq_flc.fits':
===  Source finding for image 'j9irw5kaq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:08.359 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:08.359 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.314131
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:09.129 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 524 objects.
     Found 524 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:09.198 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:09.198 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.037025
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:09.944 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 341 objects.
     Found 341 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Converting RA/Dec positions of reference sources from "j9irw3fwq_flc.fits" to X,Y positions in reference WCS...
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:Performing alignment in the projection plane defined by the WCS
Performing alignment in the projection plane defined by the WCS
INFO:drizzlepac.tweakreg:derived from 'j9irw3fwq_flc.fits'
derived from 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for matching sources:
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	searchrad :	4.0
INFO:drizzlepac.tweakreg:	searchunits :	arcseconds
INFO:drizzlepac.tweakreg:	see2dplot :	True
INFO:drizzlepac.tweakreg:	separation :	0.5
INFO:drizzlepac.tweakreg:	tolerance :	1.0
INFO:drizzlepac.tweakreg:	use2dhist :	True
INFO:drizzlepac.tweakreg:	xoffset :	0.0
INFO:drizzlepac.tweakreg:	yoffset :	0.0
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for fitting source lists:
INFO:drizzlepac.tweakreg:	fitgeometry :	rscale
INFO:drizzlepac.tweakreg:	labelsize :	8
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	nclip :	3
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	sigma :	3.0
INFO:drizzlepac.tweakreg:	ylimit :	None
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for creating a shiftfile:
INFO:drizzlepac.tweakreg:	outshifts :	shift_searchrad.txt
INFO:drizzlepac.tweakreg:	outwcs :	shifts_wcs.fits
INFO:drizzlepac.tweakreg:	shiftfile :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw4b1q_flc.fits
Performing fit for: j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
INFO:drizzlepac.tweakutils:    with significance of  6856.673130040089 and  428.0  matches
    with significance of  6856.673130040089 and  428.0  matches
INFO:drizzlepac.imgclasses:Found 690 matches for j9irw4b1q_flc.fits...
Found 690 matches for j9irw4b1q_flc.fits...
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.imgclasses:Computed  rscale  fit for  j9irw4b1q_flc.fits : 
Computed  rscale  fit for  j9irw4b1q_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -30.0086  YSH: -40.1901    ROT: 0.004397630633    SCALE: 1.000010
XSH: -30.0086  YSH: -40.1901    ROT: 0.004397630633    SCALE: 1.000010
INFO:drizzlepac.imgclasses:XRMS: 0.039    YRMS: 0.038
XRMS: 0.039    YRMS: 0.038
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 4.7e-07 (deg)   RMS_DEC: 7.5e-07 (deg)
RMS_RA: 4.7e-07 (deg)   RMS_DEC: 7.5e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  680  objects.
Final solution based on  680  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.updatehdr:....Updating header for j9irw4b1q_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',1]
INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[4]
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw5kaq_flc.fits
Performing fit for: j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -10.0 -30.0196905766526
Found initial X and Y shifts of  -10.0 -30.0196905766526
INFO:drizzlepac.tweakutils:    with significance of  30564.731440011048 and  697.0  matches
    with significance of  30564.731440011048 and  697.0  matches
INFO:drizzlepac.imgclasses:Found 711 matches for j9irw5kaq_flc.fits...
Found 711 matches for j9irw5kaq_flc.fits...
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.linearfit:Performing "rscale" fit
INFO:drizzlepac.imgclasses:Computed  rscale  fit for  j9irw5kaq_flc.fits : 
Computed  rscale  fit for  j9irw5kaq_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -9.6516  YSH: -29.8824    ROT: 0.0007297714734    SCALE: 1.000010
XSH: -9.6516  YSH: -29.8824    ROT: 0.0007297714734    SCALE: 1.000010
INFO:drizzlepac.imgclasses:XRMS: 0.05    YRMS: 0.05
XRMS: 0.05    YRMS: 0.05
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 6.5e-07 (deg)   RMS_DEC: 9.7e-07 (deg)
RMS_RA: 6.5e-07 (deg)   RMS_DEC: 9.7e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  702  objects.
Final solution based on  702  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  702
Total # points:  702
INFO:drizzlepac.tweakutils:# of points after clipping:  702
# of points after clipping:  702
INFO:drizzlepac.tweakutils:Total # points:  702
Total # points:  702
INFO:drizzlepac.tweakutils:# of points after clipping:  702
# of points after clipping:  702
INFO:drizzlepac.updatehdr:....Updating header for j9irw5kaq_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',1]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[4]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.tweakutils:Writing out shiftfile : shift_searchrad.txt
Writing out shiftfile : shift_searchrad.txt
INFO:drizzlepac.util:Trailer file written to:  tweakreg.log
Trailer file written to:  tweakreg.log

The shift file below shows that the xrms and yrms of the computed fit is now ~0.05 pixels.

In [10]:
shift_tab=Table.read('shift_searchrad.txt',
                     format='ascii.no_header',
                     names=['file','dx','dy','rot','scale','xrms','yrms'])

formats = ['.2f', '.2f', '.3f', '.5f', '.2f', '.2f']
for i, col in enumerate(shift_tab.colnames[1:]):
    shift_tab[col].format = formats[i]
shift_tab
Out[10]:
Table length=3
filedxdyrotscalexrmsyrms
str18float64float64float64float64float64float64
j9irw3fwq_flc.fits0.000.000.0001.000000.000.00
j9irw4b1q_flc.fits-30.01-40.190.0041.000010.040.04
j9irw5kaq_flc.fits-9.65-29.880.0011.000010.050.05
In [11]:
#Give the 'fit residual plots' a unique name for comparison with other tests.

os.rename('residuals_j9irw4b1q_flc.png','residuals_j9irw4b1q_flc_searchrad.png')
Image(filename='residuals_j9irw4b1q_flc_searchrad.png', width=500, height=600) 
Out[11]:
In [12]:
#Give the 'fit residual plots' a unique name for comparison with other tests.

os.rename('vector_j9irw4b1q_flc.png', 'vector_j9irw4b1q_flc_searchrad.png')
Image(filename='vector_j9irw4b1q_flc_searchrad.png', width=500, height=600) 
Out[12]:

The residual plots are now much improved from the first run, but there is still a systematic skew in the fit residuals, which is believed to be caused by an uncorrected 'skew' in the ACS distortion solution.

As of creation of this notebook in 2018, the following calibration reference files were used:

    IDCTAB  = 'jref$0461802ej_idc.fits' / Image Distortion Correction Table
D2IMFILE = 'jref$02c1450oj_d2i.fits' / Column Correction Reference File
    NPOLFILE = 'jref$02c14514j_npl.fits' / Non-polynomial Offsets Reference File (F606W)

New distortion solutions, based on the latest Gaia DR2, are in the process of being derived by the ACS team, so observations retrieved from MAST at a later date may or may not show these systematic skew residuals. Fortunately, these can be corrected by allowing for a higher order fitgeometry as shown in the next test.

More information about the distortion reference files used by AstroDrizzle may be found here.

2d. Fourth test: Adjust the fitgeometry

In this test, the fitgeometry parameter is changed from the default 'rscale' to 'general' in order to allows for an xy/shift and an independent scale and rotation for each axis.

In [13]:
tweakreg.TweakReg(input_flcs, 
    #conv_width=3.5, 
    threshold=4000, 
    searchrad=4.0,
    peakmax=70000,
    fitgeometry='general',
    configobj = None, 
    interactive=False,
    shiftfile=True, 
    outshifts='shift_general.txt',              
    updatehdr=False)
INFO:drizzlepac.util:Setting up logfile :  tweakreg.log
Setting up logfile :  tweakreg.log
INFO:drizzlepac.tweakreg:TweakReg Version 1.4.7(18-April-2018) started at: 06:14:12.19 (20/03/2019) 
TweakReg Version 1.4.7(18-April-2018) started at: 06:14:12.19 (20/03/2019) 
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.util:Version Information
Version Information
INFO:drizzlepac.util:--------------------
--------------------
INFO:drizzlepac.util:Python Version [GCC 7.3.0]
Python Version [GCC 7.3.0]
INFO:drizzlepac.util:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.util:numpy Version -> 1.15.4 
numpy Version -> 1.15.4 
INFO:drizzlepac.util:astropy Version -> 3.1.2 
astropy Version -> 3.1.2 
INFO:drizzlepac.util:stwcs Version -> 1.4.2 
stwcs Version -> 1.4.2 
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	exclusions :	
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Finding shifts for: 
Finding shifts for: 
INFO:drizzlepac.tweakreg:    j9irw3fwq_flc.fits
    j9irw3fwq_flc.fits
INFO:drizzlepac.tweakreg:    j9irw4b1q_flc.fits
    j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:    j9irw5kaq_flc.fits
    j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for finding sources for each input image:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	computesig :	True
INFO:drizzlepac.tweakreg:	conv_width :	3.5
INFO:drizzlepac.tweakreg:	dqbits :	
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	fluxmax :	None
INFO:drizzlepac.tweakreg:	fluxmin :	None
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	nsigma :	1.5
INFO:drizzlepac.tweakreg:	peakmax :	70000
INFO:drizzlepac.tweakreg:	peakmin :	None
INFO:drizzlepac.tweakreg:	ratio :	1.0
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	roundhi :	1.0
INFO:drizzlepac.tweakreg:	roundlo :	-1.0
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	sharphi :	1.0
INFO:drizzlepac.tweakreg:	sharplo :	0.2
INFO:drizzlepac.tweakreg:	skysigma :	0.0
INFO:drizzlepac.tweakreg:	theta :	0.0
INFO:drizzlepac.tweakreg:	threshold :	4000
INFO:drizzlepac.tweakreg:	updatehdr :	False
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	use_sharp_round :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:	xyunits :	pixels
INFO:drizzlepac.tweakreg:
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw3fwq_flc.fits':
===  Source finding for image 'j9irw3fwq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:12.366 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:12.366 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 8.055593
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:13.096 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 626 objects.
     Found 626 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:13.168 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:13.168 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.690619
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:13.874 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw4b1q_flc.fits':
===  Source finding for image 'j9irw4b1q_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:14.088 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:14.088 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.959351
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:14.815 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 703 objects.
     Found 703 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:14.889 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:14.889 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.464318
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:15.600 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw5kaq_flc.fits':
===  Source finding for image 'j9irw5kaq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:15.83 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:15.83 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.314131
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:16.518 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 524 objects.
     Found 524 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:16.589 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:16.589 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.037025
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:17.369 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 341 objects.
     Found 341 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Converting RA/Dec positions of reference sources from "j9irw3fwq_flc.fits" to X,Y positions in reference WCS...
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:Performing alignment in the projection plane defined by the WCS
Performing alignment in the projection plane defined by the WCS
INFO:drizzlepac.tweakreg:derived from 'j9irw3fwq_flc.fits'
derived from 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for matching sources:
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	searchrad :	4.0
INFO:drizzlepac.tweakreg:	searchunits :	arcseconds
INFO:drizzlepac.tweakreg:	see2dplot :	True
INFO:drizzlepac.tweakreg:	separation :	0.5
INFO:drizzlepac.tweakreg:	tolerance :	1.0
INFO:drizzlepac.tweakreg:	use2dhist :	True
INFO:drizzlepac.tweakreg:	xoffset :	0.0
INFO:drizzlepac.tweakreg:	yoffset :	0.0
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for fitting source lists:
INFO:drizzlepac.tweakreg:	fitgeometry :	general
INFO:drizzlepac.tweakreg:	labelsize :	8
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	nclip :	3
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	sigma :	3.0
INFO:drizzlepac.tweakreg:	ylimit :	None
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for creating a shiftfile:
INFO:drizzlepac.tweakreg:	outshifts :	shift_general.txt
INFO:drizzlepac.tweakreg:	outwcs :	shifts_wcs.fits
INFO:drizzlepac.tweakreg:	shiftfile :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw4b1q_flc.fits
Performing fit for: j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
INFO:drizzlepac.tweakutils:    with significance of  6856.673130040089 and  428.0  matches
    with significance of  6856.673130040089 and  428.0  matches
INFO:drizzlepac.imgclasses:Found 690 matches for j9irw4b1q_flc.fits...
Found 690 matches for j9irw4b1q_flc.fits...
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.imgclasses:Computed  general  fit for  j9irw4b1q_flc.fits : 
Computed  general  fit for  j9irw4b1q_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -30.0042  YSH: -40.1841    PROPER ROT: 0.004468546459    
XSH: -30.0042  YSH: -40.1841    PROPER ROT: 0.004468546459    
INFO:drizzlepac.imgclasses:<ROT>: 0.004468546459  SKEW: -0.0008172839833    ROT_X: 0.00487718845  ROT_Y: 0.004059904467
<ROT>: 0.004468546459  SKEW: -0.0008172839833    ROT_X: 0.00487718845  ROT_Y: 0.004059904467
INFO:drizzlepac.imgclasses:<SCALE>: 1.000008798  SCALE_X: 0.9999868771  SCALE_Y: 1.00003072
<SCALE>: 1.000008798  SCALE_X: 0.9999868771  SCALE_Y: 1.00003072
INFO:drizzlepac.imgclasses:XRMS: 0.032    YRMS: 0.03
XRMS: 0.032    YRMS: 0.03
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 3.7e-07 (deg)   RMS_DEC: 6e-07 (deg)
RMS_RA: 3.7e-07 (deg)   RMS_DEC: 6e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  680  objects.
Final solution based on  680  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.updatehdr:....Updating header for j9irw4b1q_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',1]
INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[4]
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw5kaq_flc.fits
Performing fit for: j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -10.0 -30.0196905766526
Found initial X and Y shifts of  -10.0 -30.0196905766526
INFO:drizzlepac.tweakutils:    with significance of  30564.731440011048 and  697.0  matches
    with significance of  30564.731440011048 and  697.0  matches
INFO:drizzlepac.imgclasses:Found 711 matches for j9irw5kaq_flc.fits...
Found 711 matches for j9irw5kaq_flc.fits...
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.imgclasses:Computed  general  fit for  j9irw5kaq_flc.fits : 
Computed  general  fit for  j9irw5kaq_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -9.6614  YSH: -29.8731    PROPER ROT: 0.0007630584289    
XSH: -9.6614  YSH: -29.8731    PROPER ROT: 0.0007630584289    
INFO:drizzlepac.imgclasses:<ROT>: 180.0007631  SKEW: 359.9958898    ROT_X: 0.002818152887  ROT_Y: 359.998708
<ROT>: 180.0007631  SKEW: 359.9958898    ROT_X: 0.002818152887  ROT_Y: 359.998708
INFO:drizzlepac.imgclasses:<SCALE>: 1.000008179  SCALE_X: 1.000008792  SCALE_Y: 1.000007569
<SCALE>: 1.000008179  SCALE_X: 1.000008792  SCALE_Y: 1.000007569
INFO:drizzlepac.imgclasses:XRMS: 0.031    YRMS: 0.029
XRMS: 0.031    YRMS: 0.029
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 3.4e-07 (deg)   RMS_DEC: 5.9e-07 (deg)
RMS_RA: 3.4e-07 (deg)   RMS_DEC: 5.9e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  699  objects.
Final solution based on  699  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  699
Total # points:  699
INFO:drizzlepac.tweakutils:# of points after clipping:  699
# of points after clipping:  699
INFO:drizzlepac.tweakutils:Total # points:  699
Total # points:  699
INFO:drizzlepac.tweakutils:# of points after clipping:  699
# of points after clipping:  699
INFO:drizzlepac.updatehdr:....Updating header for j9irw5kaq_flc.fits...
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',1]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[1]
INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',2]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[4]
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.tweakutils:Writing out shiftfile : shift_general.txt
Writing out shiftfile : shift_general.txt
INFO:drizzlepac.util:Trailer file written to:  tweakreg.log
Trailer file written to:  tweakreg.log
In [14]:
shift_tab=Table.read('shift_general.txt',
                     format='ascii.no_header',
                     names=['file','dx','dy','rot','scale','xrms','yrms'])

formats = ['.2f', '.2f', '.3f', '.5f', '.2f', '.2f']
for i, col in enumerate(shift_tab.colnames[1:]):
    shift_tab[col].format = formats[i]
shift_tab
Out[14]:
Table length=3
filedxdyrotscalexrmsyrms
str18float64float64float64float64float64float64
j9irw3fwq_flc.fits0.000.000.0001.000000.000.00
j9irw4b1q_flc.fits-30.00-40.180.0041.000010.030.03
j9irw5kaq_flc.fits-9.66-29.870.0011.000010.030.03

While the shift file looks nearly identical to the prior run, this is because the axis-dependent rotation and scale values are averaged together in the shiftfile. To determine the actual values, it is necessary to inspect the logfile.

j9irw5kaq  SCALE_X: 1.000008792  SCALE_Y: 1.00000757  ROT_X: 0.002818152  ROT_Y: 359.998708  SKEW: 359.9958898
j9irw4b1q  SCALE_X: 0.999986877  SCALE_Y: 1.00003072  ROT_X: 0.004877188  ROT_Y: 0.00405990  SKEW:  -0.0008173   

The 'general' fit reduces the fit rms to ~0.03 pixels from the prior value of ~0.05 pixels and removes systematics from the residuals.

In [15]:
#Give the 'fit residual plots' a unique name for comparison with other tests.

os.rename('residuals_j9irw4b1q_flc.png', 'residuals_j9irw4b1q_flc_general.png')
Image(filename='residuals_j9irw4b1q_flc_general.png', width=500, height=600) 
Out[15]:

The plot above shows residuals in X and Y plotted as functions of X and Y. Each point represents a source that was used for the alignment. The residuals should look fairly random - if any correlation is seen, this is an indicator of a poor alignment solution. In some cases you will notice a wavy pattern in the residuals in X and Y. This is often seen for UVIS images and is a result of lithographic patterns of the detector that are not fully corrected for in the distortion solutions. The RMS in X and Y are also printed. For a good alignment, we are looking for an RMS on the order of 0.1 pixel or less.

In [16]:
#Give the 'vector residual plots' a unique name for comparison with other tests.

os.rename('vector_j9irw4b1q_flc.png', 'vector_j9irw4b1q_flc_general.png')
Image(filename='vector_j9irw4b1q_flc_general.png', width=500, height=600) 
Out[16]:

The direction and the magnitude of the arrows in the vector plot above represent the offsets in the source position between the image in question and the reference image. These should visually appear random if the alignment was sucessful.

You may need to run TweakReg run several times with varying parameters until a good fit is found. Notice in the above tests that updatehdr = False. This allows you to attempt the alignment and inspect the results without actually updating the WCS to solidify the alignment. Once you are satisfied with the results, TweakReg is run a final time with updatehdr = True, and a new WCS will be inserted in the file. The default name of this new WCS is 'TWEAK', but can be changed by setting the wcsname.

2e. Update header once optimal parameters are found

In [17]:
# Final run with ideal parameters, updatehdr = True

tweakreg.TweakReg(input_flcs, 
    conv_width=3.5, 
    threshold=4000, 
    searchrad=4.0,
    peakmax=70000,
    fitgeometry='general',
    configobj = None, 
    interactive=False,
    shiftfile=False, 
    updatehdr=True)
INFO:drizzlepac.util:Setting up logfile :  tweakreg.log
Setting up logfile :  tweakreg.log
INFO:drizzlepac.tweakreg:TweakReg Version 1.4.7(18-April-2018) started at: 06:14:19.583 (20/03/2019) 
TweakReg Version 1.4.7(18-April-2018) started at: 06:14:19.583 (20/03/2019) 
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.util:Version Information
Version Information
INFO:drizzlepac.util:--------------------
--------------------
INFO:drizzlepac.util:Python Version [GCC 7.3.0]
Python Version [GCC 7.3.0]
INFO:drizzlepac.util:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.util:numpy Version -> 1.15.4 
numpy Version -> 1.15.4 
INFO:drizzlepac.util:astropy Version -> 3.1.2 
astropy Version -> 3.1.2 
INFO:drizzlepac.util:stwcs Version -> 1.4.2 
stwcs Version -> 1.4.2 
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	exclusions :	
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:Finding shifts for: 
Finding shifts for: 
INFO:drizzlepac.tweakreg:    j9irw3fwq_flc.fits
    j9irw3fwq_flc.fits
INFO:drizzlepac.tweakreg:    j9irw4b1q_flc.fits
    j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:    j9irw5kaq_flc.fits
    j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for finding sources for each input image:
INFO:drizzlepac.tweakreg:	clean :	False
INFO:drizzlepac.tweakreg:	computesig :	True
INFO:drizzlepac.tweakreg:	conv_width :	3.5
INFO:drizzlepac.tweakreg:	dqbits :	
INFO:drizzlepac.tweakreg:	enforce_user_order :	True
INFO:drizzlepac.tweakreg:	expand_refcat :	False
INFO:drizzlepac.tweakreg:	fluxmax :	None
INFO:drizzlepac.tweakreg:	fluxmin :	None
INFO:drizzlepac.tweakreg:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.tweakreg:	interactive :	False
INFO:drizzlepac.tweakreg:	nsigma :	1.5
INFO:drizzlepac.tweakreg:	peakmax :	70000
INFO:drizzlepac.tweakreg:	peakmin :	None
INFO:drizzlepac.tweakreg:	ratio :	1.0
INFO:drizzlepac.tweakreg:	refimage :	
INFO:drizzlepac.tweakreg:	roundhi :	1.0
INFO:drizzlepac.tweakreg:	roundlo :	-1.0
INFO:drizzlepac.tweakreg:	runfile :	tweakreg.log
INFO:drizzlepac.tweakreg:	sharphi :	1.0
INFO:drizzlepac.tweakreg:	sharplo :	0.2
INFO:drizzlepac.tweakreg:	skysigma :	0.0
INFO:drizzlepac.tweakreg:	theta :	0.0
INFO:drizzlepac.tweakreg:	threshold :	4000
INFO:drizzlepac.tweakreg:	updatehdr :	True
INFO:drizzlepac.tweakreg:	updatewcs :	False
INFO:drizzlepac.tweakreg:	use_sharp_round :	False
INFO:drizzlepac.tweakreg:	verbose :	False
INFO:drizzlepac.tweakreg:	writecat :	True
INFO:drizzlepac.tweakreg:	xyunits :	pixels
INFO:drizzlepac.tweakreg:
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw3fwq_flc.fits':
===  Source finding for image 'j9irw3fwq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:19.863 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 1) started at: 06:14:19.863 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 8.055593
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:20.604 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 626 objects.
     Found 626 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:20.676 (20/03/2019)
  #  Source finding for 'j9irw3fwq_flc.fits', EXT=('SCI', 2) started at: 06:14:20.676 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.690619
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:21.383 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
===  FINAL number of objects in image 'j9irw3fwq_flc.fits': 1030
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw4b1q_flc.fits':
===  Source finding for image 'j9irw4b1q_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:21.611 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 1) started at: 06:14:21.611 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.959351
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:22.333 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 703 objects.
     Found 703 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:22.404 (20/03/2019)
  #  Source finding for 'j9irw4b1q_flc.fits', EXT=('SCI', 2) started at: 06:14:22.404 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 7.464318
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:23.115 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 404 objects.
     Found 404 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
===  FINAL number of objects in image 'j9irw4b1q_flc.fits': 1107
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:===  Source finding for image 'j9irw5kaq_flc.fits':
===  Source finding for image 'j9irw5kaq_flc.fits':
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:23.454 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 1) started at: 06:14:23.454 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.314131
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:24.261 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 524 objects.
     Found 524 objects.
INFO:drizzlepac.catalogs:  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:24.337 (20/03/2019)
  #  Source finding for 'j9irw5kaq_flc.fits', EXT=('SCI', 2) started at: 06:14:24.337 (20/03/2019)
INFO:drizzlepac.catalogs:   Finding sources using sky sigma = 9.037025
INFO:drizzlepac.catalogs:###Source finding finished at: 06:14:25.121 (20/03/2019)
INFO:drizzlepac.catalogs:     Found 341 objects.
     Found 341 objects.
INFO:drizzlepac.imgclasses:===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
===  FINAL number of objects in image 'j9irw5kaq_flc.fits': 865
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Converting RA/Dec positions of reference sources from "j9irw3fwq_flc.fits" to X,Y positions in reference WCS...
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:Performing alignment in the projection plane defined by the WCS
Performing alignment in the projection plane defined by the WCS
INFO:drizzlepac.tweakreg:derived from 'j9irw3fwq_flc.fits'
derived from 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakreg:===============================================================
===============================================================
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for matching sources:
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	searchrad :	4.0
INFO:drizzlepac.tweakreg:	searchunits :	arcseconds
INFO:drizzlepac.tweakreg:	see2dplot :	True
INFO:drizzlepac.tweakreg:	separation :	0.5
INFO:drizzlepac.tweakreg:	tolerance :	1.0
INFO:drizzlepac.tweakreg:	use2dhist :	True
INFO:drizzlepac.tweakreg:	xoffset :	0.0
INFO:drizzlepac.tweakreg:	yoffset :	0.0
INFO:drizzlepac.tweakreg:
INFO:drizzlepac.tweakreg:USER INPUT PARAMETERS for fitting source lists:
INFO:drizzlepac.tweakreg:	fitgeometry :	general
INFO:drizzlepac.tweakreg:	labelsize :	8
INFO:drizzlepac.tweakreg:	minobj :	15
INFO:drizzlepac.tweakreg:	nclip :	3
INFO:drizzlepac.tweakreg:	residplot :	both
INFO:drizzlepac.tweakreg:	sigma :	3.0
INFO:drizzlepac.tweakreg:	ylimit :	None
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw4b1q_flc.fits
Performing fit for: j9irw4b1q_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw4b1q_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
Found initial X and Y shifts of  -30.621739130434783 -40.99130434782609
INFO:drizzlepac.tweakutils:    with significance of  6856.673130040089 and  428.0  matches
    with significance of  6856.673130040089 and  428.0  matches
INFO:drizzlepac.imgclasses:Found 690 matches for j9irw4b1q_flc.fits...
Found 690 matches for j9irw4b1q_flc.fits...
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.imgclasses:Computed  general  fit for  j9irw4b1q_flc.fits : 
Computed  general  fit for  j9irw4b1q_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -30.0042  YSH: -40.1841    PROPER ROT: 0.004468546459    
XSH: -30.0042  YSH: -40.1841    PROPER ROT: 0.004468546459    
INFO:drizzlepac.imgclasses:<ROT>: 0.004468546459  SKEW: -0.0008172839833    ROT_X: 0.00487718845  ROT_Y: 0.004059904467
<ROT>: 0.004468546459  SKEW: -0.0008172839833    ROT_X: 0.00487718845  ROT_Y: 0.004059904467
INFO:drizzlepac.imgclasses:<SCALE>: 1.000008798  SCALE_X: 0.9999868771  SCALE_Y: 1.00003072
<SCALE>: 1.000008798  SCALE_X: 0.9999868771  SCALE_Y: 1.00003072
INFO:drizzlepac.imgclasses:XRMS: 0.032    YRMS: 0.03
XRMS: 0.032    YRMS: 0.03
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 3.7e-07 (deg)   RMS_DEC: 6e-07 (deg)
RMS_RA: 3.7e-07 (deg)   RMS_DEC: 6e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  680  objects.
Final solution based on  680  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
wrote XY data to:  j9irw4b1q_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.tweakutils:Total # points:  680
Total # points:  680
INFO:drizzlepac.tweakutils:# of points after clipping:  680
# of points after clipping:  680
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:....Updating header for j9irw4b1q_flc.fits...
....Updating header for j9irw4b1q_flc.fits...
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',1]
Processing j9irw4b1q_flc.fits['SCI',1]
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[1]
Updating header for j9irw4b1q_flc.fits[1]
INFO:drizzlepac.updatehdr:    with WCS of
INFO:stwcs.wcsutil.hstwcs:WCS Keywords
WCS Keywords
INFO:stwcs.wcsutil.hstwcs:

INFO:stwcs.wcsutil.hstwcs:CD_11  CD_12: -1.2925691887354924e-06 -1.3971052789816462e-05
CD_11  CD_12: -1.2925691887354924e-06 -1.3971052789816462e-05
INFO:stwcs.wcsutil.hstwcs:CD_21  CD_22: -1.37874153993747e-05 3.4342533777749347e-07
CD_21  CD_22: -1.37874153993747e-05 3.4342533777749347e-07
INFO:stwcs.wcsutil.hstwcs:CRVAL    : 5.705123991576119 -72.06817128824616
CRVAL    : 5.705123991576119 -72.06817128824616
INFO:stwcs.wcsutil.hstwcs:CRPIX    : 2048.0 1024.0
CRPIX    : 2048.0 1024.0
INFO:stwcs.wcsutil.hstwcs:NAXIS    : 4096 2048
NAXIS    : 4096 2048
INFO:stwcs.wcsutil.hstwcs:Plate Scale : 0.049852182052595895
Plate Scale : 0.049852182052595895
INFO:stwcs.wcsutil.hstwcs:ORIENTAT : -88.59188416089467
ORIENTAT : -88.59188416089467
INFO:drizzlepac.updatehdr:WCSNAME  :  TWEAK
WCSNAME  :  TWEAK
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:Processing j9irw4b1q_flc.fits['SCI',2]
Processing j9irw4b1q_flc.fits['SCI',2]
INFO:drizzlepac.updatehdr:

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw4b1q_flc.fits[4]
Updating header for j9irw4b1q_flc.fits[4]
INFO:drizzlepac.updatehdr:    with WCS of
INFO:stwcs.wcsutil.hstwcs:WCS Keywords
WCS Keywords
INFO:stwcs.wcsutil.hstwcs:

INFO:stwcs.wcsutil.hstwcs:CD_11  CD_12: -1.4809378933983524e-06 -1.3506770563446464e-05
CD_11  CD_12: -1.4809378933983524e-06 -1.3506770563446464e-05
INFO:stwcs.wcsutil.hstwcs:CD_21  CD_22: -1.3605625140100077e-05 2.498129693740875e-07
CD_21  CD_22: -1.3605625140100077e-05 2.498129693740875e-07
INFO:stwcs.wcsutil.hstwcs:CRVAL    : 5.611340698605562 -72.06749934671086
CRVAL    : 5.611340698605562 -72.06749934671086
INFO:stwcs.wcsutil.hstwcs:CRPIX    : 2048.0 1024.0
CRPIX    : 2048.0 1024.0
INFO:stwcs.wcsutil.hstwcs:NAXIS    : 4096 2048
NAXIS    : 4096 2048
INFO:stwcs.wcsutil.hstwcs:Plate Scale : 0.049269420600720766
Plate Scale : 0.049269420600720766
INFO:stwcs.wcsutil.hstwcs:ORIENTAT : -88.9404131066308
ORIENTAT : -88.9404131066308
INFO:drizzlepac.updatehdr:WCSNAME  :  TWEAK
WCSNAME  :  TWEAK
INFO:drizzlepac.imgclasses:    Writing out new WCS to alternate WCS: "B"
INFO:drizzlepac.imgclasses:Updating WCSCORR table with new WCS solution "TWEAK"
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

INFO:drizzlepac.tweakreg:

INFO:drizzlepac.tweakreg:====================
====================
INFO:drizzlepac.tweakreg:Performing fit for: j9irw5kaq_flc.fits
Performing fit for: j9irw5kaq_flc.fits
INFO:drizzlepac.tweakreg:

INFO:drizzlepac.imgclasses:Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
Matching sources from 'j9irw5kaq_flc.fits' with sources from reference image 'j9irw3fwq_flc.fits'
INFO:drizzlepac.tweakutils:Computing initial guess for X and Y shifts...
Computing initial guess for X and Y shifts...
INFO:drizzlepac.tweakutils:Found initial X and Y shifts of  -10.0 -30.0196905766526
Found initial X and Y shifts of  -10.0 -30.0196905766526
INFO:drizzlepac.tweakutils:    with significance of  30564.731440011048 and  697.0  matches
    with significance of  30564.731440011048 and  697.0  matches
INFO:drizzlepac.imgclasses:Found 711 matches for j9irw5kaq_flc.fits...
Found 711 matches for j9irw5kaq_flc.fits...
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.linearfit:Performing "general" fit
INFO:drizzlepac.imgclasses:Computed  general  fit for  j9irw5kaq_flc.fits : 
Computed  general  fit for  j9irw5kaq_flc.fits : 
INFO:drizzlepac.imgclasses:XSH: -9.6614  YSH: -29.8731    PROPER ROT: 0.0007630584289    
XSH: -9.6614  YSH: -29.8731    PROPER ROT: 0.0007630584289    
INFO:drizzlepac.imgclasses:<ROT>: 180.0007631  SKEW: 359.9958898    ROT_X: 0.002818152887  ROT_Y: 359.998708
<ROT>: 180.0007631  SKEW: 359.9958898    ROT_X: 0.002818152887  ROT_Y: 359.998708
INFO:drizzlepac.imgclasses:<SCALE>: 1.000008179  SCALE_X: 1.000008792  SCALE_Y: 1.000007569
<SCALE>: 1.000008179  SCALE_X: 1.000008792  SCALE_Y: 1.000007569
INFO:drizzlepac.imgclasses:XRMS: 0.031    YRMS: 0.029
XRMS: 0.031    YRMS: 0.029
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:RMS_RA: 3.4e-07 (deg)   RMS_DEC: 5.9e-07 (deg)
RMS_RA: 3.4e-07 (deg)   RMS_DEC: 5.9e-07 (deg)
INFO:drizzlepac.imgclasses:

INFO:drizzlepac.imgclasses:Final solution based on  699  objects.
Final solution based on  699  objects.
INFO:drizzlepac.imgclasses:Creating catalog for the fit: j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
wrote XY data to:  j9irw5kaq_flc_catalog_fit.match
INFO:drizzlepac.tweakutils:Total # points:  699
Total # points:  699
INFO:drizzlepac.tweakutils:# of points after clipping:  699
# of points after clipping:  699
INFO:drizzlepac.tweakutils:Total # points:  699
Total # points:  699
INFO:drizzlepac.tweakutils:# of points after clipping:  699
# of points after clipping:  699
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:....Updating header for j9irw5kaq_flc.fits...
....Updating header for j9irw5kaq_flc.fits...
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',1]
Processing j9irw5kaq_flc.fits['SCI',1]
INFO:drizzlepac.updatehdr:

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[1]
Updating header for j9irw5kaq_flc.fits[1]
INFO:drizzlepac.updatehdr:    with WCS of
INFO:stwcs.wcsutil.hstwcs:WCS Keywords
WCS Keywords
INFO:stwcs.wcsutil.hstwcs:

INFO:stwcs.wcsutil.hstwcs:CD_11  CD_12: -1.2283148710161914e-05 -7.289506408936989e-06
CD_11  CD_12: -1.2283148710161914e-05 -7.289506408936989e-06
INFO:stwcs.wcsutil.hstwcs:CD_21  CD_22: -6.392653476646905e-06 1.1923204531948128e-05
CD_21  CD_22: -6.392653476646905e-06 1.1923204531948128e-05
INFO:stwcs.wcsutil.hstwcs:CRVAL    : 5.684923465753231 -72.07974027387641
CRVAL    : 5.684923465753231 -72.07974027387641
INFO:stwcs.wcsutil.hstwcs:CRPIX    : 2048.0 1024.0
CRPIX    : 2048.0 1024.0
INFO:stwcs.wcsutil.hstwcs:NAXIS    : 4096 2048
NAXIS    : 4096 2048
INFO:stwcs.wcsutil.hstwcs:Plate Scale : 0.049850226704326456
Plate Scale : 0.049850226704326456
INFO:stwcs.wcsutil.hstwcs:ORIENTAT : -31.440423258734477
ORIENTAT : -31.440423258734477
INFO:drizzlepac.updatehdr:WCSNAME  :  TWEAK
WCSNAME  :  TWEAK
INFO:drizzlepac.updatehdr:

INFO:drizzlepac.updatehdr:Processing j9irw5kaq_flc.fits['SCI',2]
Processing j9irw5kaq_flc.fits['SCI',2]
INFO:drizzlepac.updatehdr:

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.updatehdr:Updating header for j9irw5kaq_flc.fits[4]
Updating header for j9irw5kaq_flc.fits[4]
INFO:drizzlepac.updatehdr:    with WCS of
INFO:stwcs.wcsutil.hstwcs:WCS Keywords
WCS Keywords
INFO:stwcs.wcsutil.hstwcs:

INFO:stwcs.wcsutil.hstwcs:CD_11  CD_12: -1.222805092817223e-05 -7.124838078718109e-06
CD_11  CD_12: -1.222805092817223e-05 -7.124838078718109e-06
INFO:stwcs.wcsutil.hstwcs:CD_21  CD_22: -6.144881055652223e-06 1.1477101290262778e-05
CD_21  CD_22: -6.144881055652223e-06 1.1477101290262778e-05
INFO:stwcs.wcsutil.hstwcs:CRVAL    : 5.635859438523883 -72.05512383390565
CRVAL    : 5.635859438523883 -72.05512383390565
INFO:stwcs.wcsutil.hstwcs:CRPIX    : 2048.0 1024.0
CRPIX    : 2048.0 1024.0
INFO:stwcs.wcsutil.hstwcs:NAXIS    : 4096 2048
NAXIS    : 4096 2048
INFO:stwcs.wcsutil.hstwcs:Plate Scale : 0.04926749132987825
Plate Scale : 0.04926749132987825
INFO:stwcs.wcsutil.hstwcs:ORIENTAT : -31.831482785875636
ORIENTAT : -31.831482785875636
INFO:drizzlepac.updatehdr:WCSNAME  :  TWEAK
WCSNAME  :  TWEAK
INFO:drizzlepac.imgclasses:    Writing out new WCS to alternate WCS: "B"
INFO:drizzlepac.imgclasses:Updating WCSCORR table with new WCS solution "TWEAK"
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

INFO:drizzlepac.imgclasses:    Saving Primary WCS to alternate WCS: " "
INFO:drizzlepac.imgclasses:Updating WCSCORR table with new WCS solution "TWEAK"
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/io/fits/card.py:266: VerifyWarning: Keyword name 'IDCSCALEB' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created.
  keyword), VerifyWarning)

INFO:drizzlepac.util:Trailer file written to:  tweakreg.log
Trailer file written to:  tweakreg.log

2f. Overplot Matched Sources on the Image

Let's plot the sources that were matched between all images on the bottom chip. Confusingly, this is referred to as 'chip 2' or SCI,1 or extension 1.

The cell below shows how to read in the *_fit.match file as an astropy table. Unfortunatley, it doesn't automatically name columns so you'll have to look at the header to grab the columns.

In [18]:
plt.figure(figsize = (20, 10))
chip1_data = fits.open('j9irw4b1q_flc.fits')['SCI', 1].data
zscale = ZScaleInterval()
z1, z2 = zscale.get_limits(chip1_data)
plt.imshow(chip1_data, cmap='Greys',origin='lower', vmin=z1, vmax=z2)

match_tab = ascii.read('j9irw4b1q_flc_catalog_fit.match')            #load match file in astropy table
match_tab_chip2 = match_tab[match_tab['col15'] == 1]                 #filter table for sources on chip 2 (on ext 1)
x_cord, y_cord = match_tab_chip2['col11'], match_tab_chip2['col12']

plt.scatter(x_cord, y_cord, s=30, edgecolor='r', facecolor='None',label='Matched Sources, Chip 2')
plt.ylim(0,2051)
plt.xlim(0,4096)
plt.legend(loc='best', fontsize=20)
Out[18]:
<matplotlib.legend.Legend at 0x7f7ed42d5d30>

3. Combine the Images using AstroDrizzle

Now that the images are aligned to a common WCS, they are ready for combination with AstroDrizzle. All of the input exposures taken in a single filter will contribute to a single drizzled output file.

The AstroDrizzle steps after alignment are summarized below.

1. A static pixel mask is created to flag bad detector pixels.
2. Sky subtraction is performed on masked images. 
3. Each image is individually drizzled, with geometric distortion corrections, to a common reference frame.
4. The distortion-free drizzled images are combined to create a median image.
5. The median image is blotted, or reverse-drizzled, back to the frame of each input image.
6. By comparing each input image with its counterpart blotted median image, the software locates bad pixels in
   each of the original frames & creates bad pixel masks (typically cosmic rays and bad pixels in the detector)
7. In the final step, input images are drizzled together onto a single output image.

Let's first run AstroDrizzle on the aligned input images in the next cell to create a combined image f606w_combined_drc, then go into further detail about the drizzle process.

Note that astrodrizzle supports the TEAL GUI interface for setting parameters, as well as loading in a custom configuration file (.cfg) files, but we will be using the command-line syntax interface to set the parameters in this example, where parameters are passed into the function directly. Any existing .cfg file will be overridden by setting configobj = None so that unless explicitly set, parameters will be reset to default.

In [19]:
astrodrizzle.AstroDrizzle(input_flcs,
    output='f606w_combined',
    preserve=False,
    driz_sep_bits='64,16',
    driz_cr_corr=True,
    final_bits='64,16',
    clean=False,
    configobj=None,
    build=True)
INFO:drizzlepac.util:Setting up logfile :  astrodrizzle.log
Setting up logfile :  astrodrizzle.log
INFO:drizzlepac.astrodrizzle:AstroDrizzle Version 2.2.6 (2018-11-02 15:37:13 -0400) started at: 06:14:30.35 (20/03/2019)
AstroDrizzle Version 2.2.6 (2018-11-02 15:37:13 -0400) started at: 06:14:30.35 (20/03/2019)
INFO:drizzlepac.astrodrizzle:

INFO:drizzlepac.astrodrizzle:Version Information
INFO:drizzlepac.astrodrizzle:--------------------
INFO:drizzlepac.astrodrizzle:Python Version [GCC 7.3.0]
INFO:drizzlepac.astrodrizzle:3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
INFO:drizzlepac.astrodrizzle:numpy Version -> 1.15.4 
INFO:drizzlepac.astrodrizzle:astropy Version -> 3.1.2 
INFO:drizzlepac.astrodrizzle:stwcs Version -> 1.4.2 
INFO:drizzlepac.util:==== Processing Step  Initialization  started at  06:14:30.35 (20/03/2019)
==== Processing Step  Initialization  started at  06:14:30.35 (20/03/2019)
INFO:drizzlepac.processInput:Executing serially
INFO:drizzlepac.processInput:Setting up output name: f606w_combined_drc.fits
INFO:drizzlepac.processInput:-Creating imageObject List as input for processing steps.
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2691: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2701: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 31.99899673461914
INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 31.99899673461914
WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2686: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

WARNING:py.warnings:/opt/conda/envs/notebooks_env/lib/python3.6/site-packages/astropy/wcs/wcs.py:2696: AstropyDeprecationWarning: 
Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1.
Instead use the "pixel_shape" property which returns a list of NAXISj keyword values.

  warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning)

INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 30.26339721679687
INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 30.26339721679687
INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 44.91743087768555
INFO:drizzlepac.imageObject:Reading in MDRIZSKY of 44.91743087768555
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw3fwq_flc.fits[DQ,1]
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw3fwq_flc.fits[DQ,2]
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw4b1q_flc.fits[DQ,1]
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw4b1q_flc.fits[DQ,2]
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw5kaq_flc.fits[DQ,1]
INFO:drizzlepac.resetbits:Reset bit values of 4096 to a value of 0 in j9irw5kaq_flc.fits[DQ,2]
INFO:drizzlepac.processInput:-Creating output WCS.
INFO:astropy.wcs.wcs:WCS Keywords
WCS Keywords
INFO:astropy.wcs.wcs:

INFO:astropy.wcs.wcs:Number of WCS axes: 2
Number of WCS axes: 2
INFO:astropy.wcs.wcs:CTYPE : 'RA---TAN'  'DEC--TAN'  
CTYPE : 'RA---TAN'  'DEC--TAN'  
INFO:astropy.wcs.wcs:CRVAL : 5.660320326432237  -72.06888179453657  
CRVAL : 5.660320326432237  -72.06888179453657  
INFO:astropy.wcs.wcs:CRPIX : 2729.5  2958.0  
CRPIX : 2729.5  2958.0  
INFO:astropy.wcs.wcs:CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
INFO:astropy.wcs.wcs:CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
INFO:astropy.wcs.wcs:NAXIS : 5459  5916
NAXIS : 5459  5916
INFO:drizzlepac.processInput:********************************************************************************
********************************************************************************
INFO:drizzlepac.processInput:*
*
INFO:drizzlepac.processInput:*  Estimated memory usage:  up to 2601 Mb.
*  Estimated memory usage:  up to 2601 Mb.
INFO:drizzlepac.processInput:*  Output image size:       5459 X 5916 pixels. 
*  Output image size:       5459 X 5916 pixels. 
INFO:drizzlepac.processInput:*  Output image file:       ~ 369 Mb. 
*  Output image file:       ~ 369 Mb. 
INFO:drizzlepac.processInput:*  Cores available:         6
*  Cores available:         6
INFO:drizzlepac.processInput:*
*
INFO:drizzlepac.processInput:********************************************************************************
********************************************************************************
INFO:drizzlepac.util:==== Processing Step  Initialization  finished at  06:14:32.016 (20/03/2019)
==== Processing Step  Initialization  finished at  06:14:32.016 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.astrodrizzle:USER INPUT PARAMETERS common to all Processing Steps:
INFO:drizzlepac.astrodrizzle:	build :	True
INFO:drizzlepac.astrodrizzle:	coeffs :	True
INFO:drizzlepac.astrodrizzle:	context :	True
INFO:drizzlepac.astrodrizzle:	crbit :	4096
INFO:drizzlepac.astrodrizzle:	group :	
INFO:drizzlepac.astrodrizzle:	in_memory :	False
INFO:drizzlepac.astrodrizzle:	input :	['j9irw3fwq_flc.fits', 'j9irw4b1q_flc.fits', 'j9irw5kaq_flc.fits']
INFO:drizzlepac.astrodrizzle:	mdriztab :	False
INFO:drizzlepac.astrodrizzle:	num_cores :	None
INFO:drizzlepac.astrodrizzle:	output :	f606w_combined
INFO:drizzlepac.astrodrizzle:	proc_unit :	native
INFO:drizzlepac.astrodrizzle:	resetbits :	4096
INFO:drizzlepac.astrodrizzle:	runfile :	astrodrizzle.log
INFO:drizzlepac.astrodrizzle:	stepsize :	10
INFO:drizzlepac.astrodrizzle:	updatewcs :	False
INFO:drizzlepac.astrodrizzle:	wcskey :	
INFO:drizzlepac.util:==== Processing Step  Static Mask  started at  06:14:32.025 (20/03/2019)
==== Processing Step  Static Mask  started at  06:14:32.025 (20/03/2019)
INFO:drizzlepac.staticMask:USER INPUT PARAMETERS for Static Mask Step:
INFO:drizzlepac.staticMask:	static :	True
INFO:drizzlepac.staticMask:	static_sig :	4.0
INFO:drizzlepac.staticMask:Computing static mask:

INFO:drizzlepac.staticMask:  mode = 31.581122;   rms = 43.616795;   static_sig = 4.00
INFO:drizzlepac.staticMask:  mode = 28.347710;   rms = 26.715811;   static_sig = 4.00
INFO:drizzlepac.staticMask:Computing static mask:

INFO:drizzlepac.staticMask:  mode = 31.350260;   rms = 46.306313;   static_sig = 4.00
INFO:drizzlepac.staticMask:  mode = 28.091238;   rms = 25.783632;   static_sig = 4.00
INFO:drizzlepac.staticMask:Computing static mask:

INFO:drizzlepac.staticMask:  mode = 43.469596;   rms = 43.507801;   static_sig = 4.00
INFO:drizzlepac.staticMask:  mode = 41.370675;   rms = 32.013336;   static_sig = 4.00
INFO:drizzlepac.staticMask:Saving static mask to disk: ./ACSWFC_2048x4096_1_staticMask.fits
INFO:drizzlepac.staticMask:Saving static mask to disk: ./ACSWFC_2048x4096_2_staticMask.fits
INFO:drizzlepac.util:==== Processing Step  Static Mask  finished at  06:14:33.974 (20/03/2019)
==== Processing Step  Static Mask  finished at  06:14:33.974 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Subtract Sky  started at  06:14:33.977 (20/03/2019)
==== Processing Step  Subtract Sky  started at  06:14:33.977 (20/03/2019)
INFO:drizzlepac.sky:USER INPUT PARAMETERS for Sky Subtraction Step:
INFO:drizzlepac.sky:	sky_bits :	0
INFO:drizzlepac.sky:	skyclip :	5
INFO:drizzlepac.sky:	skyfile :	
INFO:drizzlepac.sky:	skylower :	None
INFO:drizzlepac.sky:	skylsigma :	4.0
INFO:drizzlepac.sky:	skymask_cat :	
INFO:drizzlepac.sky:	skymethod :	localmin
INFO:drizzlepac.sky:	skystat :	median
INFO:drizzlepac.sky:	skysub :	True
INFO:drizzlepac.sky:	skyupper :	None
INFO:drizzlepac.sky:	skyuser :	
INFO:drizzlepac.sky:	skyusigma :	4.0
INFO:drizzlepac.sky:	skywidth :	0.1
INFO:drizzlepac.sky:	use_static :	True
INFO:stsci.skypac.utils:***** skymatch started on 2019-03-20 06:14:34.458268
***** skymatch started on 2019-03-20 06:14:34.458268
INFO:stsci.skypac.utils:      Version 1.0.2 (2019-03-07 00:54:44 -0500)
      Version 1.0.2 (2019-03-07 00:54:44 -0500)
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:'skymatch' task will apply computed sky differences to input image file(s).
'skymatch' task will apply computed sky differences to input image file(s).
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:NOTE: Computed sky values WILL NOT be subtracted from image data ('subtractsky'=False).
NOTE: Computed sky values WILL NOT be subtracted from image data ('subtractsky'=False).
INFO:stsci.skypac.utils:'MDRIZSKY' header keyword will represent sky value *computed* from data.
'MDRIZSKY' header keyword will represent sky value *computed* from data.
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:-----  User specified keywords:  -----
-----  User specified keywords:  -----
INFO:stsci.skypac.utils:       Sky Value Keyword:  'MDRIZSKY'
       Sky Value Keyword:  'MDRIZSKY'
INFO:stsci.skypac.utils:       Data Units Keyword: 'BUNIT'
       Data Units Keyword: 'BUNIT'
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:-----  Input file list:  -----
-----  Input file list:  -----
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   **  Input image: 'j9irw3fwq_flc.fits'
   **  Input image: 'j9irw3fwq_flc.fits'
INFO:stsci.skypac.utils:       EXT: 'SCI',1;	MASK: j9irw3fwq_skymatch_mask_sci1.fits[0]
       EXT: 'SCI',1;	MASK: j9irw3fwq_skymatch_mask_sci1.fits[0]
INFO:stsci.skypac.utils:       EXT: 'SCI',2;	MASK: j9irw3fwq_skymatch_mask_sci2.fits[0]
       EXT: 'SCI',2;	MASK: j9irw3fwq_skymatch_mask_sci2.fits[0]
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   **  Input image: 'j9irw4b1q_flc.fits'
   **  Input image: 'j9irw4b1q_flc.fits'
INFO:stsci.skypac.utils:       EXT: 'SCI',1;	MASK: j9irw4b1q_skymatch_mask_sci1.fits[0]
       EXT: 'SCI',1;	MASK: j9irw4b1q_skymatch_mask_sci1.fits[0]
INFO:stsci.skypac.utils:       EXT: 'SCI',2;	MASK: j9irw4b1q_skymatch_mask_sci2.fits[0]
       EXT: 'SCI',2;	MASK: j9irw4b1q_skymatch_mask_sci2.fits[0]
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   **  Input image: 'j9irw5kaq_flc.fits'
   **  Input image: 'j9irw5kaq_flc.fits'
INFO:stsci.skypac.utils:       EXT: 'SCI',1;	MASK: j9irw5kaq_skymatch_mask_sci1.fits[0]
       EXT: 'SCI',1;	MASK: j9irw5kaq_skymatch_mask_sci1.fits[0]
INFO:stsci.skypac.utils:       EXT: 'SCI',2;	MASK: j9irw5kaq_skymatch_mask_sci2.fits[0]
       EXT: 'SCI',2;	MASK: j9irw5kaq_skymatch_mask_sci2.fits[0]
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:-----  Sky statistics parameters:  -----
-----  Sky statistics parameters:  -----
INFO:stsci.skypac.utils:       statistics function: 'median'
       statistics function: 'median'
INFO:stsci.skypac.utils:       lower = None
       lower = None
INFO:stsci.skypac.utils:       upper = None
       upper = None
INFO:stsci.skypac.utils:       nclip = 5
       nclip = 5
INFO:stsci.skypac.utils:       lsigma = 4.0
       lsigma = 4.0
INFO:stsci.skypac.utils:       usigma = 4.0
       usigma = 4.0
INFO:stsci.skypac.utils:       binwidth = 0.1
       binwidth = 0.1
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:-----  Data->Brightness conversion parameters for input files:  -----
-----  Data->Brightness conversion parameters for input files:  -----
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   *   Image: j9irw3fwq_flc.fits
   *   Image: j9irw3fwq_flc.fits
INFO:stsci.skypac.utils:       EXT = 'SCI',1
       EXT = 'SCI',1
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:       EXT = 'SCI',2
       EXT = 'SCI',2
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   *   Image: j9irw4b1q_flc.fits
   *   Image: j9irw4b1q_flc.fits
INFO:stsci.skypac.utils:       EXT = 'SCI',1
       EXT = 'SCI',1
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:       EXT = 'SCI',2
       EXT = 'SCI',2
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   *   Image: j9irw5kaq_flc.fits
   *   Image: j9irw5kaq_flc.fits
INFO:stsci.skypac.utils:       EXT = 'SCI',1
       EXT = 'SCI',1
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:       EXT = 'SCI',2
       EXT = 'SCI',2
INFO:stsci.skypac.utils:             Data units type: COUNTS
             Data units type: COUNTS
INFO:stsci.skypac.utils:             EXPTIME: 339.0 [s]
             EXPTIME: 339.0 [s]
INFO:stsci.skypac.utils:             Conversion factor (data->brightness):  1.1799410029498523
             Conversion factor (data->brightness):  1.1799410029498523
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:-----  Computing sky values requested image extensions (detector chips):  -----
-----  Computing sky values requested image extensions (detector chips):  -----
INFO:stsci.skypac.utils:

INFO:stsci.skypac.utils:   *   Image:   'j9irw3fwq_flc.fits['SCI',1,2]'  --  SKY = 37.75692154875898 (brightness units)
   *   Image:   'j9irw3fwq_flc.fits['SCI',1,2]'  --  SKY = 37.75692154875898 (brightness units)
INFO:stsci.skypac.utils:       Sky change (data units):
       Sky change (data units):
INFO:stsci.skypac.utils:      - EXT = 'SCI',1   delta(MDRIZSKY) = 31.999   NEW MDRIZSKY = 31.999
      - EXT = 'SCI',1   delta(MDRIZSKY) = 31.999   NEW MDRIZSKY = 31.999
INFO:stsci.skypac.utils:      - EXT = 'SCI',2   delta(MDRIZSKY) = 31.999   NEW MDRIZSKY = 31.999
      - EXT = 'SCI',2   delta(MDRIZSKY) = 31.999   NEW MDRIZSKY = 31.999
INFO:stsci.skypac.utils:   *   Image:   'j9irw4b1q_flc.fits['SCI',1,2]'  --  SKY = 35.70903676801022 (brightness units)
   *   Image:   'j9irw4b1q_flc.fits['SCI',1,2]'  --  SKY = 35.70903676801022 (brightness units)
INFO:stsci.skypac.utils:       Sky change (data units):
       Sky change (data units):
INFO:stsci.skypac.utils:      - EXT = 'SCI',1   delta(MDRIZSKY) = 30.2634   NEW MDRIZSKY = 30.2634
      - EXT = 'SCI',1   delta(MDRIZSKY) = 30.2634   NEW MDRIZSKY = 30.2634
INFO:stsci.skypac.utils:      - EXT = 'SCI',2   delta(MDRIZSKY) = 30.2634   NEW MDRIZSKY = 30.2634
      - EXT = 'SCI',2   delta(MDRIZSKY) = 30.2634   NEW MDRIZSKY = 30.2634
INFO:stsci.skypac.utils:   *   Image:   'j9irw5kaq_flc.fits['SCI',1,2]'  --  SKY = 52.99996345092412 (brightness units)
   *   Image:   'j9irw5kaq_flc.fits['SCI',1,2]'  --  SKY = 52.99996345092412 (brightness units)
INFO:stsci.skypac.utils:       Sky change (data units):
       Sky change (data units):
INFO:stsci.skypac.utils:      - EXT = 'SCI',1   delta(MDRIZSKY) = 44.9175   NEW MDRIZSKY = 44.9175
      - EXT = 'SCI',1   delta(MDRIZSKY) = 44.9175   NEW MDRIZSKY = 44.9175
INFO:stsci.skypac.utils:      - EXT = 'SCI',2   delta(MDRIZSKY) = 44.9175   NEW MDRIZSKY = 44.9175
      - EXT = 'SCI',2   delta(MDRIZSKY) = 44.9175   NEW MDRIZSKY = 44.9175
INFO:stsci.skypac.utils:***** skymatch ended on 2019-03-20 06:14:37.334967
***** skymatch ended on 2019-03-20 06:14:37.334967
INFO:stsci.skypac.utils:TOTAL RUN TIME: 0:00:02.876699
TOTAL RUN TIME: 0:00:02.876699
INFO:drizzlepac.util:==== Processing Step  Subtract Sky  finished at  06:14:37.541 (20/03/2019)
==== Processing Step  Subtract Sky  finished at  06:14:37.541 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Separate Drizzle  started at  06:14:37.544 (20/03/2019)
==== Processing Step  Separate Drizzle  started at  06:14:37.544 (20/03/2019)
INFO:drizzlepac.adrizzle:Interpreted paramDict with single=True as:
{'build': True, 'stepsize': 10, 'coeffs': True, 'wcskey': '', 'kernel': 'turbo', 'wt_scl': 'exptime', 'pixfrac': 1.0, 'fillval': None, 'bits': 80, 'compress': False, 'units': 'cps'}
INFO:drizzlepac.adrizzle:USER INPUT PARAMETERS for Separate Drizzle Step:
INFO:drizzlepac.adrizzle:	bits :	80
INFO:drizzlepac.adrizzle:	build :	False
INFO:drizzlepac.adrizzle:	clean :	False
INFO:drizzlepac.adrizzle:	coeffs :	True
INFO:drizzlepac.adrizzle:	compress :	False
INFO:drizzlepac.adrizzle:	crbit :	None
INFO:drizzlepac.adrizzle:	fillval :	None
INFO:drizzlepac.adrizzle:	kernel :	turbo
INFO:drizzlepac.adrizzle:	num_cores :	None
INFO:drizzlepac.adrizzle:	pixfrac :	1.0
INFO:drizzlepac.adrizzle:	proc_unit :	electrons
INFO:drizzlepac.adrizzle:	stepsize :	10
INFO:drizzlepac.adrizzle:	units :	cps
INFO:drizzlepac.adrizzle:	wcskey :	
INFO:drizzlepac.adrizzle:	wht_type :	None
INFO:drizzlepac.adrizzle:	wt_scl :	exptime
INFO:drizzlepac.adrizzle:  **Using sub-sampling value of 10 for kernel turbo
INFO:drizzlepac.adrizzle:Running Drizzle to create output frame with WCS of: 
INFO:astropy.wcs.wcs:WCS Keywords
WCS Keywords
INFO:astropy.wcs.wcs:

INFO:astropy.wcs.wcs:Number of WCS axes: 2
Number of WCS axes: 2
INFO:astropy.wcs.wcs:CTYPE : 'RA---TAN'  'DEC--TAN'  
CTYPE : 'RA---TAN'  'DEC--TAN'  
INFO:astropy.wcs.wcs:CRVAL : 5.660320326432237  -72.06888179453657  
CRVAL : 5.660320326432237  -72.06888179453657  
INFO:astropy.wcs.wcs:CRPIX : 2729.5  2958.0  
CRPIX : 2729.5  2958.0  
INFO:astropy.wcs.wcs:CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
INFO:astropy.wcs.wcs:CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
INFO:astropy.wcs.wcs:NAXIS : 5459  5916
NAXIS : 5459  5916
INFO:drizzlepac.adrizzle:Executing 3 parallel workers
INFO:drizzlepac.adrizzle:-Drizzle input: j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:-Drizzle input: j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:-Drizzle input: j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 31.998991 to j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 30.263409 to j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 44.917469 to j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw3fwq_sci1_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.adrizzle:Writing out mask file: j9irw4b1q_sci1_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw5kaq_sci1_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 31.998991 to j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw3fwq_sci2_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 30.263409 to j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw4b1q_sci2_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 44.917469 to j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw5kaq_sci2_single_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = turbo

INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw3fwq_single_sci.fits
-Generating simple FITS output: j9irw3fwq_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw3fwq_single_sci.fits
Writing out image to disk: j9irw3fwq_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw3fwq_single_wht.fits
Writing out image to disk: j9irw3fwq_single_wht.fits
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw4b1q_single_sci.fits
-Generating simple FITS output: j9irw4b1q_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw4b1q_single_sci.fits
Writing out image to disk: j9irw4b1q_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw4b1q_single_wht.fits
Writing out image to disk: j9irw4b1q_single_wht.fits
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw5kaq_single_sci.fits
-Generating simple FITS output: j9irw5kaq_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw5kaq_single_sci.fits
Writing out image to disk: j9irw5kaq_single_sci.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw5kaq_single_wht.fits
Writing out image to disk: j9irw5kaq_single_wht.fits
INFO:drizzlepac.util:==== Processing Step  Separate Drizzle  finished at  06:14:42.045 (20/03/2019)
==== Processing Step  Separate Drizzle  finished at  06:14:42.045 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Create Median  started at  06:14:42.049 (20/03/2019)
==== Processing Step  Create Median  started at  06:14:42.049 (20/03/2019)
INFO:drizzlepac.createMedian:USER INPUT PARAMETERS for Create Median Step:
INFO:drizzlepac.createMedian:	combine_bufsize :	None
INFO:drizzlepac.createMedian:	combine_grow :	1
INFO:drizzlepac.createMedian:	combine_hthresh :	None
INFO:drizzlepac.createMedian:	combine_lthresh :	None
INFO:drizzlepac.createMedian:	combine_maskpt :	0.3
INFO:drizzlepac.createMedian:	combine_nhigh :	0
INFO:drizzlepac.createMedian:	combine_nlow :	0
INFO:drizzlepac.createMedian:	combine_nsigma :	4 3
INFO:drizzlepac.createMedian:	combine_type :	minmed
INFO:drizzlepac.createMedian:	compress :	False
INFO:drizzlepac.createMedian:	median :	True
INFO:drizzlepac.createMedian:	median_newmasks :	True
INFO:drizzlepac.createMedian:	proc_unit :	native
INFO:drizzlepac.createMedian:reference sky value for image 'j9irw3fwq_flc.fits' is 31.998991012573242
reference sky value for image 'j9irw3fwq_flc.fits' is 31.998991012573242
INFO:drizzlepac.createMedian:reference sky value for image 'j9irw4b1q_flc.fits' is 30.26340866088867
reference sky value for image 'j9irw4b1q_flc.fits' is 30.26340866088867
INFO:drizzlepac.createMedian:reference sky value for image 'j9irw5kaq_flc.fits' is 44.9174690246582
reference sky value for image 'j9irw5kaq_flc.fits' is 44.9174690246582
INFO:drizzlepac.createMedian:Saving output median image to: 'f606w_combined_med.fits'
Saving output median image to: 'f606w_combined_med.fits'
INFO:drizzlepac.util:==== Processing Step  Create Median  finished at  06:15:01.079 (20/03/2019)
==== Processing Step  Create Median  finished at  06:15:01.079 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Blot  started at  06:15:01.08 (20/03/2019)
==== Processing Step  Blot  started at  06:15:01.08 (20/03/2019)
INFO:drizzlepac.ablot:USER INPUT PARAMETERS for Blot Step:
INFO:drizzlepac.ablot:	blot_addsky :	True
INFO:drizzlepac.ablot:	blot_interp :	poly5
INFO:drizzlepac.ablot:	blot_sinscl :	1.0
INFO:drizzlepac.ablot:	blot_skyval :	0.0
INFO:drizzlepac.ablot:	coeffs :	True
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw3fwq_flc.fits[sci,1]
    Blot: creating blotted image:  j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 31.998991 to blotted image j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw3fwq_sci1_blt.fits
-Generating simple FITS output: j9irw3fwq_sci1_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw3fwq_sci1_blt.fits
Writing out image to disk: j9irw3fwq_sci1_blt.fits
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw3fwq_flc.fits[sci,2]
    Blot: creating blotted image:  j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 31.998991 to blotted image j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw3fwq_sci2_blt.fits
-Generating simple FITS output: j9irw3fwq_sci2_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw3fwq_sci2_blt.fits
Writing out image to disk: j9irw3fwq_sci2_blt.fits
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw4b1q_flc.fits[sci,1]
    Blot: creating blotted image:  j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 30.263409 to blotted image j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw4b1q_sci1_blt.fits
-Generating simple FITS output: j9irw4b1q_sci1_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw4b1q_sci1_blt.fits
Writing out image to disk: j9irw4b1q_sci1_blt.fits
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw4b1q_flc.fits[sci,2]
    Blot: creating blotted image:  j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 30.263409 to blotted image j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw4b1q_sci2_blt.fits
-Generating simple FITS output: j9irw4b1q_sci2_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw4b1q_sci2_blt.fits
Writing out image to disk: j9irw4b1q_sci2_blt.fits
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw5kaq_flc.fits[sci,1]
    Blot: creating blotted image:  j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 44.917469 to blotted image j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw5kaq_sci1_blt.fits
-Generating simple FITS output: j9irw5kaq_sci1_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw5kaq_sci1_blt.fits
Writing out image to disk: j9irw5kaq_sci1_blt.fits
INFO:drizzlepac.ablot:    Blot: creating blotted image:  j9irw5kaq_flc.fits[sci,2]
    Blot: creating blotted image:  j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.ablot:Using default C-based coordinate transformation...
Using default C-based coordinate transformation...
INFO:drizzlepac.ablot:Applying sky value of 44.917469 to blotted image j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.outputimage:-Generating simple FITS output: j9irw5kaq_sci2_blt.fits
-Generating simple FITS output: j9irw5kaq_sci2_blt.fits
INFO:drizzlepac.outputimage:Writing out image to disk: j9irw5kaq_sci2_blt.fits
Writing out image to disk: j9irw5kaq_sci2_blt.fits
INFO:drizzlepac.util:==== Processing Step  Blot  finished at  06:15:11.826 (20/03/2019)
==== Processing Step  Blot  finished at  06:15:11.826 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Driz_CR  started at  06:15:11.828 (20/03/2019)
==== Processing Step  Driz_CR  started at  06:15:11.828 (20/03/2019)
INFO:drizzlepac.drizCR:USER INPUT PARAMETERS for Driz_CR Step:
INFO:drizzlepac.drizCR:	crbit :	4096
INFO:drizzlepac.drizCR:	driz_cr :	True
INFO:drizzlepac.drizCR:	driz_cr_corr :	True
INFO:drizzlepac.drizCR:	driz_cr_ctegrow :	0
INFO:drizzlepac.drizCR:	driz_cr_grow :	1
INFO:drizzlepac.drizCR:	driz_cr_scale :	1.2 0.7
INFO:drizzlepac.drizCR:	driz_cr_snr :	3.5 3.0
INFO:drizzlepac.drizCR:	inmemory :	False
INFO:drizzlepac.drizCR:Executing 3 parallel workers
INFO:drizzlepac.drizCR:Creating output :  j9irw3fwq_sci1_crmask.fits
Creating output :  j9irw3fwq_sci1_crmask.fits
INFO:drizzlepac.drizCR:Creating output :  j9irw5kaq_sci1_crmask.fits
Creating output :  j9irw5kaq_sci1_crmask.fits
INFO:drizzlepac.drizCR:Creating output :  j9irw4b1q_sci1_crmask.fits
Creating output :  j9irw4b1q_sci1_crmask.fits
INFO:drizzlepac.drizCR:Creating output :  j9irw3fwq_sci2_crmask.fits
Creating output :  j9irw3fwq_sci2_crmask.fits
INFO:drizzlepac.drizCR:Creating output :  j9irw5kaq_sci2_crmask.fits
Creating output :  j9irw5kaq_sci2_crmask.fits
INFO:drizzlepac.drizCR:Created CR corrected file:  j9irw3fwq_crclean.fits
Created CR corrected file:  j9irw3fwq_crclean.fits
INFO:drizzlepac.drizCR:Creating output :  j9irw4b1q_sci2_crmask.fits
Creating output :  j9irw4b1q_sci2_crmask.fits
INFO:drizzlepac.drizCR:Created CR corrected file:  j9irw5kaq_crclean.fits
Created CR corrected file:  j9irw5kaq_crclean.fits
INFO:drizzlepac.drizCR:Created CR corrected file:  j9irw4b1q_crclean.fits
Created CR corrected file:  j9irw4b1q_crclean.fits
INFO:drizzlepac.util:==== Processing Step  Driz_CR  finished at  06:15:25.320 (20/03/2019)
==== Processing Step  Driz_CR  finished at  06:15:25.320 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.util:==== Processing Step  Final Drizzle  started at  06:15:25.337 (20/03/2019)
==== Processing Step  Final Drizzle  started at  06:15:25.337 (20/03/2019)
INFO:drizzlepac.adrizzle:Interpreted paramDict with single=False as:
{'build': True, 'stepsize': 10, 'coeffs': True, 'wcskey': '', 'wht_type': 'EXP', 'kernel': 'square', 'wt_scl': 'exptime', 'pixfrac': 1.0, 'fillval': None, 'maskval': None, 'bits': 80, 'units': 'cps'}
INFO:drizzlepac.adrizzle:USER INPUT PARAMETERS for Final Drizzle Step:
INFO:drizzlepac.adrizzle:	bits :	80
INFO:drizzlepac.adrizzle:	build :	True
INFO:drizzlepac.adrizzle:	clean :	False
INFO:drizzlepac.adrizzle:	coeffs :	True
INFO:drizzlepac.adrizzle:	crbit :	4096
INFO:drizzlepac.adrizzle:	fillval :	None
INFO:drizzlepac.adrizzle:	kernel :	square
INFO:drizzlepac.adrizzle:	maskval :	None
INFO:drizzlepac.adrizzle:	pixfrac :	1.0
INFO:drizzlepac.adrizzle:	proc_unit :	native
INFO:drizzlepac.adrizzle:	stepsize :	10
INFO:drizzlepac.adrizzle:	units :	cps
INFO:drizzlepac.adrizzle:	wcskey :	
INFO:drizzlepac.adrizzle:	wht_type :	EXP
INFO:drizzlepac.adrizzle:	wt_scl :	exptime
INFO:drizzlepac.adrizzle:  **Using sub-sampling value of 10 for kernel square
INFO:drizzlepac.adrizzle:Running Drizzle to create output frame with WCS of: 
INFO:astropy.wcs.wcs:WCS Keywords
WCS Keywords
INFO:astropy.wcs.wcs:

INFO:astropy.wcs.wcs:Number of WCS axes: 2
Number of WCS axes: 2
INFO:astropy.wcs.wcs:CTYPE : 'RA---TAN'  'DEC--TAN'  
CTYPE : 'RA---TAN'  'DEC--TAN'  
INFO:astropy.wcs.wcs:CRVAL : 5.660320326432237  -72.06888179453657  
CRVAL : 5.660320326432237  -72.06888179453657  
INFO:astropy.wcs.wcs:CRPIX : 2729.5  2958.0  
CRPIX : 2729.5  2958.0  
INFO:astropy.wcs.wcs:CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
CD1_1 CD1_2  : 7.5651581640416625e-06  -1.1647730101652211e-05  
INFO:astropy.wcs.wcs:CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
CD2_1 CD2_2  : -1.1647730101652211e-05  -7.5651581640416625e-06  
INFO:astropy.wcs.wcs:NAXIS : 5459  5916
NAXIS : 5459  5916
INFO:drizzlepac.adrizzle:-Drizzle input: j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 31.998991 to j9irw3fwq_flc.fits[sci,1]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 1
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw3fwq_sci1_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 31.998991 to j9irw3fwq_flc.fits[sci,2]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 2
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw3fwq_sci2_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 30.263409 to j9irw4b1q_flc.fits[sci,1]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 1
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw4b1q_sci1_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 30.263409 to j9irw4b1q_flc.fits[sci,2]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 2
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw4b1q_sci2_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.adrizzle:Applying sky value of 44.917469 to j9irw5kaq_flc.fits[sci,1]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 1
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw5kaq_sci1_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.adrizzle:-Drizzle input: j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.adrizzle:Applying sky value of 44.917469 to j9irw5kaq_flc.fits[sci,2]
INFO:drizzlepac.imageObject:Applying EXPTIME weighting to DQ mask for chip 2
INFO:drizzlepac.adrizzle:Writing out mask file: j9irw5kaq_sci2_final_mask.fits
INFO:drizzlepac.adrizzle:Using WCSLIB-based coordinate transformation...
INFO:drizzlepac.adrizzle:stepsize = 10
INFO:drizzlepac.cdriz:-Drizzling using kernel = square

INFO:drizzlepac.outputimage:-Generating multi-extension output file:  f606w_combined_drc.fits
-Generating multi-extension output file:  f606w_combined_drc.fits
INFO:stwcs.wcsutil.altwcs:Deleted all instances of WCS with key A in extensions [1]
Deleted all instances of WCS with key A in extensions [1]
INFO:stwcs.wcsutil.altwcs:Deleted all instances of WCS with key B in extensions [1]
Deleted all instances of WCS with key B in extensions [1]
INFO:drizzlepac.outputimage:Writing out to disk: f606w_combined_drc.fits
Writing out to disk: f606w_combined_drc.fits
INFO:drizzlepac.util:==== Processing Step  Final Drizzle  finished at  06:15:46.618 (20/03/2019)
==== Processing Step  Final Drizzle  finished at  06:15:46.618 (20/03/2019)
INFO:drizzlepac.util:

INFO:drizzlepac.astrodrizzle:

INFO:drizzlepac.astrodrizzle:AstroDrizzle Version 2.2.6 is finished processing at 06:15:46.62 (20/03/2019).
AstroDrizzle Version 2.2.6 is finished processing at 06:15:46.62 (20/03/2019).
INFO:drizzlepac.astrodrizzle:

INFO:drizzlepac.util:

INFO:drizzlepac.util:   --------------------          --------------------
   --------------------          --------------------
INFO:drizzlepac.util:                   Step          Elapsed time
                   Step          Elapsed time
INFO:drizzlepac.util:   --------------------          --------------------
   --------------------          --------------------
INFO:drizzlepac.util:

INFO:drizzlepac.util:         Initialization          1.6565 sec.
         Initialization          1.6565 sec.
INFO:drizzlepac.util:            Static Mask          1.9495 sec.
            Static Mask          1.9495 sec.
INFO:drizzlepac.util:           Subtract Sky          3.5640 sec.
           Subtract Sky          3.5640 sec.
INFO:drizzlepac.util:       Separate Drizzle          4.5016 sec.
       Separate Drizzle          4.5016 sec.
INFO:drizzlepac.util:          Create Median          19.0305 sec.
          Create Median          19.0305 sec.
INFO:drizzlepac.util:                   Blot          10.7441 sec.
                   Blot          10.7441 sec.
INFO:drizzlepac.util:                Driz_CR          13.4919 sec.
                Driz_CR          13.4919 sec.
INFO:drizzlepac.util:          Final Drizzle          21.2813 sec.
          Final Drizzle          21.2813 sec.
INFO:drizzlepac.util:   ====================          ====================
   ====================          ====================
INFO:drizzlepac.util:                  Total          76.2194 sec.
                  Total          76.2194 sec.
INFO:drizzlepac.util:Trailer file written to:  astrodrizzle.log
Trailer file written to:  astrodrizzle.log

You will see the following files (among others) output by AstroDrizzle in the working directory.

  1. 'f606w_combined_drc.fits' : Multi-extension FITS file.

    When build = True, the drizzled science image, context image, weight image, and median image will be combined into a single multi-extension fits file. This file contains the following extensions:

     Final drizzled science image is contained in ['SCI', 1].
     Final drizzled weight  image is contained in ['WHT', 1].
     Final drizzled context image is contained in ['CTX', 1].
    
    

    When build = False, these will be output as separate files (_sci.fits, _wht.fits, _ctx.fits).

    When final_wht_type = EXP (default), the weight image it is effectively an exposure time map of each pixel in the final drizzled image. Other options are error 'ERR' and inverse variance 'IVM' weighting, as described in more detail here.

    The context image is a map showing which images contribute to the final drizzled stack. Each input image chip is identified by a bit in a 32-bit integer. For example, image1/chip1 = 2^0 = 1, image1/chip2 = 2^1 = 2. Each context image pixel is an additive combination of these bits, depending on which images contributed to the corresponding pixel in the drizzled image.

  1. astrodrizzle.log : Log file containing details of the drizzle processing steps.
  1. f606w_combined_med.fits : Median image computed from the sky-subtracted, separately-drizzled input images.
  1. j*_crclean.fits : Cosmic-ray cleaned versions of the original input flc images.

Because we set clean = False, there will be various other intermediate output files in the directory, including masks, blotted frames, etc. This behavior can be modified with the clean and in_memory parameters.

Inspect the final drizzled image

In [20]:
plt.figure(figsize = (10, 10))
drc_dat = fits.open('f606w_combined_drc.fits')['SCI', 1].data #final drizzled image in SCI,1 extension
z1, z2 = zscale.get_limits(drc_dat)
plt.imshow(drc_dat, origin='lower', vmin=z1, vmax=z2, cmap='Greys')
plt.title('F606W drizzled image', fontsize=30)
Out[20]:
Text(0.5, 1.0, 'F606W drizzled image')

Inspect the final weight image

In [21]:
plt.figure(figsize = (10, 10))
drc_dat = fits.open('f606w_combined_drc.fits')['WHT', 1].data #final drizzled image in WHT,1 extension
z1, z2 = zscale.get_limits(drc_dat)
plt.imshow(drc_dat, origin='lower', vmin=z1, vmax=z2, cmap='Greys')
plt.title('F606W weight image', fontsize=30)
Out[21]:
Text(0.5, 1.0, 'F606W weight image')

Discussion of AstroDrizzle

In this example, we imported and ran the AstroDrizzle task on our input images, which were previously aligned with TweakReg. By setting configobj to None, we ensured that AstroDrizzle was not picking up any existing configuration files and parameters were restored to default values. We then set a select few parameters to non-default values:

  1. output = 'f606w_combined' : Output file name root (which will be appended with various suffixes). Defaults to input file name.
  2. driz_sep_bits = '64,16' : Data quality flags in the flt.fits file, which were set during calibration, can be used as bit mask when drizzling. The user may specify which bit values should actually be considered "good" and included in image combination. In astrodrizzle, this parameter may be given as the sum of those DQ flags or as a comma-separated list, as shown in this example. In this example, 64 and 16 are set, so that both warm pixels and stable hot pixels, which are corrected by the dark, are treated as valid input pixels.
  3. driz_cr_corr = True : When set to True, the task will create both a cosmic ray mask image (suffix crmask.fits) and a clean version of the original input images (suffix crclean.fits), where flagged pixels are replaced by pixels from the blotted median. It is strongly recommended that the quality of the cosmic ray masks be verified by blinking the original flt.fits input image with both the cosmic ray-cleaned image (crclean.fits) and the cosmic-ray mask (crmask.fits).
  4. final_bits = '64,16' : Similar to driz_sep_bits, but for the last step when all the input images are combined.
  5. clean = False : intermediate output files (e.g masks) will be kept. If True, only main outputs will be kept. Also see in_memory to control this behavior.
  6. configobj = None : ignore any TEAL inputs / config files and refresh all parameters to default values.

AstroDrizzle has a large number of parameters, which are described here. Running AstroDrizzle using default parameter values is not recommended, as these defaults may not provide optimal science products. Users should also inspect the quality of the sky subtraction and cosmic ray rejection. For dithered data, users may experiment with the output final_scale and final_pixfrac parameters in the final_drizzle step. For more details, see the notebook in this repository to 'Optimize Image Sampling'.

About this Notebook

Author: C. Shanahan, STScI WFC3 Team  
Updated: December 17, 2018