<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>pixtosky: Coordinate transformation to sky coordinates — drizzlepac 1.1.8(06-Feb-2013) documentation</title> <link rel="stylesheet" href="_static/stsci_sphinx.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '1.1.8(06-Feb-2013)', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="drizzlepac 1.1.8(06-Feb-2013) documentation" href="index.html" /> <link rel="next" title="skytopix: Coordinate transformation from sky coordinates" href="skytopix.html" /> <link rel="prev" title="pixtopix: Coordinate transformation to/from drizzled images" href="pixtopix.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="skytopix.html" title="skytopix: Coordinate transformation from sky coordinates" accesskey="N">next</a> |</li> <li class="right" > <a href="pixtopix.html" title="pixtopix: Coordinate transformation to/from drizzled images" accesskey="P">previous</a> |</li> <li><a href="index.html">drizzlepac 1.1.8(06-Feb-2013) documentation</a> »</li> </ul> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="index.html"> <img class="logo" src="_static/stsci_logo.png" alt="Logo"/> </a></p> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">pixtosky: Coordinate transformation to sky coordinates</a><ul> <li><a class="reference internal" href="#parameters">PARAMETERS</a></li> <li><a class="reference internal" href="#optional-parameters">Optional Parameters</a></li> <li><a class="reference internal" href="#returns">RETURNS</a></li> <li><a class="reference internal" href="#notes">NOTES</a></li> <li><a class="reference internal" href="#usage">Usage</a></li> <li><a class="reference internal" href="#examples">EXAMPLES</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="pixtopix.html" title="previous chapter">pixtopix: Coordinate transformation to/from drizzled images</a></p> <h4>Next topic</h4> <p class="topless"><a href="skytopix.html" title="next chapter">skytopix: Coordinate transformation from sky coordinates</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/pixtosky.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="pixtosky-coordinate-transformation-to-sky-coordinates"> <span id="pixtosky"></span><h1>pixtosky: Coordinate transformation to sky coordinates<a class="headerlink" href="#pixtosky-coordinate-transformation-to-sky-coordinates" title="Permalink to this headline">¶</a></h1> <p>This task allows a user to perform coordinate transformations with the full WCS and distortion model on source positions from an input image to sky coordinates. This task serves as a replacement for the IRAF.STSDAS task ‘xy2rd’, albeit with the added capability of understanding the full distortion model provided in the headers of images updated for use with astrodrizzle and tweakreg.</p> <span class="target" id="module-drizzlepac.pixtosky"></span><p>pixtosky - A module to perform coordinate transformation from pixel to sky coordinates.</p> <dl class="docutils"> <dt>License:</dt> <dd><a class="reference external" href="http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE">http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE</a></dd> </dl> <div class="section" id="parameters"> <h2>PARAMETERS<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2> <dl class="docutils"> <dt>input <span class="classifier-delimiter">:</span> <span class="classifier">str</span></dt> <dd>full filename with path of input image, an extension name [‘sci’,1] should be provided if input is a multi-extension FITS file</dd> </dl> </div> <div class="section" id="optional-parameters"> <h2>Optional Parameters<a class="headerlink" href="#optional-parameters" title="Permalink to this headline">¶</a></h2> <dl class="docutils"> <dt>x <span class="classifier-delimiter">:</span> <span class="classifier">float, optional</span></dt> <dd>X position from input image</dd> <dt>y <span class="classifier-delimiter">:</span> <span class="classifier">float, optional</span></dt> <dd>Y position from input image</dd> <dt>coords <span class="classifier-delimiter">:</span> <span class="classifier">str, optional</span></dt> <dd>full filename with path of file with x,y coordinates</dd> <dt>colnames <span class="classifier-delimiter">:</span> <span class="classifier">str, optional</span></dt> <dd>comma separated list of column names from ‘coords’ files containing x,y coordinates, respectively. Will default to first two columns if None are specified. Column names for ASCII files will use ‘c1’,’c2’,... convention.</dd> <dt>separator <span class="classifier-delimiter">:</span> <span class="classifier">str, optional</span></dt> <dd>non-blank separator used as the column delimiter in the coords file</dd> <dt>hms <span class="classifier-delimiter">:</span> <span class="classifier">bool, optional</span></dt> <dd>Produce output in HH:MM:SS.S format instead of decimal degrees? (default: False)</dd> <dt>precision <span class="classifier-delimiter">:</span> <span class="classifier">int, optional</span></dt> <dd>Number of floating-point digits in output values</dd> <dt>output <span class="classifier-delimiter">:</span> <span class="classifier">str, optional</span></dt> <dd>Name of output file with results, if desired</dd> <dt>verbose <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt> <dd>Print out full list of transformation results (default: False)</dd> </dl> </div> <div class="section" id="returns"> <h2>RETURNS<a class="headerlink" href="#returns" title="Permalink to this headline">¶</a></h2> <dl class="docutils"> <dt>ra <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt> <dd>Right Ascension of pixel. If more than 1 input value, then it will be a numpy array.</dd> <dt>dec <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt> <dd>Declination of pixel. If more than 1 input value, then it will be a numpy array.</dd> </dl> </div> <div class="section" id="notes"> <h2>NOTES<a class="headerlink" href="#notes" title="Permalink to this headline">¶</a></h2> <p>This module performs a full distortion-corrected coordinate transformation based on all WCS keywords and any recognized distortion keywords from the input image header.</p> </div> <div class="section" id="usage"> <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2> <p>It can be called from within Python using the syntax:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">drizzlepac</span> <span class="kn">import</span> <span class="n">pixtosky</span> <span class="gp">>>> </span><span class="n">r</span><span class="p">,</span><span class="n">d</span> <span class="o">=</span> <span class="n">pixtosky</span><span class="o">.</span><span class="n">xy2rd</span><span class="p">(</span><span class="s">"input_flt.fits[sci,1]"</span><span class="p">,</span><span class="mi">100</span><span class="p">,</span><span class="mi">100</span><span class="p">)</span> </pre></div> </div> </div> <div class="section" id="examples"> <h2>EXAMPLES<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> <ol class="arabic"> <li><dl class="first docutils"> <dt>The following command will transform the position 256,256 into a</dt> <dd><p class="first">position on the sky for the image ‘input_flt.fits[sci,1]’ using:</p> <div class="last highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">drizzlepac</span> <span class="kn">import</span> <span class="n">pixtosky</span> <span class="gp">>>> </span><span class="n">r</span><span class="p">,</span><span class="n">d</span> <span class="o">=</span> <span class="n">pixtosky</span><span class="o">.</span><span class="n">xy2rd</span><span class="p">(</span><span class="s">"input_file_flt.fits[sci,1]"</span><span class="p">,</span> <span class="mi">256</span><span class="p">,</span><span class="mi">256</span><span class="p">)</span> </pre></div> </div> </dd> </dl> </li> <li><dl class="first docutils"> <dt>The set of X,Y positions from ‘input_flt.fits[sci,1]’ stored as</dt> <dd><p class="first">the 3rd and 4th columns from the ASCII file ‘xy_sci1.dat’ will be transformed and written out to ‘radec_sci1.dat’ using:</p> <div class="last highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">drizzlepac</span> <span class="kn">import</span> <span class="n">pixtosky</span> <span class="gp">>>> </span><span class="n">r</span><span class="p">,</span><span class="n">d</span> <span class="o">=</span> <span class="n">pixtosky</span><span class="o">.</span><span class="n">xy2rd</span><span class="p">(</span><span class="s">"input_flt.fits[sci,1]"</span><span class="p">,</span> <span class="n">coords</span><span class="o">=</span><span class="s">'xy_sci1.dat'</span><span class="p">,</span> <span class="go"> colnames=['c3','c4'], output="radec_sci1.dat")</span> </pre></div> </div> </dd> </dl> </li> </ol> </div> <dl class="function"> <dt id="drizzlepac.pixtosky.xy2rd"> <tt class="descclassname">drizzlepac.pixtosky.</tt><tt class="descname">xy2rd</tt><big>(</big><em>input</em>, <em>x=None</em>, <em>y=None</em>, <em>coords=None</em>, <em>colnames=None</em>, <em>separator=None</em>, <em>hms=True</em>, <em>precision=6</em>, <em>output=None</em>, <em>verbose=True</em><big>)</big><a class="headerlink" href="#drizzlepac.pixtosky.xy2rd" title="Permalink to this definition">¶</a></dt> <dd><p>Primary interface to perform coordinate transformations from pixel to sky coordinates using STWCS and full distortion models read from the input image header.</p> </dd></dl> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="skytopix.html" title="skytopix: Coordinate transformation from sky coordinates" >next</a> |</li> <li class="right" > <a href="pixtopix.html" title="pixtopix: Coordinate transformation to/from drizzled images" >previous</a> |</li> <li><a href="index.html">drizzlepac 1.1.8(06-Feb-2013) documentation</a> »</li> </ul> </div> <div class="footer"> © Copyright 2012, Warren Hack, Nadia Dencheva, Chris Sontag, Megan Sosey, Michael Droettboom. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. </div> </body> </html>