Astro~/0.3
** CLI / astro ocsc * PAGE 11 / 22
** Astro * CLI
** /cli/ocsc

astro ocsc

Optical coding, condition frames into codeblocks, randomise.

Optical communications coding and synchronisation (CCSDS 142.0-B-1).

This layer works in bits

A codeblock is a bit string whose length depends on the code rate and is not a whole number of octets. So these commands report a bit length alongside the octets, and the last octet is zero-padded.

That matters for randomize: randomising the padding would corrupt the block, so the bit length has to be given rather than inferred from the octet count.

Subcommands

CommandDescription
astro ocsc conditionSplit frames into SCPPM codeblocks
astro ocsc randomizeApply the randomiser to a codeblock

astro ocsc condition

Split a stream of fixed-length frames into SCPPM codeblocks at the given code rate.

Conditioning is not one frame in, one codeblock out. The conditioner fills each codeblock from the frame stream and holds the remainder until enough arrives, so the codeblock count depends on the total input rather than the frame count.

astro ocsc condition [file] [flags]

Flags

FlagDefaultDescription
--frame-len(required)Fixed frame length in octets
--rate1/2SCPPM code rate: 1/3, 1/2, or 2/3
--inputbinInput format: hex or bin
--formattextOutput format: text, hex, or json

Examples

astro ocsc condition --input bin --frame-len 256 --rate 1/2 frames.bin

astro ocsc randomize

Exclusive-or a codeblock with the pseudo-randomiser sequence. The randomiser is its own inverse, so this both applies and removes it.

astro ocsc randomize [file] [flags]

Flags

FlagDefaultDescription
--bits(all of the input)Codeblock length in bits
--inputhexInput format: hex or bin
--formathexOutput format: text, hex, or json

Examples

# There and back
astro ocsc randomize --input hex --bits 64 < block.hex |
  astro ocsc randomize --input hex --bits 64

See also: the protocol page for the standard and the Go API, and the conformance statement for what is and is not implemented.