### PyDrizzle Revision Changes Version 4.3 (23-June-2003) WJH - Added full WCSFIT usage in 'buildMetachip',in both Pattern base class and DitherProduct class, to rigorously compute offsets between members as well as change in orientation from initial guess to output chip center. Also uses 'wcsutil.troll' function to update orientation. This allows PyDrizzle to compute the drizzle parameters as accurately (without skew) as WDRIZZLE. - Changed ALL instances of numarray objects to use double-precision Float64 units. - Revised computation of '_c' and '_d' elements in 'drutil.wcsfit' to correspond to WDRIZZLE routine. ##### These corrected problems with 'drutil.wcsfit' so that it now produces identical results as WDRIZZLE when given identical inputs. This error caused miscalculation of orientations between chips when using wcsfit. ##### - Added support for running PyDrizzle with WDRIZZLE instead of 'drizzle' with a new function 'runWDrizzle'. - Also, added 'gpar' parameters to ObsGeometry object to allow WDRIZZLE to account for shift corrections, when using WDRIZZLE. The full list of added pars: geomode='wcs', racen, deccen, orient, outscl, gpar_xsh, gpar_ysh, gpar_rot. - Corrected distortion-corrected position in geom.apply() by subtracting wcs.offset_x/offset_y when no coeffs are present. - Corrected corner positions from 'calcNewCorners' by XDELTA/YDELTA to put them in output reference frame for proper computation of output frame dimensions. - Switched to use of new 'calcNewCorners' in 'drutil.getRange()' (primarily for speed). - Modified code to print out ParList so that if there is no overlap determined by PyDrizzle, it will print 'None' instead of crashing. - Revised 'applyAsnShift' to actually update 'product.geometry.wcslin' object as well as corner['corrected'] positions with _delta_crpix so that buildMetachip can properly deduce output size when shifts are provided. - Revised 'convert' in ObsGeometry class to shift coeffs by additional 1 pixel to correspond to 'align=center' convention for 'drizzle'. - Now updates 'self.v2com' and 'self.v3com' in 'computeCubicCoeffs' so that 'buildMetachip' can properly deduce change in orientation using TROLL. - Added 'detector' attribute to Pattern class for use with PARITY matrix. For WFPC, this is set to 'WFPC' and new PARITY matrix was added to WFPCObservation to produce default orientation based on PC after fitting with 'wcsfit'. Version 4.2final (11-June-2003) WJH - Built in support for 'wdrizzle': created 'runWdrizzle', and updated 'buildpars' to setup 'dr2gpar' pars for WDRIZZLE to use to account for tweakshifts corrections. - Update the input WCS object with the shifts provided by the user. - Modified computation of output WCS to not recenter, along with the updated input WCS, allows the WCSFIT to compute the proper shifts and rotations as parameters for 'drizzle'. - Fixed the problem with specifying output parameters for single obs in 'buildpars'. Version 4.1final (6-June-2003) WJH - Revised 'buildDthProduct' to produce FITS-compliant MEF file using GEIS images as the template. This bug prevented WFPC2 output products from being compliant, and therefore 'catfits' didn't see the extensions. Fix required starting with GEIS chip header, then appending GEIS primary header keywords that are not already in desired MEF PRI header. Version 4.1final (5-June-2003) WJH - Corrected a problem in buildasn which resulted in subsequent runs of buildAsnTable (by PyDrizzle or Multidrizzle) to end up with different, and many times obviously wrong, results. EXTLIST was a module attribute, but it was being copied and appended and this was remembered for the entire session. Version 4.1 (4-June-2003) - Update offset between chips to include scale change due to VAFACTOR (__init__.py:computeCoeffs()). - Revised 'buildShadowMaskImage' to include any .c1h image DQ values if present, and removed default bitvalue of None for WFPC2 to enable this feature. (__init__.py:WFPCObservation.init() and buildmask.py:buildShadowMaskImage()) - Added GEIS outdata,outweight,outcontext images to those which are controlled by the 'save' parameter (__init__.py:run()) - Blank lines in 'shiftfile' is now ignored rather than crashing (buildasn.py:readShiftFile()) - Revised the application of VAFACTOR to add delta_x,delta_y as attribute of geometry class (obsgeometry.py:applyVAFactor()) - Modified buildDthProduct to produce multi-extension FITS files which pipeline can work with: ROOTNAME updated in PRIMARY, TEXPTIME removed from headers, ASN_MTYP updated, drizzle cards appended to PRIMARY instead of SCI header, CCDCHIP keyword in SCI header changed to -999, OBJECT keyword removed from PRIMARY. (buildproduct.py:buildDthProduct()) - Message added to updateasn to better inform the user when an input file is missing, then raises an immediate exception (updateasn.py:updateAsnTable()) Version 4.0release1 (21-May-2003) - Modified 'geisToFITS' to remove GEIS keywords, and FITS extension keywords from the output simple FITS file. This (mostly?) avoids an 'hedit' error/bug where 'hedit' removes them but doesn't move up the data section leaving a blank FITS block after the END statement in the header resulting in 'shifted' output files. Version 4.0release (16-May-2003) ***** RELEASE Version with all previous changes included. ***** - Added 'DEFAULT_SCALE' member to defaultIDCModel in fileutil. - Changed readIDCFile() to not try and use IRAF osfn on non-existent filename for default model case. - call getIDCFile() using primary extension only, instead of chip extension name. Also, added default value of 1 for 'nmembers' when less than all three extensions are present in an input image. This allows support for 'non-standard' HST-like observations. Version 4.0 (8-May-2003) - NEW REQUIREMENT/DEPENDECY: readgeis. - NEW MODULES: buildproduct, obsgeometry - Updated to use 'close' method on readgeis objects to close memory-mapped GEIS files to avoid out-of-resource errors. - Added GEIS single-drizzle products to 'clean' method for removal. - Corrected logic to determine reference image from computed offsets and reversed the sign of the delta-CRVAL computed from relative shifts. This allowed relative shifts to be properly applied to data. (Corrected 14-May-2003) - Reversed the signs of the shifts applied to the distortion model when applying the VAFACTOR (velocity aberration) correction so the coeffs get properly corrected. Also, applying vafactor to coeffs was changed from division to multiplication, resulting in proper correction of data based on geomap results. (Corrected 15-May-2003) Version 4.0beta9 (30-Apr-2003) - Revised the logic for converting single output's from GEIS to FITS to allow for multiple input chips. Previously, as each chip was drizzled, it was converted to FITS overwriting the previous chip's results. Version 4.0beta8 (29-Apr-2003) - Fixed a bug in fileutil.readAsnTable which caused all shifts to be given units of 'pixels'. - Modified 'applyAsnShifts' to only apply shifts to product.wcslin, as well as input WCS. This allows product.wcs to serve as default case for determining final output parameters so 'drizzle' will place inputs in updated positions relative to input header values. - DitherProduct.buildMetachip changed to use 'product.wcslin' as default WCS. Also, compute output size from 0 to max if min>0 to allow for shifts putting images off-center. - Implemented 'geisToFITS' in new 'buildProduct' module with 'readgeis' and use it to automatically convert GEIS output to FITS format when finished with 'drizzle', then deletes the GEIS image immediately. Thus, user never sees GEIS unless there is a problem. This required using seperate names in parlist for GEIS and FITS output names. - Update both EXPTIME and ORIENTAT in output SCI image. - Created 'obsgeometry' module to contain all of the geometry classes originally located in __init__ file. - Added default filter names for use with SBC in 'fileutil.readIDCtab'. - Modified 'geisTofits' to write out SIMPLE FITS file, instead multi-extension as dither tasks only work with SIMPLE FITS inputs. Version 4.0beta7 (11-Apr-2003) - Fixed a bug in '_findRefFile' where it tried to compare non-dictionary entries of sdict to input file list. This caused 'expected character buffer' error. Version 4.0beta6 (10-Apr-2003) - Added support for drizzling on a single chip/group by adding a new parameter: section. The help was updated to reflect this new parameter, along with the IRAF interface task. Version 4.0beta5 (10-Apr-2003) - Removed input parameters from 'updateShifts' to account for the fact that those defaults are now set by 'readShiftFile'. - Corrected 'readAsnTable' in 'fileutil' to insure that the same units are passed along for all shifts read from the file. Also, removed the code which shifted 'relative' shifts so that one is at 0.,0. - Completely rewrote 'applyAsnShifts' in '__init__.py' to handle all 6 input cases for shifts. Also, modified 'buildProduct' in DitherProduct class to call this in a more general manner. Version 4.0beta1 (7-Apr-2003) - NEW REQUIREMENT/DEPENDECY: readgeis. - NEW MODULE: buildproduct - Completely restructured the code to compute parameters after all the default cases are computed. Also added 'resetPars' method to the PyDrizzle object. Both of these support changing the output field specification 'on-the-fly' with the PyDrizzle object. - Added the method 'transformMetachip' in the Pattern class. It performs the transformation of the default output field into the user-specified output field. - Implemented 'corners' attribute to Exposure and use them for checking overlap with output field, and for computing output size. Also, added functions in 'drutil' to support use of the corners, such as 'getRotatedSize'. - The method 'buildProduct' in the Pattern class is overridden in the DitherPattern class to support 'resetPars' usage. - A new 'clean' method was added to the PyDrizzle object to simplify removal of intermediate products created by PyDrizzle and products created by 'drizzle' itself that may not have been combined into the final multi-extension FITS product. ####NOTE#### This replaces the 'clean' parameter in the PyDrizzle object. - Implemented support for both relative and delta shifts. The method 'applyAsnShifts' was moved to the Pattern class to allow application of relative shifts and to apply all shifts to the default case. - Updated 'buildasn' to support new ASN tables with both relative and delta shifts. - Rewrote 'buildDthProduct' to work with either FITS output or GEIS output from PyDrizzle, and uses 'readgeis' for combining the GEIS products into a single output product. Moved this function to its own module: buildproduct. - Incorporated Richard's 'invert' method in the ObsGeometry class to support coordinate transformation from an undistorted to the original 'raw' distorted frame. - Added 'flprc' calls immediately after each run of 'drizzle' and 'blot' to allow IRAF to better handle the memory usage. - Implemented drutil.wcsfit and drutil.fitlin to perform linear fits between a distorted image's WCS and an undistorted output WCS. This is used to correctly compute the output rotations, especially in the cases of high-Declination observations. - Velocity aberration correction implemented as a method of ObsGeometry and initially called when Exposure object is initialized. This method uses POSTARG*,RA_TARG, DEC_TARG keywords to deduce the aperture center position which this correction is centered on. - Updated WCSObject method 'updateWCS' to update overall size and default CRPIX position when the plate scale changes. - Revised IRAF parameter interface to support new clean method, and to allow single-drizzle option as well. Version 3.4a (13-Feb-2003) (OPR 47600) - This version implements changes to select the rows from the IDCTAB based on the filters used for the observation as well as chip and direction. Required changes to __init__.py and 'readIDCtab' in fileutil. Version 3.4 (21-Jan-2003) (OPR 47271) - Changed output drizzle products to GEIS format from FITS - Rewrote 'buildDthProduct' to process input GEIS drizzle products and use imcopy to combine into a MEF file. It also removes duplicate keywords from extensions. - Rewrote 'getKeyword' to trim trailing '/' from values. - Added 'new' parameter to WCSObject to indicate whether it is being created from scratch or based on an existing WCS object. Version 3.3f (30-Dec-2002) - Included defaults for ALL drizzle parameters to avoid having user settings for the 'drizzle' task interfere with PyDrizzle settings; specifically, 'in_un' assumed to be 'counts' but not explicitly set by PyDrizzle before this. - Updated EXPTIME for single output products as well. Version 3.3f (7-November-2002) - OPR 46912: Reset 'and' to 'or' when determining whether LTV values indicate a subarray or not. This correction took place in the ObsGeometry class. - Use 'buildNewRootname' to always create an output _drz.fits filename. - Corrected how user-specified extensions are handled in 'buildRootname'. Version 3.3d (28-August-2002) - Fixed bug in applying offset to subarray CRPIX value; needed to base it on original CRPIX. - OPR 46600: Removed all calls to 'keypar' and replaced them with calls to 'hselect'. This eliminates problems with multiple calls to keypar stepping on each other as they write out the results to the par file, then read in the results. Version 3.3c (21-August-2002) - Added explicit 'fillval' parameter to PyDrizzle and its IRAF interface. - Fixed syntax error in 'drutil': added colon to end of 'elif' in buildRootname. Version 3.3b (20-August-2002) - Revised 'asndict' in fileutil.readAsnTable to include an 'order' list as a member. This provides ordered access to the members in the dictionary when building up the list of members, keeping the parameters in the same order as listed in the ASN table. - The 'addMembers' method of DitherProduct was modified to use the ordered listing of members to keep the images straight. - Added checks when adding members so that when it tries to work with files that have no recognizable usable inputs, it will skip that entry and continue. If no inputs are recognizable, it will quit at that point. - Revised filename checking to search for 'rootname'+'.fits'. This should account for user-provided files which do not have standard suffixes, such as 'crj.fits'. Version 3.3a (20-August-2002) - 'buildasn' was modified to accept a file with a list of files, a wild-card specification or a suffix/partial filename as input. In addition, a verbose mode was added to print out the list of files which were used to build the table. An IRAF EPAR interface was also built for 'buildasn' Version 3.3 (12-August-2002) - Updated 'buildPars' to (finally) keep PyDrizzle WCS synchronized with 'drizzle' product WCS for arbitrarily-specified output frames as well as default case. - Modified to work with default IDCTAB which applies NO correction at all when no valid IDCTAB keyword or no valid header-based coeffs file could be found. This allows a user to specify 'N/A' for IDCTAB and still use PyDrizzle. The 'defaultModel()' method was added to 'fileutil' to generate the proper set of coefficients. - Revised WCS output to be formatted better on printing. - Tested extensively using WFC, HRC datasets, including single exposures, dithered associations, CRJ associations, and WFC sub-array data. Version 3.2 (1-August-2002) - Corrects errors in using RA/Dec set in SkyField object. - Adds new formatting for printing out 'parlist' dictionary entries for each input. - Added 'updateasn' to package. This module allows a user to update an existing ASN table with new shift information. - Changed mask file from Int16 to Int8 (for space and I/O efficiency) - Revised 'buildasn' to support modular creation of offsets and rotation columns. Also, revised IDCKEY storage in PyDrizzle as well. - Removed extraneous 'nchips' parameter from Exposure class. - Changed code so that weight and context products are not created for 'single=yes' runs. Version 3.1 (16-July-2002) - Implemented support for correct drizzling of ACS subarray observations, particularly in support of polarization data. This revision required addition to 'wcslin' the calculation of naxis*, crpix* and center positions after distortion correction. This involved moving 'calcNewCorners' to the ObsGeometry class. It also involved modifying 'geometry.XYtoSky' to support subarray coordinates: shift them to full frame, then apply correction from wcslin. It also required the creation of a new method for the GeometryModel class, shift, to create a coeffs file for 'drizzle' which has been shifted to match the center of the subarray. The convert method will automatically call this new method if it detects that it is working with a sub-array. Reading the value of the subarray offset from the image header (getLTV) was also moved to the GeometryModel class. Version 3.0a (26-June-2002) - Fixed a bug with running blot. Exposure time in outsingle images from 'drizzle' is not correct (exptime * nchips), and blot used it as is. Changed this to have PyDrizzle specify exptime for each chip. (OPR 46092) - Implemented a check in 'buildmask' to remove faulty inmask files when they are created. Version 3.0 (25-June-2002) - Changed the import command to include 'stsdas,analysis'. This will allow it to be run from Python directly. (Used for initial build of STSDAS release) Version 3.0 (21-June-2002) - Minor change to naming of blot output to correctly support WFPC2 chip IDs. Version 3.0 (14-June-2002) (OPR 46091) - Implemented 'single=yes' and 'blot=yes' in .run() for PyDrizzle. (OPR 46093) - Corrected offset problems so that images are not only centered in output, but output size is calculated to within a pixel(in width or height) of needed size regardless of what the user specifies. - Treats WFPC2 data XDELTA/YDELTA correctly with regard to offsets from center (nref). - Renames coeffs and mask files based on EXTVER instead of chip ID. This makes it easier for users to manually keep track of which files go with which extensions. - Copies over all 'drizzle' created keywords from 'drizzle' output images into the combined PyDrizzle MEF product. Version 2.6 (12-June-2002) - implemented internal changes to support separate output for each input, along with renaming 'shifts' dictionary in PyDrizzle to a more appropriate 'pars'. This also corrects a bug in 2.5a with creating a final output from 'drizzle' with the same name as the desired combined final output. This version, however, will NOT actually create single outputs or run blot. In addition, 'buildmask' was modified to delete previously existing mask files it finds before re-creating them. Version 2.5a (6-June-2002) - Corrected WFPC2 alignment problems by manually adjusting the refdata for WFPCObservation class to match output from 'wmosaic'. Version 2.5 (31-May-2002) - Fixed final problems with using optional SkyField parameters such as RA/Dec and shape. Updated ObsGeometry.apply() to accurately reflect sub-array offsets now. Version 2.3 (30-May-2002) - Output size of product correctly predicted and product WCS consistent with 'drizzle' product for rotated and default conditions. Now correctly works with sub-arrays. Version 2.2a - Revised to be consistent with new numarray syntax Version 2.2 - Reworked use of WCS to compute accurate offsets between observations from header. Added 'undistortWCS' to create linear CD directly from distortion without scaling. Revised WCSObject to simplify updates of attributes and formatted output on prints. Includes new 'convert' method for working with IDCTABs where NORDER > 3. Version 2.1c - Updated ORIENTAT in SCIHDR instead of PRIHDR Version 2.1b - Corrected namespace bug in wcsutil, and protected against creating products with BSCALE and BZERO (in fileutil). Version 2.1a - Added separate interface to XYtoSky function in wcsutil. Corrected slight bug in WCSObject.xy2rd() function. Changed 'from - import *' to explicit 'import' calls. Corrected logic problem in 'drutil.buildRootname'. Created IRAF interface for 'xytosky' task. Version 2.1 - Fixed bugs in use of numarray to perform XYtoSky on positions or arrays of positions. Also, changed import calls to numarray to be explicit rather than using from-import *. This allows the built-in methods to be used interactively. Version 2.0 - Reorganized and revised to use PyFITS V0.6.1 with numarray instead of FITS v0.4.2 with Numeric. Required modifying 'Obsgeometry.apply' and 'calcNewEdges' to work with arrays instead of a single X,Y tuple. Reconfigured to support installation into STSDAS using Python-tree. Separated out WCS library into a separate callable library for use by other tasks as well. Version 1.4b - Corrected a problem for WFPC2 data, not to use DETECTOR to try and access the groups. Instead, use logical number. Version 1.4a - Fixed a bug in building parameters without a SkyField Automatically deletes previous product now. Version 1.4 - Updated Exposure class to understand subarrays and offsets (based on LTV keywords) Also, updated to rely solely on the version of 'drizzle' in STSDAS (since it was updated to TDRIZZLE Version 2.6). Applies corrections provided in ASN table as well. Updates EXPTIME in 'drizzle' products. Updates EXPSTART/EXPEND in Dither product. Added 'build' parameter to '.run()', if set to 'no', will not create multi-extension FITS product. Version 1.3f - Worked out bugs in IRAF interface function for SkyField parameters. Version 1.3e - SkyField object use for specifying output frame finally works as intended! Version 1.3d - Fixes bugs in the IRAF interface to include usage of the SkyField object for user specified parameters for the output frame. Also, updates ORIENTAT in primary header only in output DTH product. Version 1.3c - Corrects total exptime in output MEF image Version 1.3b - Fixes bugs in SkyField usage and in building the WCS for PyDrizzle product objects. In addition, 'readIDCTable' was updated to accept tables with either 'A'/'B' or 'CX'/'CY' coefficients column names. Version 1.3 - This version contains the final working interface for user-specified SkyField and it works with the EPAR interface. Version 1.2 - First Version with ACS, WFPC2, and STIS support Can use cubic,Trauger, and IDCTAB files for STIS and WFPC2 This version also overwrites any existing output file with the new dither-product file. Version 1.1 - Added WFPC2 support. Version 1.0b - Revised to work with PyFITS 0.4.2. Version 1.0a - Revised to work with CALACS. Version 1.0 - IRAF enabled version with complete drizzle functionality. Version 0.5 - Revised to combine drizzle output products into a single multi-extension FITS file. Has optional keyword to PyDrizzle.run() to control whether the separate drizzle products are saved or not (default: save=no). Version 0.4 - Revised calculation of output size to account for shifts by drizzle coefficients. Version 0.3 - Added arbitrary user rotation, output pixel size, kernel choice to wrapper. Also, added automatic use of 'tdrizzle' if available (defaults to 'drizzle' V1.41 in STSDAS) and some on-line help. ### # # updateasn Revision History # ### Version 0.3 (27-Aug-2002) WJH Added 'mode' parameter to either 'replace' shifts or 'sum' them with existing shifts. If in 'sum' mode, any INDEF values will be considered as 0., however, values of NaN/-NaN will not be updated/summed. Version 0.2a (26-Aug-2002) WJH Revised input of 'output' parameter to recognize filenames without extension specification or '.fits' in filename. Defaults to using either primary or 'sci,1' in that order if none are specified. Added verification code and somewhat more informative error messages. Version 0.2 (26-Aug-2002) WJH Made input rootname handling more general; can build full filename from rootname only using 'drutil.buildRootname'. No longer requires extension specification. Modified 'drutil.getPrimaryKeyword' to append '[0]' extension if no extension was recognized. Version 0.1 WJH - Release Version ### # # buildasn Revision History # ### (Initial History comments located in 'buildasn.py' )