STScI Logo

Release Notes for stsci_python
stsci_python 2.15.1 Release Notes


=================================
STScI_Python 2.15.1 Release Notes
=================================

STScI_Python is a collection of Python modules, packages and C extensions that
has been developed to provide a general astronomical data analysis
infrastructure. They can be used for Python tasks that are accessible from
within STSDAS when running under PyRAF or standalone from within Python. This
distribution continues to develop packages with tasks specific to each HST
instrument, with changes since the last release being noted here.

MAJOR CHANGE TO INSTALLATION PROCEDURES
=======================================
The STScI_Python software has been re-packaged in this release to install each
package separately using standard Python installation tools such as pip and
easy_install.  This also allows each package to be updated separately rather
than having to update all at once.  The entire suite of software can still be
installed in one command that retrieves the software from the Python Package
Index (PyPI) directly.  A full description of this change and how to get and
install this software can be found on our web page at:

http://www.stsci.edu/institute/software_hardware/pyraf/stsci_python/installation


AstroPy and STScI_Python
========================
The next release will include dependencies on astropy within most of the
packages in STScI_Python.  These dependencies will at a minimum include the use
of astropy.io.fits instead of a separate version of PyFITS and astropy.wcs
instead of a separate version of PyWCS. In fact, both PyFITS and PyWCS will be
maintained solely within astropy, with separate releases of these packages
stopping, after the next release.  Users and developers are encouraged to start
reviewing how to transition your own code to use astropy as soon as possible so
that these dependencies will not pose any problems in the future.


PyFITS
=======
This release includes PyFITS Version 3.2.4 with full release notes being
available online at:

    http://www.stsci.edu/institute/software_hardware/pyfits/release
        
This package has been included as part of the AstroPy project found at:

    http://www.astropy.org

As a result, the next release of STScI_Python will depend on AstroPy for the
PyFITS library instead of using this standalone release.


ACSTOOLS
========
* TEAL interfaces for running the new ACSCTE step from CALACS was added to the
package.

* The following bugs in acs_destripe were fixed:
    * No longer crashes while processing WFC polarizer (subarray) data
    * DARKFILE now correctly handled
    * Now saves the corrected image if FLATCORR or DARKCORR is not COMPLETED

* Documentation included with the package has been updated to reflect the latest
changes.


COSTOOLS
========
Version 2.21 of CALCOS has been included in this release with the following
updates:

* When x1dcorr in costools (x1d.py in calcos) is called to extract a 1-D
spectrum, the flt and counts files are first recreated from the corrtag file.
These files contained WCS keywords that were copied without change from the
input corrtag table, and these table-specific keywords are not permitted in
image headers.  This was fixed by calling the function to populate the
spectroscopic keywords.

* A TEAL interface has been added to the calcos source directory, which allows
the user to see and edit the calcos parameters interactively (import calcos;
from stsci.tools import teal; teal.teal("calcos")).

* The variables used for data quality flags have been renamed to agree with the
interpretations of the data quality values for the latest bad pixel table, as
described in the Data Handbook.

* A bug was fixed in the code for trapping a missing-row exception.  This is
relevant primarily when writing a "calcos sum" (csum) file; calcos must trap the
exception, write the csum file, and continue processing until all input files
have been calibrated at least to the point of writing the csum file.

* CALCOS was modified to use astropy.io.fits in place of the stand-alone
PyFITS module.

* The check on whether the aperture name is in the list of recognized values
has been extended to include "N/A", which is valid for dark exposures.

* Calcos now checks the value of wavecorr before updating WAVECALS so that the
WAVECALS keyword will only be updated if wavecorr is COMPLETE.

* A new column has been included in the wavecal parameters table, giving a
zero-point offset for the search range. Calcos now reads this column (if it is
present) in the WCPTAB and adds the offset to the limits of the search range.

* The EXPTIME keyword in NUV x1dsum files has been fixed.  When averaging
spectra to make an x1dsum table, the exposure time keyword was incremented for
each stripe, in addition to each input file, resulting in a value that was three
times too large.  (The EXPTIME column was already correct.)

* Calcos checks that EXPEND - EXPSTART is not zero when computing the exposure
time needed to scale the flat-field when averaging spectra.

* Code now gets DETECTOR from PRIMARY header when including the flat-field in
the weight when averaging 1-D spectra.

* The first or last pixel of an x1dsum table sometimes had a data quality value
of 0, even when that pixel was actually off the detector and should have been
flagged as bad.  This has been fixed.

* The exposure time keyword now gets updated before writing the csum file, so
that if calcos fails due to a bad value of the APERTURE keyword, the exposure
time keyword in the csum file will be correct.

* CALCOS now checks the value of WAVECORR before updating the WAVECALS primary
header keyword and only updates if WAVECORR=COMPLETE.

* Code now uses boxcar function from stsci.convolve.


DRIZZLEPAC
===========
DrizzlePac 1.1.16 (released separetely 27-Mar-2014) includes all the following
changes made to astrodrizzle since the last released version of 1.1.8 (from Mar
2013):

* Added support for 2-D D2IM corrections.  This change made it impossible to
update the WCS in images using the old D2IM correction used with ACS.

* Removed all references to .has_key() when working with files in order to be
compliant with PyFITS v3.2 and greater.

* Fixed problems so that STIS data can be processed using AstroDrizzle.

* Updated the logic to support pixfrac = 0.0 and automatically reset kernel to
'point' in that case while not crashing when pixfrac=0.0

* Removed all WCS keywords from drizzle products associated with the original
OPUS WCS solution with distortion.

* Fixed the bug so that the input file DQ arrays get updated again with
cosmic-rays identified when processed in the pipeline. This only affects use of
the code when run with 'in_memory=True'.

* API documentation for DrizzlePac was updated

* The value of the NEXTEND keyword now gets updated to accurately reflect the
number of extensions in the INPUT images when 'updatewcs' is run.
    
Tweakreg 1.2.2 also includes the following changes and bug fixes made since the
last release:

* Updated to add the new 'interactive' parameter which supports processing in
'batch' mode when all plots are automatically saved to disk without the need for
interactive user-input.

* Fixed bug that caused tweakreg to crash when writing out the matched results
when exclusion files were used

* Fixed a bug that caused tweakreg to crash when no user catalog was specified
for one of the input image chips in the source catalog specified in the
'catfile' parameter.

* Fixed a bug that affected use of the 'nbright' parameter

* The value of the NEXTEND keyword now gets updated to accurately reflect the
number of extensions in the INPUT images when updating them with either
'updatewcs'=True or attaching a headerlet.

* Support for WFPC2 GEIS input images improved to correctly find the associated
DQ images.

* Static mask files created for all chips in an image now get deleted when using
the 'group' parameter to only drizzle a single chip or subset of chips.

* Fixed problem caused by changes to stsci.tools code so that drizzlepac will
reference the correct extensions in input images.


FITSBLENDER
============
Version 0.2.3 (released previously on 14-Jan-2014) includes:

* Changes necessary to insure that the NEXTEND keyword gets updated correctly


NICTOOLS
========
Version 1.1.1 only includes changes necessary to stay compatible with the latest
version of PyFITS, eliminating deprecated calls where they had been used.


STISTOOLS
=========
Version 1.0.2 is a new module that contains basic2d, calstis, ocrreject,
wavecal, x1d, and x2d.  These run the hstcal-based (i.e. IRAF-independent)
calstis.  The tasks with the same names in the stis package will be removed in
a future release; the stis package uses the IRAF-dependent calstis and is no
longer supported.


REFTOOLS
========
These tools are used almost exclusively to help with the generation of
instrument calibration reference files. Updates to tasks in this package
include:

* Updated PCTETAB code and data to support CALACS versions 8.2.0 and later where
the CTE processing was refactored into its own processing step within CALACS
instead of being part of ACSCCD.

* Updated code to depend on astropy.io.fits instead of stand-alone PyFITS

* Revised IMPHTTAB generation code to correctly handle cases where there is no
flux in the bandpass.

* Also revised IMPHTTAB generation code to add useafter and detector parameters
so that output IMPHTTAB will meet those parameter criteria

* Fixed empty string elements in float array when invalid obsmode is returned
from synphot throughput (TMG) table


STWCS
=====
This release (Version 1.1.2 includes the same version that was released with
DrizzlePac 1.1.15 on 14-Jan-2014.  Changes made since the previous release in
2013 include:

* The updatewcs task was updated to insure that the NEXTEND keyword (if present)
remains consistent with the number of extensions in the FITS file after all
updates are performed.

* The all_sky2pix() method of the HSTWCS object was revised to work more
robustly when used on positions outside the original image's field of view.

* Fix calls to updated PyFITS (>v3.1) to allow writing of headerlet out to files

* Implement support for multiple file inputs for apply_header, delete_headerlet
and attach_headerlet TEAL tasks and their underlying Python interfaces.

* WFPC2 data can now be updated correctly using headerlets, with proper handling
of the D2IM arrays.


WFC3TOOLS
=========
This package includes support for WFC3 specific tasks, supporting CALWF3 3.0 in
the HSTCAL package.

* Added a task, embedsub, to WFC3TOOLS which embeds subarray images into full
frame images.  This can be used with aXe and other calibration needs.

* Added a task, sub2full, which returns the location of the corner of the
subarray exposure in a full frame reference image (including the full physical
extent of the chip), in 1-indexed pixels.

* Added a Python implementation of pstack and pstat.

* Added a sampinfo tool for IR data, similar to the IRAF sampinfo task.

* Documentation and helpfiles were updated to reflect these new tasks as well
as updates to CALWF3 itself.


STSCI.TOOLS
===========
This package contains code used by multiple packages within the stsci_python
distribution.  Changes to this package include:

* Fixed a bug in the getExtn() function in fileutil.py that affected the
handling of waivered-FITS files when blank extension name gets specified.

* Fixed problems with stpyfits so that it does not crash when a header contains
PIXVALUE and a non-zero NAXIS keyword value.

* TEAL cookbook updated to better document how to support more complex rules
when defining parameters for the TEAL interface.


STSCI.CONVOLVE
===============
This package (Version 2.2.0) no longer depends on numarray compatibility within
numpy,  as those compatibility functions were integrated directly into this
package so that all operations are done using numpy.