Metadata-Version: 2.4
Name: sip_tpv
Version: 2.0
Summary: Conversion of distortion representations in FITS headers between SIP and TPV formats.
Author-email: David Shupe <shupe@ipac.caltech.edu>, Austin Beauchamp <austinbeauch@gmail.com>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/stargaser/sip_tpv
Project-URL: Issues, https://github.com/stargaser/sip_tpv/issues
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.11
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: numpy>=1.23.2
Requires-Dist: astropy>=5.2
Requires-Dist: sympy>=1.11
Requires-Dist: click>=8.0
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Dynamic: license-file

=======
sip_tpv
=======

Utilities for converting between the SIP convention for representing distortion
in FITS images, and the TPV convention. Usage may look like::

    from astropy.io import fits
    from sip_tpv import pv_to_sip

    hdulist = fits.open('input.fits')
    for hdu in hdulist:
        pv_to_sip(hdu.header)

(hdulist is a collection of HDU objects)

Command-line tools
==================
Installing the package also provides ``sip_to_pv`` and ``pv_to_sip`` commands
that convert the header of one HDU in a FITS file and write a new file::

    sip_to_pv input_sip.fits output_tpv.fits
    pv_to_sip input_tpv.fits output_sip.fits --extension SCI

``--extension`` takes an HDU index or EXTNAME (default 0). ``pv_to_sip`` also
computes the reverse SIP coefficients (AP/BP); use ``--no-add-reverse`` to skip
them. Run either command with ``--help`` for all options. The underscore
spellings of options used in version 1.x (e.g. ``--preserve_sip``) are still
accepted.

License
=======
Licensed under a 3-clause BSD style license - see LICENSE.txt

This module includes the equations for converting from the SIP distortion representation
to the PV or TPV representations, following the SPIE proceedings paper at
http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=1363103
and http://web.ipac.caltech.edu/staff/shupe/reprints/SIP_to_PV_SPIE2012.pdf .

The work described in that paper is extended to 7th order.

Copyright (c) 2012-2026, California Institute of Technology

If you make use of this work, please cite::

    "More flexibility in representing geometric distortion in astronomical images,"
    Shupe, David L.; Laher, Russ R.; Storrie-Lombardi, Lisa; Surace, Jason; Grillmair, Carl;
    Levitan, David; Sesar, Branimir, 2012, in Software and Cyberinfrastructure for
    Astronomy II. Proceedings of the SPIE, Volume 8451, article id. 84511M.

Contributors
============
* David Shupe, IPAC/Caltech (shupe@ipac.caltech.edu)
* Austin Beauchamp (austinbeauch@gmail.com)

Thanks also to
--------------
* Thanks to Octavi Fors for contributing code modifications for better modularization, and for extensive testing.
* Funding is acknowledged from NASA to the NASA Herschel Science Center and the
  Spitzer Science Center.
