DSEL(1)
π 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,
dselcopies 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 β
dselreads 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
dselto stop. like, full stop. π - if the stream ends before a requested count is satisfied,
dselstops 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.
π COPYRIGHT π
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
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms