summaryrefslogtreecommitdiff
path: root/lib/stwcs/wcsutil/headerlet.py
Commit message (Collapse)AuthorAgeFilesLines
* restructure and add stwcs testsNadia Dencheva2016-08-041-2754/+0
|
* Fixed problems with python 2 to 3 conversionbsimon2015-05-211-7/+9
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@40220 fe389314-cf27-0410-b35b-8c050e845b92
* Updated files to run under python 2 and 3bsimon2015-05-041-22/+31
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@39775 fe389314-cf27-0410-b35b-8c050e845b92
* replace deprecateed methodsdencheva2014-05-021-1/+0
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@31371 fe389314-cf27-0410-b35b-8c050e845b92
* fix a typo dencheva2014-05-021-1/+1
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@31370 fe389314-cf27-0410-b35b-8c050e845b92
* further changes to move to astropydencheva2014-05-011-45/+46
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@31270 fe389314-cf27-0410-b35b-8c050e845b92
* deal with pyfits/wcs deprecation wrningsdencheva2014-04-301-5/+5
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@31259 fe389314-cf27-0410-b35b-8c050e845b92
* changes to use astropy instead of pyfits and pywcsdencheva2014-04-281-3/+5
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@31240 fe389314-cf27-0410-b35b-8c050e845b92
* STWCS update to insure that NEXTEND keyword (if already present in primary ↵hack2013-12-301-2/+9
| | | | | | header) remains consistent with full size of FITS file after updates. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@28702 fe389314-cf27-0410-b35b-8c050e845b92
* Fixed a bug introduced in r26987 to the headerlet module that caused ↵hack2013-10-241-8/+9
| | | | | | headerlet.apply_as_primary to fail when the headerlet was created directly using the Headerlet class and an HDUList as input. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26990 fe389314-cf27-0410-b35b-8c050e845b92
* STWCS v1.1.2: This update only includes changes to the headerlet module and ↵hack2013-10-231-26/+91
| | | | | | | | | | | | related TEAL interface modules. The changes include: - Fix calls to PyFITS 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. (Ticket #1063) The docstrings for all updated headerlet functions were updated to reflect the new input capabilities. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26987 fe389314-cf27-0410-b35b-8c050e845b92
* Interface with 'new' PyFITS (>v3.1.x) and its writeto() method were ↵hack2013-10-171-16/+38
| | | | | | corrected with this change. This allows the Headerlet class to work again to create new headerlets. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26877 fe389314-cf27-0410-b35b-8c050e845b92
* Problems with using apply_headerlet_as_primary() on WFPC2 data have been ↵hack2013-08-281-2/+5
| | | | | | corrected in this revision. These included counting the D2IM arrays correctly and eliminating a typo for a variable. These changes were tested using both a WFPC2 image and the same ACS image that demonstrated the previous bug. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26500 fe389314-cf27-0410-b35b-8c050e845b92
* The apply_as_primary() method of the Headerlet class was revised to look for ↵hack2013-08-271-5/+8
| | | | | | | | | the correct WCSDVARR (and D2IMARR) extensions from the headerlet. This finished the process where the PyWCS generated object was updated to include the image-specific EXTVER values for each of the WCSDVARR and D2IMARR extensions. These changes were successfully tested (manually) on the regression test case where the problem was first reproduced after being alerted to this problem by Shireen when trying to document the apply_headerlet_as_primary() function. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26499 fe389314-cf27-0410-b35b-8c050e845b92
* Replace hdu._extver' with 'ext.ver' because of changes to pyfits' API.dencheva2013-08-121-67/+67
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@26284 fe389314-cf27-0410-b35b-8c050e845b92
* When creating a WCS object with NPOl or D2IM correction Pywcs does not keep ↵dencheva2013-04-111-5/+20
| | | | | | track of DPi.EXTVER of the lookup table. In order to recover this information a create_headerlet looks at the header of the science file. However, in the case of a science file with 'old style' D2IM format these keywords are not used , so when writing out headerlets for such file, create_headerlet converts them to the 'new style' and makes up the values for the D2IMi.EXTVER keywords. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@24211 fe389314-cf27-0410-b35b-8c050e845b92
* fix bugs in headerlet related to d2im correctiondencheva2013-03-191-32/+22
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@23830 fe389314-cf27-0410-b35b-8c050e845b92
* Merging d2im changes into trunkdencheva2013-03-181-20/+35
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@23819 fe389314-cf27-0410-b35b-8c050e845b92
* Adding a WCS diff function to the packagedencheva2013-01-081-136/+0
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@21420 fe389314-cf27-0410-b35b-8c050e845b92
* fix docstring indentationdencheva2012-10-291-121/+124
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@20130 fe389314-cf27-0410-b35b-8c050e845b92
* update docstringsdencheva2012-10-191-10/+25
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@20019 fe389314-cf27-0410-b35b-8c050e845b92
* Make sure CRDER* keywords go into the headerlet and remove RMS* keywords ↵dencheva2012-10-021-4/+8
| | | | | | from primary header git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@19785 fe389314-cf27-0410-b35b-8c050e845b92
* Refactored headerlet code works with pywcs.WCS objects now. Also works iwth ↵dencheva2012-10-011-527/+576
| | | | | | non-HST files git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@19777 fe389314-cf27-0410-b35b-8c050e845b92
* Fixed a problem with headerlet.apply_as_primary that arose from changes from ↵hack2012-06-201-1/+1
| | | | | | | | | r17090 (adding support for simple FITS files) as reported in Ticket #910. This should allow all regression tests for STWCS.WCSUTIL.headerlet to pass, based on the fact that the test now passes when run manually with these changes. This resolves the last of the critical issues for STWCS prior to its release with AstroDrizzle, so the version ID was incremented to 1.0.0 as well. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@17442 fe389314-cf27-0410-b35b-8c050e845b92
* Problems with attaching headerlets to drizzled images in simple FITS format ↵hack2012-05-311-15/+46
| | | | | | have finally been resolved. This included changes to the interpretation of the sciext parameter to write_headerlet and create_headerlet functions to make them more general. It also removed the last(?) explicit reference to 'sci,1' extension. In addition, updates to WCSCORR tables have been turned off when working with drizzled images in simple FITS format. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@17090 fe389314-cf27-0410-b35b-8c050e845b92
* Based on a report by Andy, a bug was fixed in the headerlet code that had ↵hack2012-04-111-4/+6
| | | | | | resulted in duplication of entries in the WCSCORR table when updating an image with a headerlet. The 'attach_to_file' method of the Headerlet class was modified to only update the WCSCORR table upon request, as it gets called by other routines which are already updating WCSCORR. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@16151 fe389314-cf27-0410-b35b-8c050e845b92
* Fixed the last two minor errors in stwcs--these are mainly just typos ↵embray2012-02-271-3/+3
| | | | | | (k.key->c.keyword, and removed stray end of line commas that were causing tuple values to be treated as a 1-tuple containing a tuple. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15287 fe389314-cf27-0410-b35b-8c050e845b92
* Don't assume that there are definitely any HISTORY cards.embray2012-02-241-2/+3
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15285 fe389314-cf27-0410-b35b-8c050e845b92
* Fixes a few more problems with the new Header API encountered in stwcs. ↵embray2012-02-231-11/+13
| | | | | | This fix relies on r1384 from pyfits. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15202 fe389314-cf27-0410-b35b-8c050e845b92
* Should fix most problems in stwcs due to pyfits Header updates. The main ↵embray2012-02-221-110/+111
| | | | | | issue that caused incompatibility is that slices of headers (including by wildcard patterns) now returns a new Header rather than a list of cards. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15198 fe389314-cf27-0410-b35b-8c050e845b92
* This update to STWCS.wcsutil includes the following changes:hack2012-01-261-16/+16
| | | | | | | | | | - removes use of RMS_RA and RMS_Dec in science header WCS keywords in favor of FITS standard keywords CRDER* - add default WCSNAME keyword to header created from .wcs2header() method of HSTWCS if that keyword did not exist in input image header - update WCSCORR table to populate RMS_RA and RMS_Dec columns using CRDER* keywords. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14488 fe389314-cf27-0410-b35b-8c050e845b92
* This update fixes problems with applying a headerlet to an image which has ↵hack2012-01-231-4/+44
| | | | | | not yet been updated with updatewcs. The problems arose from 'DISTNAME' not being present in the header of the image to be updated. The changes were tested using the 'apply_headerlet' user interface (through TEAL) on a WFC3/UVIS image prior to running 'updatewcs.updatewcs()' on it. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14461 fe389314-cf27-0410-b35b-8c050e845b92
* This update fixes some problems with the creation of headerlets from input ↵hack2011-12-161-7/+10
| | | | | | HDUList objects, and should address the issue raised by Ticket #822. Some additional testing, though, will still need to be performed to verify all aspects of #822 are addressed. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14087 fe389314-cf27-0410-b35b-8c050e845b92
* corrected typos, removed extraneous codedencheva2011-12-091-36/+10
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14062 fe389314-cf27-0410-b35b-8c050e845b92
* Update logging to use a decorator to enable logging on individual functions.embray2011-12-091-37/+63
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14061 fe389314-cf27-0410-b35b-8c050e845b92
* Typo fix.embray2011-12-091-69/+69
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14058 fe389314-cf27-0410-b35b-8c050e845b92
* Fix a lot of DeprecationWarnings.embray2011-12-091-20/+20
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14056 fe389314-cf27-0410-b35b-8c050e845b92
* A major overhaul of loggingdencheva2011-12-061-263/+304
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14051 fe389314-cf27-0410-b35b-8c050e845b92
* A minor bug in create_headerlet: setting WCSNAME to the value of HDRNAMEdencheva2011-12-051-1/+8
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14049 fe389314-cf27-0410-b35b-8c050e845b92
* If HDRNAME is not provided, it is set to WCSNAME : write_headerlet, ↵dencheva2011-12-021-21/+7
| | | | | | archive_as_headerlet git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14047 fe389314-cf27-0410-b35b-8c050e845b92
* convert wcskey to upper casedencheva2011-12-021-1/+4
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14046 fe389314-cf27-0410-b35b-8c050e845b92
* more cleaning up codedencheva2011-12-011-14/+16
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14045 fe389314-cf27-0410-b35b-8c050e845b92
* Reworked extract_headerlet to fix:dencheva2011-12-011-11/+19
| | | | | | | | | | | | - Exception should be raised when both extnum and hdrname are None - If both hdrname and extnum are given, check if they match and if not, raise an Exception - use the correct method to write the headerlet to a file; use clobber git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14044 fe389314-cf27-0410-b35b-8c050e845b92
* Added docstringsdencheva2011-12-011-4/+34
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14043 fe389314-cf27-0410-b35b-8c050e845b92
* PEP8 changesdencheva2011-12-011-279/+303
| | | | git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14042 fe389314-cf27-0410-b35b-8c050e845b92
* Updates the HeaderletHDU class to use PyFITS's new FitsHDU class as its base.embray2011-11-081-392/+321
| | | | | | | | | | | | | | | | | | | | | | This works mostly the same way as the old implementation. The differences are as follows: * The headerlet data is no longer needlessly encapsulated in a tar file; instead it's included directly as an embedded FITS file which should work fine for most FITS readers (though most won't know what to do with it, and will just treat it as raw data). * A few new keywords are included in the HeaderletHDU's header--these keywords (the XINDn keywords) give the offsets of each HDU embedded in the HeaderletHDU. Howver, this information is not currently used. * In addition to the `.headerlet` property the `.hdulist` property is provided, which returns the HeaderletHDU's contents as a normal `HDUList` object instead of a `Headerlet` object. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13979 fe389314-cf27-0410-b35b-8c050e845b92
* This revision fixes problems with WCSCORR table updates; specifically, hack2011-11-071-5/+14
| | | | | | | | | | | | | | - added fit keywords (rms*,nmatch,catalog) to SIPWCS header in headerlet for use in updating WCSCORR - changed definition of FIT_KW to get values from SCI header, not PRIMARY - changed calls to finding blank rows to also use rows with wcs_id='0.0' as a blank row. This also required updating the logic to support multiple selection criteria - implemented update of WCSCORR by wcskey value - get FIT keywords from full header, not just HSTWCS header - only update columns which have been defined (for backward compatiblity with WCSCORR tables with columns that have since been removed from the definition) These changes have been tested to insure that the RMS values get updated in the WCSCORR table properly from the SCI image as well as from the headerlet. They also make sure the headerlet gets updated with the correct values. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13971 fe389314-cf27-0410-b35b-8c050e845b92
* The docstrings for 'write_headerlet' and 'extract_headerlet' have been ↵hack2011-11-071-11/+15
| | | | | | updated to reflect the added support for filename input formats provided by 'parseinput'. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13965 fe389314-cf27-0410-b35b-8c050e845b92
* This revision fixes a number of bugs; including:hack2011-11-071-9/+18
| | | | | | | | | | | - added a check to 'output' par value in TEAL interface to 'write_headerlet' - implemented use of 'parseinput' in TEAL interface for 'write_headerlet' - moved 'output' and 'clobber' parameters closer to top of par list in TEAL interface for 'write_headerlet' - implemented use of 'parseinput' to interpret input filename(s) for 'write_headerlet' and 'extract_headerlet' providing support for additional input modes - fixed logic problems with defining output filename in 'write_headerlet' and 'extract_headerlet' git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13964 fe389314-cf27-0410-b35b-8c050e845b92
* Corrected a bug in 'create_headerlet' to provide the extension name in the ↵hack2011-11-061-110/+128
| | | | | | | | | right syntax when calling HSTWCS for the alternate WCS. In addition, implemented support for running 'extract_headerlet' and 'write_headerlet' on a list of input filenames in addition to a single filename or single HDUList. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13962 fe389314-cf27-0410-b35b-8c050e845b92