Skip to content

Commit

Permalink
Merge branch 'dev' into doc-conf
Browse files Browse the repository at this point in the history
  • Loading branch information
greglucas authored Nov 22, 2023
2 parents e3c6e1c + 68e063c commit 58b8998
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ coverage:
patch:
default:
target: 90%
paths:
- imap_processing/**/*.py
project:
default:
target: 90%
paths:
- imap_processing/**/*.py
28 changes: 28 additions & 0 deletions docs/source/reference/codice.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _codice:

CoDICE (Compact Dual Ion Composition Experiment)
================================================

.. currentmodule:: imap_processing.codice

This is the CoDICE Instrument module, which contains the code for processing
data from the CoDICE instrument.

The L0 code to decommutate the CCSDS packet data can be found below:

.. autosummary::
:toctree: generated/
:template: autosummary.rst
:recursive:

l0.decom_codice

The code below is used to decompress an 8 bit science value to a 24- or 32-bit
uncompressed value:

.. autosummary::
:toctree: generated/
:template: autosummary.rst
:recursive:

l0.decompress_codice
1 change: 1 addition & 0 deletions docs/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Instruments
.. toctree::
:maxdepth: 1

codice
glows
hit
swe
Expand Down
22 changes: 12 additions & 10 deletions imap_processing/codice/l0/decompress_codice.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
"""Decompress CoDICE science data.
For CoDICE, there are 3 forms of compression:
1. Table-based lossy compression A (24- or 32-bit -> 8-bit)
2. Table-based lossy compression B (24- or 32-bit -> 8 bit)
3. LZMA lossless compression
| 1. Table-based lossy compression A (24- or 32-bit -> 8-bit)
| 2. Table-based lossy compression B (24- or 32-bit -> 8 bit)
| 3. LZMA lossless compression
Only one lossy option can be selected in cases of lossy + lossless compression.
Thus, there are 6 possibly compression algorithms:
1. No compression
2. Lossy A only
3. Lossy B only
4. Lossless only
5. Lossy A + lossless
6. Lossy B + lossless
| 1. No compression
| 2. Lossy A only
| 3. Lossy B only
| 4. Lossless only
| 5. Lossy A + lossless
| 6. Lossy B + lossless
In the case of (5) and (6), the data is first run through lossy compression, and
then the result is run through lossless compression. Thus, to decompress, one
Expand Down Expand Up @@ -96,7 +98,7 @@ def decompress(compressed_value: int, algorithm: IntEnum):
----------
compressed_value : int
The 8-bit compressed value to decompress
algorithm : IntEnum
algorithm : int
The algorithm to apply. Supported algorithms are provided in the
``codice_utils.CoDICECompression`` class
Expand Down

0 comments on commit 58b8998

Please sign in to comment.