Skip to content

Rename L1 to L0.5 in the decommutator - #75

Merged
namurphy merged 7 commits into
PlasmaPy:mainfrom
namurphy:rename-l1-to-l05
Oct 7, 2026
Merged

namurphy merged 7 commits into
PlasmaPy:mainfrom
namurphy:rename-l1-to-l05

Conversation

@namurphy

@namurphy namurphy commented Oct 7, 2026

Copy link
Copy Markdown
Member

The decommutator converts L0 files into L0.5 CDF files, but the code inherited from the original pipeline sometimes refers to them as L1. This PR makes the naming consistent.

  • Rename swp_spc_l02l1.py to swp_spc_l0_to_l05.py, and update imports, the README, and log messages.
  • Use L0.5 instead of L1 in docstrings and comments.
  • Rename the --l1dir (-dl1) option of pfc_decommutator to --l05dir (-dl05), and the l1dir parameter of swp_spc_l0_to_l05.main to l05dir. This is a breaking change for anyone using the old option or keyword argument.
  • Remove the unused _read_stdin stub from ccsds_reader_pipeline.py.
  • Update the module docstrings of ccsds_reader_pipeline.py and swp_spc_l0_to_l05.py.

Not changed here: the _L1.cdf output file suffix, the l1path variable, and the sc_hsk/L1/ data directory, since renaming these would change outputs or data paths.

🤖 Generated with Claude Code

namurphy and others added 5 commits October 7, 2026 18:40
The decommutator converts L0 files into L0.5 CDF files, but the code
inherited from the original pipeline sometimes called them L1. Rename
swp_spc_l02l1.py to swp_spc_l0_to_l05.py, update imports and log
messages to match, and use L0.5 in docstrings and comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decommutator writes L0.5 CDF files, so rename the output directory
option of pfc_decommutator from --l1dir (-dl1) to --l05dir (-dl05), and
the corresponding parameter of swp_spc_l0_to_l05.main from l1dir to
l05dir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +3 to 34
# The original version of this file from /psp/code on fc was swp_spc_l02l1.py,
# which was run as a script.

# While the decommutator step goes from level 0 (L0) to level 0.5 (L05 or L0.5),
# the software and filenames has sometimes used level 1 (L1) for level 0.5.

# The following are relic comments from the previous file.

# Purpose: Convert binary "level-zero" or "ssr" files that come from the SWEM or Spacecraft
# into L0.5 CDF files

# Requirements: Must have a reference to a skeleton file for the ApID that you wish to convert_one

# Input: path to a binary L0 file

# Output: saves a CDF file

# Revision History
# 2020/02/03 - Fix timing bug in 0x351 that arose when switching to spiceypy. Add capability to produce 0x352 (time series) files. Will require update to 0x352 (time series) skeleton also. Update bug in naming of L1 files coming from gzip (spacecraft files, probably). Remove versioning from skeleton files (since SVN is taking care of that).
# 2020/01/29 - Use spiceypy to adjust time of each measurement to SCET; remove unused command-line argument options
# Change method by which newest skeleton files are found; various other cleanups
# 2019/08/27 - Calling new ccsds_reader that separates out s/c from instr. packets
# - Also, new ccsds_reader will use new packet finder (much faster), and does not scan through packets like before
# 2019/08/23 - Fixed bug that was reading in the oldest rather than newest skeleton file
# - Added capability to read 0x081 and 0x262 packets from s/c hsk files. Requires link to SC_HK.blk block definition file
# - Added revision history


# $URL: file:///psp/psp_swp_spc_code_repository/trunk/swp_spc_l02l1.py $
# $LastChangedRevision: 97 $
# $LastChangedDate: 2020-08-04 09:20:42 -0400 (Tue, 04 Aug 2020) $
# $LastChangedBy: acase $

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll likely want to remove this eventually, but it's helpful context for now.

Comment on lines -34 to -37
def _read_stdin(ptp: bool = False, verbose: bool = False) -> None: # ruff:ignore[FBT001, FBT002]
"""Parse binary stream on stdin""" # ruff:ignore[D400]


Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function didn't do anything, and wasn't used anywhere else either.

Comment thread src/pyfaradaycup/decommutator/swp_spc_l0_to_l05.py Outdated
Comment thread src/pyfaradaycup/decommutator/swp_spc_l0_to_l05.py Outdated
@namurphy
namurphy merged commit 3c591cd into PlasmaPy:main Oct 7, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant