Skip to content

Commit

Permalink
deploy: 48a77ad
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbhughes committed Oct 17, 2024
1 parent 4842edf commit 33b14ca
Show file tree
Hide file tree
Showing 69 changed files with 2,030 additions and 20 deletions.
1 change: 1 addition & 0 deletions _sources/autoapi/punchbowl/level1/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Submodules
/autoapi/punchbowl/level1/initial_uncertainty/index
/autoapi/punchbowl/level1/psf/index
/autoapi/punchbowl/level1/quartic_fit/index
/autoapi/punchbowl/level1/sqrt/index
/autoapi/punchbowl/level1/stray_light/index
/autoapi/punchbowl/level1/vignette/index

Expand Down
157 changes: 157 additions & 0 deletions _sources/autoapi/punchbowl/level1/sqrt/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
punchbowl.level1.sqrt
=====================

.. py:module:: punchbowl.level1.sqrt
Attributes
----------

.. autoapisummary::

punchbowl.level1.sqrt.TABLE_PATH


Functions
---------

.. autoapisummary::

punchbowl.level1.sqrt.decode_sqrt
punchbowl.level1.sqrt.encode_sqrt
punchbowl.level1.sqrt.decode_sqrt_simple
punchbowl.level1.sqrt.noise_pdf
punchbowl.level1.sqrt.mean_b_offset
punchbowl.level1.sqrt.decode_sqrt_corrected
punchbowl.level1.sqrt.generate_decode_sqrt_table
punchbowl.level1.sqrt.decode_sqrt_by_table
punchbowl.level1.sqrt.decode_sqrt_data


Module Contents
---------------

.. py:data:: TABLE_PATH
.. py:function:: decode_sqrt(data: numpy.ndarray | float, from_bits: int = 16, to_bits: int = 12, ccd_gain: float = 1 / 4.3, ccd_offset: float = 100, ccd_read_noise: float = 17, overwrite_table: bool = False) -> numpy.ndarray
Square root decode between specified bitrate values.

:param data: Input encoded data array
:param from_bits: Specified bitrate of encoded image to unpack
:param to_bits: Specified bitrate of output data (decoded)
:param ccd_gain: CCD gain [photons / DN]
:param ccd_offset: CCD bias level [DN]
:param ccd_read_noise: CCD read noise level [DN]
:param overwrite_table: Toggle to regenerate and overwrite existing decoding table

:returns: Square root decoded version of the input image
:rtype: np.ndarray


.. py:function:: encode_sqrt(data: numpy.ndarray | float, from_bits: int = 16, to_bits: int = 12) -> numpy.ndarray
Square root encode between specified bitrate values.

:param data: Input data array
:param from_bits: Specified bitrate of original input image
:param to_bits: Specified bitrate of output encoded image

:returns: Encoded version of input data
:rtype: np.ndarray


.. py:function:: decode_sqrt_simple(data: numpy.ndarray | float, from_bits: int = 16, to_bits: int = 12) -> numpy.ndarray
Perform a simple decoding using the naive squaring strategy.

:param data: Input data array
:param from_bits: Specified bitrate of original input image
:param to_bits: Specified bitrate of output encoded image

:returns: Decoded version of input data
:rtype: np.ndarray


.. py:function:: noise_pdf(data_value: numpy.ndarray | float, ccd_gain: float = 1 / 4.3, ccd_offset: float = 100, ccd_read_noise: float = 17, n_sigma: int = 5, n_steps: int = 10000) -> tuple
Generate a probability distribution function (pdf) from an input data value.

:param data_value: Input data value
:param ccd_gain: CCD gain [DN / electron]
:param ccd_offset: CCD bias level [DN]
:param ccd_read_noise: CCD read noise level [DN]
:param n_sigma: Number of sigma steps
:param n_steps: Number of data steps

:returns: * *np.ndarray* -- Data step distribution
* *normal* -- Data normal distribution


.. py:function:: mean_b_offset(data_value: float, from_bits: int = 16, to_bits: int = 12, ccd_gain: float = 1 / 4.3, ccd_offset: float = 100, ccd_read_noise: float = 17) -> float
Compute an offset from the naive and robust decoding processes.

:param data_value: Input data value [DN]
:param from_bits: Specified bitrate of encoded image to unpack
:param to_bits: Specified bitrate of output data (decoded)
:param ccd_gain: CCD gain [DN / electron]
:param ccd_offset: CCD bias level [DN]
:param ccd_read_noise: CCD read noise level [DN]

:returns: Generated decoding value for use in constructing a decoding table
:rtype: float


.. py:function:: decode_sqrt_corrected(data_value: float, from_bits: int = 16, to_bits: int = 12, ccd_gain: float = 1 / 4.3, ccd_offset: float = 100, ccd_read_noise: float = 17) -> float
Compute an individual decoding value for an input data value.

:param data_value: Input data value [DN]
:param from_bits: Specified bitrate of encoded image to unpack
:param to_bits: Specified bitrate of output data (decoded)
:param ccd_gain: CCD gain [DN / electron]
:param ccd_offset: CCD bias level [DN]
:param ccd_read_noise: CCD read noise level [DN]

:returns: Generated decoding value for use in constructing a decoding table
:rtype: float


.. py:function:: generate_decode_sqrt_table(from_bits: int = 16, to_bits: int = 12, ccd_gain: float = 1 / 4.3, ccd_offset: float = 100, ccd_read_noise: float = 17) -> numpy.ndarray
Generate a square root decode table between specified bitrate values and CCD parameters.

:param from_bits: Specified bitrate of encoded image to unpack
:param to_bits: Specified bitrate of output data (decoded)
:param ccd_gain: CCD gain [DN / electron]
:param ccd_offset: CCD bias level [DN]
:param ccd_read_noise: CCD read noise level [DN]

:returns: Generated square root decoding table
:rtype: table


.. py:function:: decode_sqrt_by_table(data: numpy.ndarray | float, table: numpy.ndarray) -> numpy.ndarray
Generate a square root decode table between specified bitrate values and CCD parameters.

:param data: Input encoded data array
:param table: Square root decoding table

:returns: Decoded version of input data
:rtype: np.ndarray


.. py:function:: decode_sqrt_data(data_object: ndcube.NDCube, overwrite_table: bool = False) -> ndcube.NDCube
Prefect task in the pipeline to decode square root encoded data.

:param data_object: the object you wish to decode
:type data_object: NDCube
:param overwrite_table: Toggle to regenerate and overwrite existing decoding table

:returns: a modified version of the input with the data square root decoded
:rtype: NDCube


1 change: 1 addition & 0 deletions _sources/autoapi/punchbowl/level1/tests/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Submodules
/autoapi/punchbowl/level1/tests/test_pointing/index
/autoapi/punchbowl/level1/tests/test_psf/index
/autoapi/punchbowl/level1/tests/test_quartic_fit/index
/autoapi/punchbowl/level1/tests/test_sqrt/index
/autoapi/punchbowl/level1/tests/test_stray_light/index
/autoapi/punchbowl/level1/tests/test_vignette/index

Expand Down
37 changes: 37 additions & 0 deletions _sources/autoapi/punchbowl/level1/tests/test_sqrt/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
punchbowl.level1.tests.test_sqrt
================================

.. py:module:: punchbowl.level1.tests.test_sqrt
Functions
---------

.. autoapisummary::

punchbowl.level1.tests.test_sqrt.sample_punchdata
punchbowl.level1.tests.test_sqrt.test_encoding
punchbowl.level1.tests.test_sqrt.test_decoding
punchbowl.level1.tests.test_sqrt.test_encode_then_decode
punchbowl.level1.tests.test_sqrt.test_decode_sqrt_data_task


Module Contents
---------------

.. py:function:: sample_punchdata()
Generate a sample PUNCHData object for testing


.. py:function:: test_encoding()
.. py:function:: test_decoding()
.. py:function:: test_encode_then_decode(from_bits, to_bits)
.. py:function:: test_decode_sqrt_data_task(sample_punchdata)
Test the decode_sqrt_data prefect task using a test harness


4 changes: 4 additions & 0 deletions autoapi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -419,6 +420,7 @@
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down Expand Up @@ -542,6 +544,7 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Link to this
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="punchbowl/level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -554,6 +557,7 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Link to this
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="punchbowl/level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions autoapi/punchbowl/data/history/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -417,6 +418,7 @@
<li class="toctree-l3"><a class="reference internal" href="../../level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions autoapi/punchbowl/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -417,6 +418,7 @@
<li class="toctree-l3"><a class="reference internal" href="../level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="../level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="../level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions autoapi/punchbowl/data/io/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -417,6 +418,7 @@
<li class="toctree-l3"><a class="reference internal" href="../../level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions autoapi/punchbowl/data/meta/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -417,6 +418,7 @@
<li class="toctree-l3"><a class="reference internal" href="../../level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions autoapi/punchbowl/data/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_pointing/index.html">punchbowl.level1.tests.test_pointing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_psf/index.html">punchbowl.level1.tests.test_psf</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_quartic_fit/index.html">punchbowl.level1.tests.test_quartic_fit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_sqrt/index.html">punchbowl.level1.tests.test_sqrt</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_stray_light/index.html">punchbowl.level1.tests.test_stray_light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../level1/tests/test_vignette/index.html">punchbowl.level1.tests.test_vignette</a></li>
</ul>
Expand All @@ -417,6 +418,7 @@
<li class="toctree-l3"><a class="reference internal" href="../../level1/initial_uncertainty/index.html">punchbowl.level1.initial_uncertainty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/psf/index.html">punchbowl.level1.psf</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/quartic_fit/index.html">punchbowl.level1.quartic_fit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/sqrt/index.html">punchbowl.level1.sqrt</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/stray_light/index.html">punchbowl.level1.stray_light</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../level1/vignette/index.html">punchbowl.level1.vignette</a></li>
</ul>
Expand Down
Loading

0 comments on commit 33b14ca

Please sign in to comment.