DSEL(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… DSEL(1) β€” the BRL-CAD stream selector, bestie edition ✨

okay so real talk, this is the dsel page from BRL-CAD, and it's genuinely one of the most lowkey-useful little tools in the whole signal-processing lineup. it reads doubles off stdin and decides which ones get to stay. that's it. that's the whole vibe. πŸŽ€


🌸 NAME 🌸

dsel β€” selectively keep or skip doubles from a data stream. yes, "selectively" is doing a lot of work in that sentence and she deserves it πŸ’…


✨ SYNOPSIS ✨

dsel _keep_ < input.doubles > output.doubles
dsel _skip_ _keep_ [_skip_ _keep_ ...] < input.doubles > output.doubles

two modes, two moods. pick your fighter 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so dsel reads a stream of double-precision floating-point numbers from standard input, selectively copies or discards runs of values according to its positional arguments, and writes the kept values to standard output. it's giving curator energy honestly β€” she's deciding which numbers make the cut πŸ‘‘

both input and output must be redirected. like, actually both. dsel refuses to run if either standard input or standard output is a terminal. no cap, she will not do it. don't ask. πŸ™ˆ

now here's where the argument count changes everything:

  • if you give a single argument, dsel copies exactly that many keep values to the output and exits. clean, simple, iconic.
  • with two or more arguments, they're interpreted as alternating skip and keep counts β€” dsel reads and discards skip values, then reads and copies keep values, repeating for each pair. πŸ”
  • if the argument list ends with an unpaired skip (an odd argument count greater than one), that final implied keep is treated as infinite, so all remaining values get copied. she just keeps going. main character energy fr.
  • a skip count of zero or less is ignored.
  • a keep count of zero or less causes dsel to stop. like, full stop. πŸ’€
  • if the stream ends before a requested count is satisfied, dsel stops at end-of-input. no drama, no error, she just wraps it up.

also, for the lore girlies: this is the double-precision counterpart of the byte- and short-oriented stream selectors used all throughout the BRL-CAD signal-processing tools. so she's part of a whole family, and she pairs beautifully with dconv(1), dmod(1), and dstats(1). iykyk 🌈


πŸ’– OPTIONS πŸ’–

  • -h, -? β€” print a usage message and exit. your little escape hatch, always there for you 🫢

and then the two positional ones:

  • skip β€” number of double-precision values to read and discard. bye bestie, not your turn 🌸
  • keep β€” number of double-precision values to read and copy to the output. welcome to the output file, you're slaying now ✨

πŸ“ EXAMPLES πŸ“

⭐ Example 1. Extract a window of samples

dsel 512 1024 < data.d > window.d

skips the first 512 doubles of data.d (maybe that's a header, maybe it's a settling region β€” either way it's not invited 🚫) and copies the next 1024 doubles to window.d, ignoring the rest. she took exactly what she needed and left. queen behavior πŸ‘‘

⭐ Example 2. Take a leading block and scale it inline

dsel 1024 < signal.d | dmod -m 2.0 > head_scaled.d

copies only the first 1024 doubles of signal.d β€” remember, a single argument is always a keep count, no ambiguity, no guessing 😌 β€” then pipes them straight through dmod(1) to scale each value by 2.0 before writing head_scaled.d. combo move. ate. πŸ”₯


🧚 SEE ALSO 🧚

brlcad(1), dconv(1), dmod(1), dstats(1), dpeak(1), d-f(1), f-d(1) β€” go say hi to the whole friend group πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” collectively mother, honestly.


this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. yes, 1989 to 2026, she's been that girl for decades πŸ’…


πŸ’Œ BUG REPORTS πŸ’Œ

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. spotted something cursed? tell the group chat, don't just screenshot it πŸ™ˆ


ok that's the whole page, no notes, you're ready to go run her

alright bestie, that's the whole manual β€” this is BRL-CAD's dsel(1) page, and the copyright on this beauty runs 1989-2026. go stream some doubles responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from