[Python-modules-commits] r12903 - in packages/pyfits/trunk/debian (CHANGES changelog control)
aurel32 at users.alioth.debian.org
aurel32 at users.alioth.debian.org
Thu May 13 13:40:13 UTC 2010
Date: Thursday, May 13, 2010 @ 13:40:08
Author: aurel32
Revision: 12903
New upstream version
Modified:
packages/pyfits/trunk/debian/CHANGES
packages/pyfits/trunk/debian/changelog
packages/pyfits/trunk/debian/control
Modified: packages/pyfits/trunk/debian/CHANGES
===================================================================
--- packages/pyfits/trunk/debian/CHANGES 2010-05-13 13:09:38 UTC (rev 12902)
+++ packages/pyfits/trunk/debian/CHANGES 2010-05-13 13:40:08 UTC (rev 12903)
@@ -11,9 +11,356 @@
widely used or available data (so please let us know when such problems
occur).
- PyFITS requires numpy (or numarray) to be installed.
+ PyFITS requires numpy to be installed.
__________________________________________________________________
+ Version 2.3; May 11 2010
+
+ * The following enhancements were made:
+ + Completely eliminate support for numarray.
+ + Rework pyfits documention to use Sphinx.
+ + Support python 2.6 and future division.
+ + Added a new method to get the file name associated with an
+ HDUList object. The method HDUList.filename() returns the name
+ of an associated file. It returns None if no file is
+ associated with the HDUList.
+ + Support the python 2.5 'with' statement when opening fits
+ files. (CNSHD766308) It is now possible to use the following
+ construct:
+>>> from __future__ import with_statement
+>>> import pyfits
+>>> with pyfits.open("input.fits") as hdul:
+... #process hdul
+>>>
+
+ + Extended the support for reading unsigned integer 16 values
+ from an ImageHDU to include unsigned integer 32 and unsigned
+ integer 64 values. ImageHDU data is considered to be unsigned
+ integer 16 when the data type is signed integer 16 and BZERO
+ is equal to 2**15 (32784) and BSCALE is equal to 1. ImageHDU
+ data is considered to be unsigned integer 32 when the data
+ type is signed integer 32 and BZERO is equal to 2**31 and
+ BSCALE is equal to 1. ImageHDU data is considered to be
+ unsigned integer 64 when the data type is signed integer 64
+ and BZERO is equal to 2**63 and BSCALE is equal to 1. An
+ optional keyword argument (uint) was added to the open
+ convenience function for this purpose. Supplying a value of
+ True for this argument will cause data of any of these types
+ to be read in and scaled into the appropriate unsigned integer
+ array (uint16, uint32, or uint64) instead of into the normal
+ float 32 or float 64 array. If an HDU associated with a file
+ that was opened with the 'int' option and containing unsigned
+ integer 16, 32, or 64 data is written to a file, the data will
+ be reverse scaled into a signed integer 16, 32, or 64 array
+ and written out to the file along with the appropriate
+ BSCALE/BZERO header cards. Note that for backward
+ compatability, the 'uint16' keyword argument will still be
+ accepted in the open function when handling unsigned integer
+ 16 conversion.
+ + Provided the capability to access the data for a column of a
+ fits table by indexing the table using the column name. This
+ is consistent with Record Arrays in numpy (array with fields).
+ (CNSHD763378) The following example will illustrate this:
+>>> import pyfits
+>>> hdul = pyfits.open('input.fits')
+>>> table = hdul[1].data
+>>> table.names
+['c1','c2','c3','c4']
+>>> print table.field('c2') # this is the data for column 2
+['abc' 'xy']
+>>> print table['c2'] # this is also the data for column 2
+array(['abc', 'xy '],
+dtype='|S3')
+>>> print table[1] # this is the data for row 1
+(2, 'xy', 6.6999997138977054, True)
+
+ + Provided capabilities to create a BinaryTableHDU directly from
+ a numpy Record Array (array with fields). The new capabilities
+ include table creation, writing a numpy Record Array directly
+ to a fits file using the pyfits.writeto and pyfits.append
+ convenience functions. Reading the data for a BinaryTableHDU
+ from a fits file directly into a numpy Record Array using the
+ pyfits.getdata convenience function. (CNSHD749034) Thanks to
+ Erin Sheldon at Brookhaven National Laboratory for help with
+ this.
+ The following should illustrate these new capabilities:
+>>> import pyfits
+>>> import numpy
+
+>>> t=numpy.zeros(5,dtype=[('x','f4'),('y','2i4')]) \
+... # Create a numpy Record Array with fields
+
+>>> hdu = pyfits.BinTableHDU(t) \
+... # Create a Binary Table HDU directly from the Record Array
+>>> print hdu.data
+[(0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))]
+
+>>> hdu.writeto('test1.fits',clobber=True) \
+... # Write the HDU to a file
+>>> pyfits.info('test1.fits')
+Filename: test1.fits
+No. Name Type Cards Dimensions Format
+0 PRIMARY PrimaryHDU 4 () uint8
+1 BinTableHDU 12 5R x 2C [E, 2J]
+
+>>> pyfits.writeto('test.fits', t, clobber=True) \
+... # Write the Record Array directly to a file
+
+>>> pyfits.append('test.fits', t) \
+... # Append another Record Array to the file
+>>> pyfits.info('test.fits')
+Filename: test.fits
+No. Name Type Cards Dimensions Format
+0 PRIMARY PrimaryHDU 4 () uint8
+1 BinTableHDU 12 5R x 2C [E, 2J]
+2 BinTableHDU 12 5R x 2C [E, 2J]
+
+>>> d=pyfits.getdata('test.fits',ext=1) \
+... # Get the first extension from the file as a FITS_rec
+>>> print type(d)
+
+>>> print d
+[(0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))
+ (0.0, array([0, 0], dtype=int32))]
+
+>>> d=pyfits.getdata('test.fits',ext=1,view=numpy.ndarray) \
+... # Get the first extension from the file as a numpy Record
+ Array
+>>> print type(d)
+
+>>> print d
+[(0.0, [0, 0]) (0.0, [0, 0]) (0.0, [0, 0]) (0.0, [0, 0])
+ (0.0, [0, 0])]
+>>> print d.dtype
+[('x', '>f4'), ('y', '>i4', 2)]
+
+>>> d=pyfits.getdata('test.fits',ext=1,upper=True,
+... view=pyfits.FITS_rec) \
+... # Force the Record Array field names to be in upper case
+ regardless of how they are stored in the file
+>>> print d.dtype
+[('X', '>f4'), ('Y', '>i4', 2)]
+
+ + Provided support for writing fits data to file-like objects
+ that do not support the random access methods seek() and
+ tell(). Most pyfits functions or methods will treat these
+ file-like objects as an empty file that cannot be read, only
+ written. It is also expected that the file-like object is in a
+ writable condition (ie. opened) when passed into a pyfits
+ function or method. The following methods and functions will
+ allow writing to a non-random access file-like object:
+ HDUList.writeto(), HDUList.flush(), pyfits.writeto(), and
+ pyfits.append(). The pyfits.open() convenience function may be
+ used to create an HDUList object that is associated with the
+ provided file-like object. (CNSHD770036)
+ An illustration of the new capabilities follows. In this
+ example fits data is written to standard output which is
+ associated with a file opened in write-only mode:
+>>> import pyfits
+>>> import numpy as np
+>>> import sys
+>>>
+>>> hdu = pyfits.PrimaryHDU(np.arange(100,dtype=np.int32))
+>>> hdul = pyfits.HDUList()
+>>> hdul.append(hdu)
+>>> tmpfile = open('tmpfile.py','w')
+>>> sys.stdout = tmpfile
+>>> hdul.writeto(sys.stdout, clobber=True)
+>>> sys.stdout = sys.__stdout__
+>>> tmpfile.close()
+>>> pyfits.info('tmpfile.py')
+Filename: tmpfile.py
+No. Name Type Cards Dimensions Format
+0 PRIMARY PrimaryHDU 5 (100,) int32
+>>>
+
+ + Provided support for slicing a FITS_record object. The
+ FITS_record object represents the data from a row of a table.
+ Pyfits now supports the slice syntax to retrieve values from
+ the row. The following illustrates this new syntax:
+>>> hdul = pyfits.open('table.fits')
+>>> row = hdul[1].data[0]
+>>> row
+('clear', 'nicmos', 1, 30, 'clear', 'idno= 100')
+>>> a, b, c, d, e = row[0:5]
+>>> a
+'clear'
+>>> b
+'nicmos'
+>>> c
+1
+>>> d
+30
+>>> e
+'clear'
+>>>
+
+ + Allow the assignment of a row value for a pyfits table using a
+ tuple or a list as input. The following example illustrates
+ this new feature:
+>>> c1=pyfits.Column(name='target',format='10A')
+>>> c2=pyfits.Column(name='counts',format='J',unit='DN')
+>>> c3=pyfits.Column(name='notes',format='A10')
+>>> c4=pyfits.Column(name='spectrum',format='5E')
+>>> c5=pyfits.Column(name='flag',format='L')
+>>> coldefs=pyfits.ColDefs([c1,c2,c3,c4,c5])
+>>>
+>>> tbhdu=pyfits.new_table(coldefs, nrows = 5)
+>>>
+>>> # Assigning data to a table's row using a tuple
+>>> tbhdu.data[2] = ('NGC1',312,'A Note',
+... num.array([1.1,2.2,3.3,4.4,5.5],dtype=num.float32),
+... True)
+>>>
+>>> # Assigning data to a tables row using a list
+>>> tbhdu.data[3] = ['JIM1','33','A Note',
+... num.array([1.,2.,3.,4.,5.],dtype=num.float32),True]
+
+ + Allow the creation of a Variable Length Format (P format)
+ column from a list of data. The following example illustrates
+ this new feature:
+>>> a = [num.array([7.2e-20,7.3e-20]),num.array([0.0]),
+... num.array([0.0])]
+>>> acol = pyfits.Column(name='testa',format='PD()',array=a)
+>>> acol.array
+_VLF([[ 7.20000000e-20 7.30000000e-20], [ 0.], [ 0.]],
+dtype=object)
+>>>
+
+ + Allow the assignment of multiple rows in a table using the
+ slice syntax. The following example illustrates this new
+ feature:
+>>> counts = num.array([312,334,308,317])
+>>> names = num.array(['NGC1','NGC2','NGC3','NCG4'])
+>>> c1=pyfits.Column(name='target',format='10A',array=names)
+>>> c2=pyfits.Column(name='counts',format='J',unit='DN',
+... array=counts)
+>>> c3=pyfits.Column(name='notes',format='A10')
+>>> c4=pyfits.Column(name='spectrum',format='5E')
+>>> c5=pyfits.Column(name='flag',format='L',array=[1,0,1,1])
+>>> coldefs=pyfits.ColDefs([c1,c2,c3,c4,c5])
+>>>
+>>> tbhdu1=pyfits.new_table(coldefs)
+>>>
+>>> counts = num.array([112,134,108,117])
+>>> names = num.array(['NGC5','NGC6','NGC7','NCG8'])
+>>> c1=pyfits.Column(name='target',format='10A',array=names)
+>>> c2=pyfits.Column(name='counts',format='J',unit='DN',
+... array=counts)
+>>> c3=pyfits.Column(name='notes',format='A10')
+>>> c4=pyfits.Column(name='spectrum',format='5E')
+>>> c5=pyfits.Column(name='flag',format='L',array=[0,1,0,0])
+>>> coldefs=pyfits.ColDefs([c1,c2,c3,c4,c5])
+>>>
+>>> tbhdu=pyfits.new_table(coldefs)
+>>> tbhdu.data[0][3] = num.array([1.,2.,3.,4.,5.],
+... dtype=num.float32)
+>>>
+>>> tbhdu2=pyfits.new_table(tbhdu1.data, nrows=9)
+>>>
+>>> # Assign the 4 rows from the second table to rows 5 thru
+... 8 of the new table. Note that the last row of the new
+... table will still be initialized to the default values.
+>>> tbhdu2.data[4:] = tbhdu.data
+>>>
+>>> print tbhdu2.data
+[ ('NGC1', 312, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), True)
+ ('NGC2', 334, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), False)
+ ('NGC3', 308, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), True)
+ ('NCG4', 317, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), True)
+ ('NGC5', 112, '0.0', array([ 1., 2., 3., 4., 5.],
+dtype=float32), False)
+ ('NGC6', 134, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), True)
+ ('NGC7', 108, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), False)
+ ('NCG8', 117, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), False)
+ ('0.0', 0, '0.0', array([ 0., 0., 0., 0., 0.],
+dtype=float32), False)]
+>>>
+
+ * The following bugs were fixed:
+ + Corrected bugs in HDUList.append and HDUList.insert to
+ correctly handle the situation where you want to insert or
+ append a Primary HDU as something other than the first HDU in
+ an HDUList and the situation where you want to insert or
+ append an Extension HDU as the first HDU in an HDUList.
+ + Corrected a bug involving scaled images (both compressed and
+ not compressed) that include a BLANK, or ZBLANK card in the
+ header. When the image values match the BLANK or ZBLANK value,
+ the value should be replaced with NaN after scaling. Instead,
+ pyfits was scaling the BLANK or ZBLANK value and returning it.
+ (CNSHD766129)
+ + Corrected a byteswapping bug that occurs when writing certain
+ column data. (CNSHD763307)
+ + Corrected a bug that occurs when creating a column from a
+ chararray when one or more elements are shorter than the
+ specified format length. The bug wrote nulls instead of spaces
+ to the file. (CNSHD695419)
+ + Corrected a bug in the HDU verification software to ensure
+ that the header contains no NAXISn cards where n > NAXIS.
+ + Corrected a bug involving reading and writing compressed image
+ data. When written, the header keyword card ZTENSION will
+ always have the value 'IMAGE' and when read, if the ZTENSION
+ value is not 'IMAGE' the user will receive a warning, but the
+ data will still be treated as image data.
+ + Corrected a bug that restricted the ability to create a custom
+ HDU class and use it with pyfits. The bug fix will allow
+ something like this:
+>>> import pyfits
+>>> class MyPrimaryHDU(pyfits.PrimaryHDU):
+... def __init__(self, data=None, header=None):
+... pyfits.PrimaryHDU.__init__(self, data, header)
+
+... def _summary(self):
+... """
+... Reimplement a method of the class.
+... """
+... s = pyfits.PrimaryHDU._summary(self)
+... # change the behavior to suit me.
+... s1 = 'MyPRIMARY ' + s[11:]
+... return s1
+...
+>>> hdul=pyfits.open("pix.fits",
+... classExtensions={pyfits.PrimaryHDU: MyPrimaryHDU})
+
+>>> hdul.info()
+Filename: pix.fits
+No. Name Type Cards Dimensions Format
+0 MyPRIMARY MyPrimaryHDU 59 (512, 512) int16
+>>>
+
+ + Modified ColDefs.add_col so that instead of returning a new
+ ColDefs object with the column added to the end, it simply
+ appends the new column to the current ColDefs object in place.
+ (CNSHD768778)
+ + Corrected a bug in ColDefs.del_col which raised a KeyError
+ exception when deleting a column from a ColDefs object.
+ + Modified the open convenience function so that when a file is
+ opened in readonly mode and the file contains no HDU's an
+ IOError is raised.
+ + Modified _TableBaseHDU to ensure that all locations where data
+ is referenced in the object actually reference the same
+ ndarray, instead of copies of the array.
+ + Corrected a bug in the Column class that failed to initialize
+ data when the data is a boolean array. (CNSHD779136)
+ + Corrected a bug that caused an exception to be raised when
+ creating a variable length format column from character data
+ (PA format).
+ __________________________________________________________________
+
Version 2.2.2; October 12 2009
* Updates described in this release are only supported in the NUMPY
Modified: packages/pyfits/trunk/debian/changelog
===================================================================
--- packages/pyfits/trunk/debian/changelog 2010-05-13 13:09:38 UTC (rev 12902)
+++ packages/pyfits/trunk/debian/changelog 2010-05-13 13:40:08 UTC (rev 12903)
@@ -1,3 +1,9 @@
+pyfits (1:2.3-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Aurelien Jarno <aurel32 at debian.org> Thu, 13 May 2010 15:08:29 +0200
+
pyfits (1:2.2.2-1) unstable; urgency=low
* New upstream version (Closes: #572698).
Modified: packages/pyfits/trunk/debian/control
===================================================================
--- packages/pyfits/trunk/debian/control 2010-05-13 13:09:38 UTC (rev 12902)
+++ packages/pyfits/trunk/debian/control 2010-05-13 13:40:08 UTC (rev 12903)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Uploaders: Aurelien Jarno <aurel32 at debian.org>
-Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.3.5-7), python-support (>= 0.3)
+Build-Depends: debhelper (>= 5.0.37.2), python-numpy, python-all-dev (>= 2.3.5-7), python-support (>= 0.3)
Standards-Version: 3.8.4
Homepage: http://www.stsci.edu/resources/software_hardware/pyfits
Vcs-Svn: svn://svn.debian.org/python-modules/packages/pyfits/trunk/
More information about the Python-modules-commits
mailing list