This repository has been archived by the owner on Dec 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCHANGES.txt
3457 lines (2571 loc) · 142 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Changelog
=========
3.5 (unreleased)
----------------
This release officially deprecates PyFITS. Please use astropy.io.fits instead.
- Importing PyFITS now gives deprecation warning.
- Documentation updates.
3.4 (2016-01-28)
----------------
This release removes support for Python 2.5, as well as Python 3.0 - 3.2.
Supported Python versions are now Python 2.6, 2.7, and 3.3+. This
release incorporates new features and bug fixes made in the
``astropy.io.fits`` module in Astropy, which is originally based on PyFITS
and supersedes the stand-alone PyFITS module.
This will likely be the last stand-alone release of PyFITS that does not
depend on Astropy. There are a few reasons for this:
1) Development resources for PyFITS are limited, and better focused on
newer projects.
2) Astropy incorporates all features of PyFITS, and has many new features
from which future development of the FITS reader/writer can benefit, such
as a better table interface, units, and datetime types. Since the most
beneficial future development in ``astropy.io.fits`` depends on other
parts of Astropy there is less motivation to maintain an independent FITS
module.
This release contains most changes to the ``astropy.io.fits`` module that
have been made since the last release of PyFITS (v3.3), except for changes
that depend explicitly on other parts of Astropy. This brings PyFITS mostly
to parity with the version of ``astropy.io.fits`` that will be in Astropy
v1.1.2.
Although an exhaustive list of changes is difficult, some of the highlights
are below:
New Features
^^^^^^^^^^^^
- Included a new command-line script called fitsheader to display the
header(s) of a FITS file from the command line. (astropy/astropy#2092)
- Added support for a ``savecomment`` argument in the ``Header.set`` method,
equivalent to the argument of the same name to the old ``Header.update``
method. (Note: This change was never ported to Astropy due to lack of
demand.)
- The ``fitsdiff`` script ignores some things by default when comparing fits
files (e.g. empty header lines). This adds a ``--exact`` option where
nothing is ignored. [#2782, #3110]
- ``Section`` now supports all advanced indexing features ``ndarray`` does
(slices with any steps, integer arrays, boolean arrays, None, Ellipsis).
It also properly returns scalars when this is appropriate.
(astropy/astropy#3148)
- Support reading and writing from bzip2 compressed files. i.e.
``.fits.bz2`` files. (astropy/astropy#3789)
API Changes
^^^^^^^^^^^
- Overwriting an existing file using the ``clobber=True`` option no longer
displays a warning message. (astropy/astropy#1963)
- ``pyfits.open`` no longer catches ``OSError`` exceptions on missing or
unreadable files-- instead it raises the standard Python exceptions in
such cases. (astropy/astropy#2756)
- The ``uint`` argument to ``pyfits.open`` is now True by default; that is,
arrays using the FITS unsigned integer convention will be detected, and
read as unsigned integers by default. A new config option for ``pyfits``,
``ENABLE_UINT``, can be changed to False to revert to the original
behavior of ignoring the ``uint`` convention unless it is explicitly
requested with ``uint=True``. (astropy/astropy#3916)
- The ``ImageHDU.NumCode`` and ``ImageHDU.ImgCode`` attributes (and same for
other classes derived from ``_ImageBaseHDU``) are deprecated. Instead,
the ``pyfits`` module-level constants ``BITPIX2DTYPE`` and
``DTYPE2BITPIX`` can be used. (astropy/astropy#3916)
Bug Fixes
^^^^^^^^^
- Fixes for checksums on 32-bit platforms. Results may be different if
writing or checking checksums in "nonstandard" mode.
(astropy/astropy#2484)
- Fixed a crash when reading scaled float data out of a FITS file that was
loaded from a string (using ``HDUList.fromfile``) rather than from a file.
(astropy/astropy#2710)
- Fixed a crash when reading data from an HDU whose header contained in
invalid value for the BLANK keyword (e.g., a string value instead of an
integer as required by the FITS Standard). Invalid BLANK keywords are now
warned about, but are otherwise ignored. (astropy/astropy#2711)
- Fixed a crash when reading the header of a tile-compressed HDU if that
header contained invalid duplicate keywords resulting in a ``KeyError``
(astropy/astropy#2750)
- Fixed corruption when writing new FITS files through to gzipped files.
(astropy/astropy#2794)
- Fixed crash when writing HDUs made with non-contiguous data arrays to
file-like objects. (astropy/astropy#2794)
- It is now possible to create ``pyfits.BinTableHDU`` objects with a table
with zero rows. (astropy/astropy#2916)
- The ``in`` operator now works correctly for checking if an extension is in
an ``HDUList`` (as given via EXTNAME, (EXTNAME, EXTVER) tuples, etc.)
(astropy/astropy#3060)
- Added workaround for bug in MacOS X <= 10.8 that caused np.fromfile to
fail. (astropy/astropy#3078)
- Added support for the ``RICE_ONE`` compression type synonym.
(astropy/astropy#3115)
- Fixed the problem in ``pyfits.open`` of some filenames with colon (``:``)
in the name being recognized as URLs instead of file names.
(astropy/astropy#3122)
- Setting ``memmap=True`` in ``fits.open`` and related functions now raises
a ValueError if opening a file in memory-mapped mode is impossible.
(astropy/astropy#2298)
- CONTINUE cards no longer end the value of the final card in the series
with an ampersand, per the specification of the CONTINUE card convention.
(astropy/astropy#3282)
- Fixed a crash that occurred when reading an ASCII table containing
zero-precision floating point fields. (astropy/astropy#3422)
- When a float field for an ASCII table has zero-precision a decimal point
(with no digits following it) is still written to the field as long as
there is space for it, as recommended by the FITS standard. This makes it
less ambiguous that these columns should be interpreted as floats.
(astropy/astropy#3422)
- Fixed a severe memory leak that occurred when reading tile compressed
images. (astropy/astropy#3680)
- Fixed bug where column data could be unintentionally byte-swapped when
copying data from an existing FITS file to a new FITS table with a TDIMn
keyword for that column. (astropy/astropy#3561)
- The ``ColDefs.change_attrib``, ``ColDefs.change_name``, and
``ColDefs.change_unit`` methods now work as advertised. It is also
possible (and preferable) to update attributes directly on ``Column``
objects (for example setting ``column.name``), and the change will be
accurately reflected in any associated table data and its FITS header.
(astropy/astropy#3283)
- Fixes an issue with the ``FITS_rec`` interface to FITS table data, where a
``FITS_rec`` created by copying an existing FITS table but adding new rows
could not be sliced or masked correctly. (astropy/astropy#3641)
- Fixed handling of BINTABLE with TDIMn of size 1. (astropy/astropy#3580)
- Fixes to support Numpy 1.10. (astropy/astropy#3419)
- Fixed crash when updating data in a random groups HDU opened in update
mode. (astropy/astropy#3730)
- Fixed incorrect checksum / datasum being written when re-writing a scaled
HDU (i.e. non-trivial BSCALE and/or BZERO) with
``do_not_scale_image_data=False``. (astropy/astropy#3883)
- Fixed stray deprecation warning in ``BinTableHDU.copy()``. (astropy/astropy#3789)
- Better handling of the ``BLANK`` keyword when auto-scaling scaled image
data. The ``BLANK`` keyword is now removed from the header after
auto-scaling is applied, and it is restored properly (with floating point
NaNs replaced by the filler value) when updating a file opened with the
``scale_back=True`` argument. Invalid usage of the ``BLANK`` keyword is
also better warned about during validation. (astropy/astropy#3865)
- Reading memmaped scaled images won't fail when
``do_not_scale_image_data=True`` (that is, since we're just reading the
raw / physical data there is no reason mmap can't be used).
(astropy/astropy#3766)
- Fixed a reference cycle that could sometimes cause FITS table-related
objects (``BinTableHDU``, ``ColDefs``, etc.) to hang around in memory
longer than expected. (astropy/astropy#4012)
- Fix bug when extending one header (without comments) with another (with
comments). (astropy/astropy#3967)
- Somewhat improved resource usage for FITS data--previously a new ``mmap``
was opened for each HDU of a FITS file accessed through an ``HDUList``.
Each ``mmap`` used up a single file descriptor, causing problems with
system resource limits for some users. Now only a single ``mmap`` is
opened, and shared for the data of all HDUs. Note: The problem still
persists with using the "convenience" functions. For example using
``fits.getdata`` will create one ``mmap`` per HDU read this way (as
opposed to opening the file with ``fits.open`` and accessing the HDUs
through the ``HDUList`` object). (astropy/astropy#4097)
- Fix bug where reading a file without a newline failed with an unrelated /
unhelpful exception. (astropy/astropy#4160)
- ``fitsdiff`` and related functions now do a better job reporting
differences between values that are different types but have the same
representation (ex: the string '0' versus the number 0).
(astropy/astropy#4122)
- Miscellaneous fixes for supporting Numpy 1.10. (astropy/astropy#4228)
- Fixed an issue where writing a column of unicode strings to a FITS table
resulted in a quadrupling of size of the column (i.e. the format of the
FITS column was 4 characters for every one in the original strings).
(astropy/astropy#4228)
- Added support for an obscure case (but nonetheless allowed by the FITS
standard) where a column has some TDIMn keyword, but a repeat count in the
TFORMn column greater than the number of elements implied by the TDIMn.
For example TFORMn = 100I, but TDIMn = '(5,5)'. In this case the TDIMn
implies 5x5 arrays in the column, but the TFORMn implies a 100 element 1-D
array in the column. In this case the TDIM takes precedence, and the
remaining bytes in the column are ignored. (astropy/astropy#4228)
- Fixed a regression that could cause writes of large FITS files to be
truncated. (astropy/astropy#4307)
- Fixed possible segfault during error handling in FITS tile compression.
(astropy/astropy#4489)
- Fixed crash on pickling of binary table columns with the 'X', 'P', or
'Q' format. (astropy/astropy#4514)
- Fixed memory / reference leak that could occur when copying a ``FITS_rec``
object (the ``.data`` for table HDUs). (astropy/astropy#520)
- Fixed a memory / reference leak in ``FITS_rec`` that occurred in a wide
range of cases, especially after writing FITS tables to a file, but in
other cases as well. (astropy/astropy#4539)
3.3 (2014-07-17)
----------------
New Features
^^^^^^^^^^^^
- Added new verification options ``fix+ignore``, ``fix+warn``,
``fix+exception``, ``silentfix+ignore``, ``silentfix+warn``, and
``silentfix+exception`` which give more control over how to report fixable
errors as opposed to unfixable errors. See the "Verification" section in
the PyFITS documentation for more details.
API Changes
^^^^^^^^^^^
- The ``pyfits.new_table`` function is now fully deprecated (though will not
be removed for a long time, considering how widely it is used).
Instead please use the more explicit ``pyfits.BinTableHDU.from_columns`` to
create a new binary table HDU, and the similar
``pyfits.TableHDU.from_columns`` to create a new ASCII table. These
otherwise accept the same arguments as ``pyfits.new_table`` which is now
just a wrapper for these.
- The ``.fromstring`` classmethod of each HDU type has been simplified such
that, true to its namesake, it only initializes an HDU from a string
containing its header *and* data. (spacetelescope/PyFITS#64)
- Fixed an issue where header wildcard matching (for example
``header['DATE*']``) can be used to match *any* characters that might appear
in a keyword. Previously this only matched keywords containing characters
in the set ``[0-9A-Za-z_]``. Now this can also match a hyphen ``-`` and any
other characters, as some conventions like ``HIERARCH`` and record-valued
keyword cards allow a wider range of valid characters than standard FITS
keywords.
- This will be the *last* release to support the following APIs that have been
marked deprecated since PyFITS v3.1:
- The ``CardList`` class, which was part of the old header implementation.
- The ``Card.key`` attribute. Use ``Card.keyword`` instead.
- The ``Card.cardimage`` and ``Card.ascardimage`` attributes. Use simply
``Card.image`` or ``str(card)`` instead.
- The ``create_card`` factory function. Simply use the normal ``Card``
constructor instead.
- The ``create_card_from_string`` factory function. Use ``Card.fromstring``
instead.
- The ``upper_key`` function. Use ``Card.normalize_keyword`` method instead
(this is not unlikely to be used outside of PyFITS itself, but it was
technically public API).
- The usage of ``Header.update`` with ``Header.update(keyword, value,
comment)`` arguments. ``Header.update`` should only be used analogously
to ``dict.update``. Use ``Header.set`` instead.
- The ``Header.ascard`` attribute. Use ``Header.cards`` instead for a list
of all the ``Card`` objects in the header.
- The ``Header.rename_key`` method. Use ``Header.rename_keyword`` instead.
- The ``Header.get_history`` method. Use ``header['HISTORY']`` instead
(normal keyword lookup).
- The ``Header.get_comment`` method. Use ``header['COMMENT']`` instead.
- The ``Header.toTxtFile`` method. Use ``header.totextfile`` instead.
- The ``Header.fromTxtFile`` method. Use ``Header.fromtextfile`` instead.
- The ``pyfits.tdump`` and ``tcreate`` functions. Use ``pyfits.tabledump``
and ``pyfits.tableload`` respectively.
- The ``BinTableHDU.tdump`` and ``tcreate`` methods. Use
``BinTableHDU.dump`` and ``BinTableHDU.load`` respectively.
- The ``txtfile`` argument to the ``Header`` constructor. Use
``Header.fromfile`` instead.
- The ``startColumn`` and ``endColumn`` arguments to the ``FITS_record``
constructor. These are unlikely to be used by any user code.
These deprecated interfaces will be removed from the development version of
PyFITS following the v3.3 release (they will still be available in any
v3.3.x bugfix releases, however).
Other Changes and Additions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- PyFITS has switched to a unified code base which supports Python 2.5 through
3.4 simultaneously without translation. This *shouldn't* have any
significant performance impacts, but please report if anything seems
noticeably slower. As a reminder, support for Python 2.5 will be ended
after PyFITS 3.3.x.
- Warnings for deprecated APIs in PyFITS are now always displayed by default.
This is in line with a similar change made recently to Astropy:
https://github.com/astropy/astropy/pull/1871
To disable PyFITS deprecation warnings in scripts one may call
``pyfits.ignore_deprecation_warnings()`` after importing PyFITS.
- ``Card`` objects have a new ``is_blank`` attribute which returns ``True`` if
the card represents a blank card (no keyword, value, or comment) and
``False`` otherwise.
Bug Fixes
^^^^^^^^^
- Fixed a regression where it was not possible to save an empty "compressed"
image to a file (in this case there is nothing to compress, hence the
quotes, but trying to do so caused a crash). (spacetelescope/PyFITS#69)
- Fixed a regression that may have been introduced in v3.2.1 with writing
compressed image HDUs, particularly compressed images using a non-empty
GZIP_COMPRESSED_DATA column. (spacetelescope/#71)
3.2.5 (unreleased)
------------------
- Nothing changed yet.
3.1.7 (unreleased)
------------------
- Nothing changed yet.
3.2.4 (2014-06-02)
------------------
- Fixed a regression where multiple consecutive calls of the ``writeto``
method on the same HDU but to different files could lead to corrupt data or
crashes on the subsequent calls after the first. (spacetelescope/PyFITS#40)
3.2.3 (2014-05-14)
------------------
- Nominal support for Python 3.4.
- Fixed a bug with using the ``tabledump`` and ``tableload`` functions with
tables containing array columns (columns in which each element is an array
instead of a single scalar value). (spacetelescope/PyFITS#22)
- Fixed an issue where PyFITS allowed newline characters in header values and
comments. (spacetelescope/PyFITS#51)
- Fixed pickling of ``FITS_rec`` (table data) objects.
(spacetelescope/PyFITS#53)
- Improved behavior when writing large compressed images on OSX by removing an
unnecessary check for platform architecture. (spacetelescope/PyFITS#57)
- Allow reading FITS files from file-like objects that do not have a
``.closed`` attribute (and as such may not even have an "open" vs. "closed"
concept). (spacetelescope/PyFITS#56)
- Fixed duplicate insertion of commentary keywords on compressed image
headers. (spacetelescope/PyFITS#58)
- Fixed minor issue with comparison of header commentary card values.
(spacetelescope/PyFITS#59)
3.1.6 (2014-05-14)
------------------
- Nominal support for Python 3.4.
- Fixed a bug with using the ``tabledump`` and ``tableload`` functions with
tables containing array columns (columns in which each element is an array
instead of a single scalar value). (Backported from 3.2.3)
- Fixed an issue where PyFITS allowed newline characters in header values and
comments. (Backported from 3.2.3)
- Fixed pickling of ``FITS_rec`` (table data) objects.
(Backported from 3.2.3)
- Improved behavior when writing large compressed images on OSX by removing an
unnecessary check for platform architecture. (Backported from 3.2.3)
- Allow reading FITS files from file-like objects that do not have a
``.closed`` attribute (and as such may not even have an "open" vs. "closed"
concept). (Backported from 3.2.3)
- Fixed minor issue with comparison of header commentary card values.
(Backported from 3.2.3)
3.2.2 (2014-03-25)
------------------
- Fixed a regression on deletion of record-valued keyword cards using
the Header wildcard syntax. This was intended to be fixed before the
v3.2.1 release.
3.1.5 (2014-03-25)
------------------
- Fixed a regression on deletion of record-valued keyword cards using
the Header wildcard syntax. This was intended to be fixed before the
v3.1.4 release.
3.2.1 (2014-03-04)
------------------
- Nominal support for the upcoming Python 3.4.
- Added missing features from the ``Header.insert()`` method that were
intended for inclusion in the original 3.1 release: In addition to
accepting an integer index as the first argument, it also supports supplying
a keyword name as the first argument for insertion relative to a specific
keyword. It also now supports an optional ``after`` argument. If
``after=True`` the insertion is made below the insertion point instead
of above it. (spacetelescope/PyFITS#12)
- Fixed support for broadcasting of values assigned to table columns.
(spacetelescope/PyFITS#48)
- A grab bag of minor performance improvements in headers.
(spacetelescope/PyFITS#46)
- Fix an unrelated error that occurred when instantiating a ``ColDefs`` object
with invalid input.
- Fixed an issue where opening an image containing pseudo-unsigned integers
and immediately writing it to a new file using the ``writeto`` method would
drop the scale factors that identified the data as unsigned.
- Fixed a bug where writing a file with ``checksum=True`` did not add the
checksum on new files. (spacetelescope/PyFITS#8)
- Fixed an issue where validating an HDU's checksums removed the checksum from
that HDU's header entirely (even if it was valid.)
- Fixed checksums on compressed images, so that the ``ZHECKSUM`` and
``ZDATASUM`` contain a checksum of the original image HDU, while
``CHECKSUM`` and ``DATASUM`` contain checksums of the compressed image HDU.
This feature was supposed to be supported in 3.2, but the support was buggy.
- Fixed an issue where the size of the heap was sometimes not computed
properly when writing an existing table containing variable-length array
columns to a new FITS file. This could result in corruption in the new FITS
file. (spacetelescope/PyFITS#47)
- Fixed issue with updates to the header of ``CompImageHDU`` objects not being
preserved on save. (spacetelescope/PyFITS#23)
- Fixed a bug where a boolean value of ``True`` in a header could not be
replaced with the integer 1, and likewise for ``False`` and 0 and vice
versa.
- Fixed an issue similar to the above one but for numeric values--now
replacing a header value with an equivalent numeric value will up/downcast
that value. For example replacing '0' with '0.0' will write '0.0' to the
header so that it is returned as a floating point value. Likewise a float
can be downcast to an integer. (spacetelescope/PyFITS#49)
- A handful of Python 3 compatibility fixes, especially for compatibility
with the upcoming Python 3.4.
- Fixed unrelated crash when a header contains an invalid END card (for
example "END = "). This resulted in a cryptic traceback. Now headers like
this will detect "clearly intended" END cards and produce a warning about
their invalidity and fix them. (#217)
- Allowed a sequence of ``Column`` objects to be passed in as the main
argument to ``FITS_rec.from_columns`` as the documentation suggests should
be possible.
- Fixed a display formatting issue with fitsdiff where sometimes it did not
show the difference between two floating point numbers if they were the same
up to some low number of digits. (spacetelescope/PyFITS#21)
- Fixed an issue where Python 2 sometimes allowed non-ASCII strings to be
assigned as header values if they were assigned as old-style ``str`` objects
and not ``unicode`` objects. (spacetelescope/PyFITS#37)
3.1.4 (2014-03-04)
------------------
- Added missing features from the ``Header.insert()`` method that were
intended for inclusion in the original 3.1 release: In addition to
accepting an integer index as the first argument, it also supports supplying
a keyword name as the first argument for insertion relative to a specific
keyword. It also now supports an optional ``after`` argument. If
``after=True`` the insertion is made below the insertion point instead
of above it. (Backported from 3.2.1)
- A grab bag of minor performance improvements in headers.
(Backported from 3.2.1)
- Fixed an issue where opening an image containing pseudo-unsigned integers
and immediately writing it to a new file using the ``writeto`` method would
drop the scale factors that identified the data as unsigned.
(Backported from 3.2.1)
- Fixed a bug where writing a file with ``checksum=True`` did not add the
checksum on new files. (Backported from 3.2.1)
- Fixed an issue where validating an HDU's checksums removed the checksum from
that HDU's header entirely (even if it was valid.)
(Backported from 3.2.1)
- Fixed an issue where the size of the heap was sometimes not computed
properly when writing an existing table containing variable-length array
columns to a new FITS file. This could result in corruption in the new FITS
file. (Backported from 3.2.1)
- Fixed a bug where a boolean value of ``True`` in a header could not be
replaced with the integer 1, and likewise for ``False`` and 0 and vice
versa. (Backported from 3.2.1)
- Fixed an issue similar to the above one but for numeric values--now
replacing a header value with an equivalent numeric value will up/downcast
that value. For example replacing '0' with '0.0' will write '0.0' to the
header so that it is returned as a floating point value. Likewise a float
can be downcast to an integer. (Backported from 3.2.1)
- Fixed unrelated crash when a header contains an invalid END card (for
example "END = "). This resulted in a cryptic traceback. Now headers like
this will detect "clearly intended" END cards and produce a warning about
their invalidity and fix them. (Backported from 3.2.1)
- Fixed a display formatting issue with fitsdiff where sometimes it did not
show the difference between two floating point numbers if they were the same
up to some low number of digits. (Backported from 3.2.1)
- Fixed an issue where Python 2 sometimes allowed non-ASCII strings to be
assigned as header values if they were assigned as old-style ``str`` objects
and not ``unicode`` objects. (Backported from 3.2.1)
3.0.13 (2014-03-04)
-------------------
- Fixed a bug where writing a file with ``checksum=True`` did not add the
checksum on new files. (Backported from 3.2.1)
- Fixed an issue where validating an HDU's checksums removed the checksum from
that HDU's header entirely (even if it was valid.)
(Backported from 3.2.1)
3.2 (2013-11-26)
----------------
Highlights
^^^^^^^^^^
- Rewrote CFITSIO-based backend for handling tile compression of FITS files.
It now uses a standard CFITSIO instead of heavily modified pieces of CFITSIO
as before. PyFITS ships with its own copy of CFITSIO v3.35 which supports
the latest version of the Tiled Image Convention (v2.3), but system
packagers may choose instead to strip this out in favor of a
system-installed version of CFITSIO. Earlier versions may work, but nothing
earlier than 3.28 has been tested yet. (#169)
- Added support for reading and writing tables using the Q format for columns.
The Q format is identical to the P format (variable-length arrays) except
that it uses 64-bit integers for the data descriptors, allowing more than
4 GB of variable-length array data in a single table. (#160)
- Added initial support for table columns containing pseudo-unsigned integers.
This is currently enabled by using the ``uint=True`` option when opening
files; any table columns with the correct BZERO value will be interpreted
and returned as arrays of unsigned integers.
- Some refactoring of the table and ``FITS_rec`` modules in order to better
separate the details of the FITS binary and ASCII table data structures from
the HDU data structures that encapsulate them. Most of these changes should
not be apparent to users (but see API Changes below).
API Changes
^^^^^^^^^^^
- Assigning to values in ``ColDefs.names``, ``ColDefs.formats``,
``ColDefs.nulls`` and other attributes of ``ColDefs`` instances that return
lists of column properties is no longer supported. Assigning to those lists
will no longer update the corresponding columns. Instead, please just
modify the ``Column`` instances directly (``Column.name``, ``Column.null``,
etc.)
- The ``pyfits.new_table`` function is marked "pending deprecation". This
does not mean it will be removed outright or that its functionality has
changed. It will likely be replaced in the future for a function with
similar, if not subtly different functionality. A better, if not slightly
more verbose approach is to use ``pyfits.FITS_rec.from_columns`` to create
a new ``FITS_rec`` table--this has the same interface as
``pyfits.new_table``. The difference is that it returns a plan ``FITS_rec``
array, and not an HDU instance. This ``FITS_rec`` object can then be used
as the data argument in the constructors for ``BinTableHDU`` (for binary
tables) or ``TableHDU`` (for ASCII tables). This is analogous to creating
an ``ImageHDU`` by passing in an image array.
``pyfits.FITS_rec.from_columns`` is just a simpler way of creating a
FITS-compatible recarray from a FITS column specification.
- The ``updateHeader``, ``updateHeaderData``, and ``updateCompressedData``
methods of the ``CompDataHDU`` class are pending deprecation and moved to
internal methods. The operation of these methods depended too much on
internal state to be used safely by users; instead they are invoked
automatically in the appropriate places when reading/writing compressed image
HDUs.
- The ``CompDataHDU.compData`` attribute is pending deprecation in favor of
the clearer and more PEP-8 compatible ``CompDataHDU.compressed_data``.
- The constructor for ``CompDataHDU`` has been changed to accept new keyword
arguments. The new keyword arguments are essentially the same, but are in
underscore_separated format rather than camelCase format. The old arguments
are still pending deprecation.
- The internal attributes of HDU classes ``_hdrLoc``, ``_datLoc``, and
``_datSpan`` have been replaced with ``_header_offset``, ``_data_offset``,
and ``_data_size`` respectively. The old attribute names are still pending
deprecation. This should only be of interest to advanced users who have
created their own HDU subclasses.
- The following previously deprecated functions and methods have been removed
entirely: ``createCard``, ``createCardFromString``, ``upperKey``,
``ColDefs.data``, ``setExtensionNameCaseSensitive``, ``_File.getfile``,
``_TableBaseHDU.get_coldefs``, ``Header.has_key``, ``Header.ascardlist``.
If you run your code with a previous version of PyFITS (>= 3.0, < 3.2) with
the ``python -Wd`` argument, warnings for all deprecated interfaces still in
use will be displayed.
- Interfaces that were pending deprecation are now fully deprecated. These
include: ``create_card``, ``create_card_from_string``, ``upper_key``,
``Header.get_history``, and ``Header.get_comment``.
- The ``.name`` attribute on HDUs is now directly tied to the HDU's header, so
that if ``.header['EXTNAME']`` changes so does ``.name`` and vice-versa.
- The ``pyfits.file.PYTHON_MODES`` constant dict was renamed to
``pyfits.file.PYFITS_MODES`` which better reflects its purpose. This is
rarely used by client code, however. Support for the old name will be
removed by PyFITS 3.4.
Other Changes and Additions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- The new compression code also adds support for the ZQUANTIZ and ZDITHER0
keywords added in more recent versions of this FITS Tile Compression spec.
This includes support for lossless compression with GZIP. (#198) By default
no dithering is used, but the ``SUBTRACTIVE_DITHER_1`` and
``SUBTRACTIVE_DITHER_2`` methods can be enabled by passing the correct
constants to the ``quantize_method`` argument to the ``CompImageHDU``
constructor. A seed can be manually specified, or automatically generated
using either the system clock or checksum-based methods via the
``dither_seed`` argument. See the documentation for ``CompImageHDU`` for
more details. (#198) (spacetelescope/PYFITS#32)
- Images compressed with the Tile Compression standard can now be larger than
4 GB through support of the Q format. (#159)
- All HDUs now have a ``.ver`` ``.level`` attribute that returns the value of
the EXTVAL and EXTLEVEL keywords from that HDU's header, if the exist. This
was added for consistency with the ``.name`` attribute which returns the
EXTNAME value from the header.
- Then ``Column`` and ``ColDefs`` classes have new ``.dtype`` attributes
which give the Numpy dtype for the column data in the first case, and the
full Numpy compound dtype for each table row in the latter case.
- There was an issue where new tables created defaulted the values in all
string columns to '0.0'. Now string columns are filled with empty strings
by default--this seems a less surprising default, but it may cause
differences with tables created with older versions of PyFITS.
- Improved round-tripping and preservation of manually assigned column
attributes (``TNULLn``, ``TSCALn``, etc.) in table HDU headers.
(astropy/astropy#996)
Bug Fixes
^^^^^^^^^
- Binary tables containing compressed images may, optionally, contain other
columns unrelated to the tile compression convention. Although this is an
uncommon use case, it is permitted by the standard. (#159)
- Reworked some of the file I/O routines to allow simpler, more consistent
mapping between OS-level file modes ('rb', 'wb', 'ab', etc.) and the more
"PyFITS-specific" modes used by PyFITS like "readonly" and "update".
That is, if reading a FITS file from an open file object, it doesn't matter
as much what "mode" it was opened in so long as it has the right
capabilities (read/write/etc.) Also works around bugs in the Python io
module in 2.6+ with regard to file modes. (spacetelescope/PyFITS#33)
- Fixed an obscure issue that can occur on systems that don't have flush to
memory-mapped files implemented (namely GNU Hurd). (astropy/astropy#968)
3.1.3 (2013-11-26)
------------------
- Disallowed assigning NaN and Inf floating point values as header values,
since the FITS standard does not define a way to represent them in. Because
this is undefined, the previous behavior did not make sense and produced
invalid FITS files. (spacetelescope/PyFITS#11)
- Added a workaround for a bug in 64-bit OSX that could cause truncation when
writing files greater than 2^32 bytes in size. (spacetelescope/PyFITS#28)
- Fixed a long-standing issue where writing binary tables did not correctly
write the TFORMn keywords for variable-length array columns (they ommitted
the max array length parameter of the format). This was thought fixed in
v3.1.2, but it was only fixed there for compressed image HDUs and not for
binary tables in general.
- Fixed an obscure issue that can occur on systems that don't have flush to
memory-mapped files implemented (namely GNU Hurd). (Backported from 3.2)
3.0.12 (2013-11-26)
-------------------
- Disallowed assigning NaN and Inf floating point values as header values,
since the FITS standard does not define a way to represent them in. Because
this is undefined, the previous behavior did not make sense and produced
invalid FITS files. (Backported from 3.1.3)
- Added a workaround for a bug in 64-bit OSX that could cause truncation when
writing files greater than 2^32 bytes in size. (Backported from 3.1.3)
- Fixed a long-standing issue where writing binary tables did not correctly
write the TFORMn keywords for variable-length array columns (they ommitted
the max array length parameter of the format). This was thought fixed in
v3.1.2, but it was only fixed there for compressed image HDUs and not for
binary tables in general. (Backported from 3.1.3)
- Fixed an obscure issue that can occur on systems that don't have flush to
memory-mapped files implemented (namely GNU Hurd). (Backported from 3.2)
3.1.2 (2013-04-22)
------------------
- When an error occurs opening a file in fitsdiff the exception message will
now at least mention which file had the error. (#168)
- Fixed support for opening gzipped FITS files by filename in a writeable mode
(PyFITS has supported writing to gzip files for some time now, but only
enabled it when GzipFile objects were passed to ``pyfits.open()`` due to
some legacy code preventing full gzip support. (#195)
- Added a more helpful error message in the case of malformatted FITS files
that contain non-float NULL values in an ASCII table but are missing the
required TNULLn keywords in the header. (#197)
- Fixed an (apparently long-standing) issue where writing compressed images
did not correctly write the TFORMn keywords for variable-length array
columns (they ommitted the max array length parameter of the format). (#199)
- Slightly refactored how tables containing variable-length array columns are
handled to add two improvements: Fixes an issue where accessing the data
after a call to the ``pyfits.getdata`` convenience function caused an
exception, and allows the VLA data to be read from an existing mmap of the
FITS file. (#200)
- Fixed a bug that could occur when opening a table containing
multi-dimensional columns (i.e. via the TDIMn keyword) and then writing it
out to a new file. (#201)
- Added use of the console_scripts entry point to install the fitsdiff and
fitscheck scripts, which if nothing else provides better Windows support.
The generated scripts now override the ones explicitly defined in the
scripts/ directory (which were just trivial stubs to begin with). (#202)
- Fixed a bug on Python 3 where attempting to open a non-existent file on
Python 3 caused a seemingly unrelated traceback. (#203)
- Fixed a bug in fitsdiff that reported two header keywords containing NaN
as value as different. (#204)
- Fixed an issue in the tests that caused some tests to fail if pyfits is
installed with read-only permissions. (#208)
- Fixed a bug where instantiating a ``BinTableHDU`` from a numpy array
containing boolean fields converted all the values to ``False``. (#215)
- Fixed an issue where passing an array of integers into the constructor of
``Column()`` when the column type is floats of the same byte width caused the
column array to become garbled. (#218)
- Fixed inconsistent behavior in creating CONTINUE cards from byte strings
versus unicode strings in Python 2--CONTINUE cards can now be created
properly from unicode strings (so long as they are convertable to ASCII).
(spacetelescope/PyFITS#1)
- Fixed a couple cases where creating a new table using TDIMn in some of the
columns could caused a crash. (spacetelescope/PyFITS#3)
- Fixed a bug in parsing HIERARCH keywords that do not have a space after
the first equals sign (before the value). (spacetelescope/PyFITS#5)
- Prevented extra leading whitespace on HIERARCH keywords from being treated
as part of the keyword. (spacetelescope/PyFITS#6)
- Fixed a bug where HIERARCH keywords containing lower-case letters was
mistakenly marked as invalid during header validation.
(spacetelescope/PyFITS#7)
- Fixed an issue that was ancillary to (spacetelescope/PyFITS#7) where the
``Header.index()`` method did not work correctly with HIERARCH keywords
containing lower-case letters.
3.0.11 (2013-04-17)
-------------------
- Fixed support for opening gzipped FITS files by filename in a writeable mode
(PyFITS has supported writing to gzip files for some time now, but only
enabled it when GzipFile objects were passed to ``pyfits.open()`` due to
some legacy code preventing full gzip support. Backported from 3.1.2. (#195)
- Added a more helpful error message in the case of malformatted FITS files
that contain non-float NULL values in an ASCII table but are missing the
required TNULLn keywords in the header. Backported from 3.1.2. (#197)
- Fixed an (apparently long-standing) issue where writing compressed images did
not correctly write the TFORMn keywords for variable-length array columns
(they ommitted the max array length parameter of the format). Backported from
3.1.2. (#199)
- Slightly refactored how tables containing variable-length array columns are
handled to add two improvements: Fixes an issue where accessing the data
after a call to the ``pyfits.getdata`` convenience function caused an
exception, and allows the VLA data to be read from an existing mmap of the
FITS file. Backported from 3.1.2. (#200)
- Fixed a bug that could occur when opening a table containing
multi-dimensional columns (i.e. via the TDIMn keyword) and then writing it
out to a new file. Backported from 3.1.2. (#201)
- Fixed a bug on Python 3 where attempting to open a non-existent file on
Python 3 caused a seemingly unrelated traceback. Backported from 3.1.2.
(#203)
- Fixed a bug in fitsdiff that reported two header keywords containing NaN
as value as different. Backported from 3.1.2. (#204)
- Fixed an issue in the tests that caused some tests to fail if pyfits is
installed with read-only permissions. Backported from 3.1.2. (#208)
- Fixed a bug where instantiating a ``BinTableHDU`` from a numpy array
containing boolean fields converted all the values to ``False``. Backported
from 3.1.2. (#215)
- Fixed an issue where passing an array of integers into the constructor of
``Column()`` when the column type is floats of the same byte width caused the
column array to become garbled. Backported from 3.1.2. (#218)
- Fixed a couple cases where creating a new table using TDIMn in some of the
columns could caused a crash. Backported from 3.1.2.
(spacetelescope/PyFITS#3)
3.1.1 (2013-01-02)
------------------
This is a bug fix release for the 3.1.x series.
Bug Fixes
^^^^^^^^^
- Improved handling of scaled images and pseudo-unsigned integer images in
compressed image HDUs. They now work more transparently like normal image
HDUs with support for the ``do_not_scale_image_data`` and ``uint`` options,
as well as ``scale_back`` and ``save_backup``. The ``.scale()`` method
works better too. (#88)
- Permits non-string values for the EXTNAME keyword when reading in a file,
rather than throwing an exception due to the malformatting. Added
verification for the format of the EXTNAME keyword when writing. (#96)
- Added support for EXTNAME and EXTVER in PRIMARY HDUs. That is, if EXTNAME
is specified in the header, it will also be reflected in the ``.name``
attribute and in ``pyfits.info()``. These keywords used to be verboten in
PRIMARY HDUs, but the latest version of the FITS standard allows them.
(#151)
- HCOMPRESS can again be used to compress data cubes (and higher-dimensional
arrays) so long as the tile size is effectively 2-dimensional. In fact,
PyFITS will automatically use compatible tile sizes even if they're not
explicitly specified. (#171)
- Added support for the optional ``endcard`` parameter in the
``Header.fromtextfile()`` and ``Header.totextfile()`` methods. Although
``endcard=False`` was a reasonable default assumption, there are still text
dumps of FITS headers that include the END card, so this should have been
more flexible. (#176)
- Fixed a crash when running fitsdiff on two empty (that is, zero row) tables.
(#178)
- Fixed an issue where opening files containing random groups HDUs in update
mode could cause an unnecessary rewrite of the file even if none of the
data is modified. (#179)
- Fixed a bug that could caused a deadlock in the filesystem on OSX if PyFITS
is used with Numpy 1.7 in some cases. (#180)
- Fixed a crash when generating diff reports from diffs using the
``ignore_comments`` options. (#181)
- Fixed some bugs with FITS WCS distortion paper record-valued keyword cards:
- Cards that looked kind of like RVKCs but were not intended to be were
over-permissively treated as such--commentary keywords like COMMENT and
HISTORY were particularly affected. (#183)
- Looking up a card in a header by its standard FITS keyword only should
always return the raw value of that card. That way cards containing
values that happen to valid RVKCs but were not intended to be will still
be treated like normal cards. (#184)
- Looking up a RVKC in a header with only part of the field-specifier (for
example "DP1.AXIS" instead of "DP1.AXIS.1") was implicitly treated as a
wildcard lookup. (#184)
- Fixed a crash when diffing two FITS files where at least one contains a
compressed image HDU which was not recognized as an image instead of a
table. (#187)
- Fixed bugs in the backwards compatibility layer for the ``CardList.index``
and ``CardList.count`` methods. (#190)
- Improved ``__repr__`` and text file representation of cards with long values
that are split into CONTINUE cards. (#193)
- Fixed a crash when trying to assign a long (> 72 character) value to blank
('') keywords. This also changed how blank keywords are represented--there
are still exactly 8 spaces before any commentary content can begin; this
*may* affect the exact display of header cards that assumed there could be
fewer spaces in a blank keyword card before the content begins. However, the
current approach is more in line with the requirements of the FITS standard.
(#194)