-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fc88f7b
Showing
134 changed files
with
22,388 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: b922d7da3a1aaca6704d4e9ce9e416ce | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>astrodata — astrodata 3.2.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=4f649999" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=039e1c02" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=eafc0fe6" /> | ||
<script src="../_static/documentation_options.js?v=4f6ddb47"></script> | ||
<script src="../_static/doctools.js?v=888ff710"></script> | ||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
|
||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" /> | ||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> | ||
|
||
</head><body> | ||
|
||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
|
||
|
||
<div class="body" role="main"> | ||
|
||
<h1>Source code for astrodata</h1><div class="highlight"><pre> | ||
<span></span><span class="sd">"""This package adds an abstraction layer to astronomical data by parsing the</span> | ||
<span class="sd">information contained in the headers as attributes. To do so, one must subclass</span> | ||
<span class="sd">:class:`astrodata.AstroData` and add parse methods accordingly to the</span> | ||
<span class="sd">:class:`~astrodata.TagSet` received.</span> | ||
|
||
<span class="sd">"""</span> | ||
<span class="kn">from</span> <span class="nn">.core</span> <span class="kn">import</span> <span class="n">AstroData</span> | ||
<span class="kn">from</span> <span class="nn">.factory</span> <span class="kn">import</span> <span class="n">AstroDataFactory</span><span class="p">,</span> <span class="n">AstroDataError</span> | ||
<span class="kn">from</span> <span class="nn">.fits</span> <span class="kn">import</span> <span class="n">add_header_to_table</span> | ||
<span class="kn">from</span> <span class="nn">.nddata</span> <span class="kn">import</span> <span class="n">NDAstroData</span><span class="p">,</span> <span class="n">AstroDataMixin</span> | ||
<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="p">(</span> | ||
<span class="n">Section</span><span class="p">,</span> | ||
<span class="n">TagSet</span><span class="p">,</span> | ||
<span class="n">astro_data_descriptor</span><span class="p">,</span> | ||
<span class="n">astro_data_tag</span><span class="p">,</span> | ||
<span class="n">returns_list</span><span class="p">,</span> | ||
<span class="n">deprecated</span><span class="p">,</span> | ||
<span class="p">)</span> | ||
<span class="kn">from</span> <span class="nn">._version</span> <span class="kn">import</span> <span class="n">version</span> | ||
|
||
<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span> | ||
<span class="s2">"AstroData"</span><span class="p">,</span> | ||
<span class="s2">"AstroDataError"</span><span class="p">,</span> | ||
<span class="s2">"AstroDataMixin"</span><span class="p">,</span> | ||
<span class="s2">"NDAstroData"</span><span class="p">,</span> | ||
<span class="s2">"Section"</span><span class="p">,</span> | ||
<span class="s2">"TagSet"</span><span class="p">,</span> | ||
<span class="s2">"__version__"</span><span class="p">,</span> | ||
<span class="s2">"add_header_to_table"</span><span class="p">,</span> | ||
<span class="s2">"astro_data_descriptor"</span><span class="p">,</span> | ||
<span class="s2">"astro_data_tag"</span><span class="p">,</span> | ||
<span class="s2">"from_file"</span><span class="p">,</span> | ||
<span class="s2">"create"</span><span class="p">,</span> | ||
<span class="s2">"returns_list"</span><span class="p">,</span> | ||
<span class="s2">"version"</span><span class="p">,</span> | ||
<span class="c1"># Below this are deprecated</span> | ||
<span class="s2">"open"</span><span class="p">,</span> | ||
<span class="p">]</span> | ||
|
||
<span class="c1"># Make sure __all__does not have duplicates</span> | ||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">__all__</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">__all__</span><span class="p">)):</span> | ||
<span class="n">duplicates</span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">__all__</span><span class="p">)</span> <span class="k">if</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">__all__</span><span class="p">[:</span><span class="n">i</span><span class="p">]]</span> | ||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Duplicate entries in __all__: </span><span class="si">{</span><span class="s1">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">duplicates</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> | ||
|
||
<span class="n">__version__</span> <span class="o">=</span> <span class="n">version</span><span class="p">()</span> | ||
|
||
<span class="c1"># TODO: This is pretty unacceptable, this makes it impossible to access the</span> | ||
<span class="c1"># factory classes, errors, and methods through any normal means. Which means</span> | ||
<span class="c1"># they are very difficult to write tests for, or to have users work on</span> | ||
<span class="c1"># themselves.</span> | ||
<span class="n">factory</span> <span class="o">=</span> <span class="n">AstroDataFactory</span><span class="p">()</span> | ||
<span class="c1"># Let's make sure that there's at least one class that matches the data</span> | ||
<span class="c1"># (if we're dealing with a FITS file)</span> | ||
<span class="n">factory</span><span class="o">.</span><span class="n">add_class</span><span class="p">(</span><span class="n">AstroData</span><span class="p">)</span> | ||
|
||
|
||
<div class="viewcode-block" id="from_file"> | ||
<a class="viewcode-back" href="../api/astrodata.from_file.html#astrodata.from_file">[docs]</a> | ||
<span class="k">def</span> <span class="nf">from_file</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""Return an |AstroData| object from a file.</span> | ||
|
||
<span class="sd"> For implementation details, see</span> | ||
<span class="sd"> :meth:`~astrodata.AstroDataFactory.get_astro_data`.</span> | ||
<span class="sd"> """</span> | ||
<span class="k">return</span> <span class="n">factory</span><span class="o">.</span><span class="n">get_astro_data</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div> | ||
|
||
|
||
|
||
<div class="viewcode-block" id="create"> | ||
<a class="viewcode-back" href="../api/astrodata.create.html#astrodata.create">[docs]</a> | ||
<span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""Return an |AstroData| object from data.</span> | ||
|
||
<span class="sd"> For implementation details, see</span> | ||
<span class="sd"> :meth:`~astrodata.AstroDataFactory.create_from_scratch`</span> | ||
<span class="sd"> """</span> | ||
<span class="k">return</span> <span class="n">factory</span><span class="o">.</span><span class="n">create_from_scratch</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div> | ||
|
||
|
||
|
||
<span class="c1"># TODO: Need to replace this with a name that doesn't override the builtin.</span> | ||
<span class="c1"># This makes it so that the following will cause unexpected behavior:</span> | ||
<span class="c1"># from astrodata import *</span> | ||
<span class="c1"># file_stream = open("some_file.fits")</span> | ||
<span class="c1"># Without raising a warning or error.</span> | ||
<div class="viewcode-block" id="open"> | ||
<a class="viewcode-back" href="../api/astrodata.open.html#astrodata.open">[docs]</a> | ||
<span class="nd">@deprecated</span><span class="p">(</span> | ||
<span class="s2">"Use 'astrodata.from_file'. astrodata.open is deprecated, "</span> | ||
<span class="s2">"and will be removed in a future version."</span> | ||
<span class="p">)</span> | ||
<span class="k">def</span> <span class="nf">open</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> <span class="c1"># pylint: disable=redefined-builtin</span> | ||
<span class="w"> </span><span class="sd">"""Return an |AstroData| object from a file (deprecated, use</span> | ||
<span class="sd"> :func:`~astrodata.from_file`).</span> | ||
<span class="sd"> """</span> | ||
<span class="k">return</span> <span class="n">from_file</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
|
||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<h1 class="logo"><a href="../index.html">astrodata</a></h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3> | ||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../manuals/index.html">Astrodata Manual</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../api_short.html">Common API for Users</a></li> | ||
</ul> | ||
|
||
<div class="relations"> | ||
<h3>Related Topics</h3> | ||
<ul> | ||
<li><a href="../index.html">Documentation overview</a><ul> | ||
<li><a href="index.html">Module code</a><ul> | ||
</ul></li> | ||
</ul></li> | ||
</ul> | ||
</div> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="footer"> | ||
©2023, . | ||
|
||
| | ||
Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a> | ||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a> | ||
|
||
</div> | ||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>astrodata._version — astrodata 3.2.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=039e1c02" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=eafc0fe6" /> | ||
<script src="../../_static/documentation_options.js?v=4f6ddb47"></script> | ||
<script src="../../_static/doctools.js?v=888ff710"></script> | ||
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
|
||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" /> | ||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> | ||
|
||
</head><body> | ||
|
||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
|
||
|
||
<div class="body" role="main"> | ||
|
||
<h1>Source code for astrodata._version</h1><div class="highlight"><pre> | ||
<span></span><span class="ch">#!/usr/bin/env python</span> | ||
<span class="sd">"""</span> | ||
<span class="sd">Holds the DRAGONS version to be propagated throught all the DRAGONS package</span> | ||
<span class="sd">and to be used in the documentation.</span> | ||
<span class="sd">"""</span> | ||
|
||
<span class="c1"># --- Setup Version Here ---</span> | ||
<span class="n">API</span> <span class="o">=</span> <span class="mi">3</span> | ||
<span class="n">FEATURE</span> <span class="o">=</span> <span class="mi">2</span> | ||
<span class="n">BUG</span> <span class="o">=</span> <span class="mi">0</span> | ||
<span class="n">TAG</span> <span class="o">=</span> <span class="s2">""</span> | ||
|
||
|
||
<div class="viewcode-block" id="version"> | ||
<a class="viewcode-back" href="../../api/astrodata.version.html#astrodata.version">[docs]</a> | ||
<span class="k">def</span> <span class="nf">version</span><span class="p">(</span><span class="n">short</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">tag</span><span class="o">=</span><span class="n">TAG</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Returns DRAGONS's version based on the api,</span> | ||
<span class="sd"> feature and bug numbers.</span> | ||
|
||
<span class="sd"> Returns</span> | ||
<span class="sd"> -------</span> | ||
<span class="sd"> str : formatted version</span> | ||
<span class="sd"> """</span> | ||
|
||
<span class="k">if</span> <span class="n">short</span><span class="p">:</span> | ||
<span class="n">_version</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{:d}</span><span class="s2">.</span><span class="si">{:d}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">API</span><span class="p">,</span> <span class="n">FEATURE</span><span class="p">)</span> | ||
|
||
<span class="k">else</span><span class="p">:</span> | ||
<span class="n">_tag</span> <span class="o">=</span> <span class="s2">"_</span><span class="si">{:s}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">tag</span><span class="p">)</span> <span class="k">if</span> <span class="n">tag</span> <span class="k">else</span> <span class="s2">""</span> | ||
<span class="n">_version</span> <span class="o">=</span> <span class="s2">"</span><span class="si">{:d}</span><span class="s2">.</span><span class="si">{:d}</span><span class="s2">.</span><span class="si">{:d}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">API</span><span class="p">,</span> <span class="n">FEATURE</span><span class="p">,</span> <span class="n">BUG</span><span class="p">)</span> <span class="o">+</span> <span class="n">_tag</span> | ||
|
||
<span class="k">return</span> <span class="n">_version</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
|
||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<h1 class="logo"><a href="../../index.html">astrodata</a></h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3> | ||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../manuals/index.html">Astrodata Manual</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../api_short.html">Common API for Users</a></li> | ||
</ul> | ||
|
||
<div class="relations"> | ||
<h3>Related Topics</h3> | ||
<ul> | ||
<li><a href="../../index.html">Documentation overview</a><ul> | ||
<li><a href="../index.html">Module code</a><ul> | ||
<li><a href="../astrodata.html">astrodata</a><ul> | ||
</ul></li> | ||
</ul></li> | ||
</ul></li> | ||
</ul> | ||
</div> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="footer"> | ||
©2023, . | ||
|
||
| | ||
Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a> | ||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a> | ||
|
||
</div> | ||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.