window1d
Description
window1d returns weights on a 1-D grid or at query coordinates read from
standard input. Query coordinates do not need to be exactly on grid points;
BLEND uses linear interpolation from neighboring grid weights.
If -B is given, window supports are read from a blendfile and -F and
-T are ignored with a warning. Points outside all blendfile supports are
assigned zero weight.
Usage
blend window1d - Generate 1-D blending weights
usage: blend window1d -R<xmin>/<xmax> -I<dx> [-F<function>] [-T<r1>[/<r2>]]
[-B<blendfile>] [-C<f|l|o|u|a|g|p>] [-V[q|e|w|t|i|c|d]]
Generate 1-D blending weights and write two columns: x weight. If x coordinates
are provided on standard input, weights are returned at those query locations.
Query locations may be arbitrary real coordinates; off-grid weights are computed
by linear interpolation from neighboring grid-point weights. If no query points
are provided, weights are written for the complete -R/-I grid.
REQUIRED ARGUMENTS:
-R<xmin>/<xmax>, --region=<xmin>/<xmax>
Specify the full 1-D output domain in user coordinates. The domain must
satisfy xmin < xmax. If xmax does not fall exactly on the -I increment,
BLEND adjusts xmax upward to the next increment and reports a warning
at the default verbosity level.
-I<dx>, --increment=<dx>
Specify the grid increment in user coordinates. The increment must be
positive. For example, -R10/14 -I0.1 creates real coordinates
10, 10.1, 10.2, ..., 14.
OPTIONAL ARGUMENTS:
-F<function>, --function=<function>
Select the window function used for a single support over the full -R
domain [Default is cosine]. Run blend --show-windows to list available
window functions.
This option is ignored when -B is given, since each blendfile row supplies
its own function.
-T<r1>[/<r2>], --taper_ratio=<r1>[/<r2>]
Set beginning and ending taper ratios for a single support over the full
-R domain. Ratios must be >= 0 and < 0.5. If r2 is omitted then r2 = r1.
[Default is 0.2/0.2]. This option is ignored for boxcar windows and when
-B is given, since each blendfile row supplies its own taper ratios.
-B<blendfile>, --blendfile=<blendfile>
Read one or more interval supports from <blendfile>. Each non-empty,
non-comment row must contain exactly four fields:
<left> <right> <function> <r1>[/<r2>]
where <left>/<right> define an interval contained inside the -R domain,
<function> is any supported window function listed by blend --show-windows,
and <r1>/<r2> are taper ratios for that interval. Lines may contain
comments introduced by '#'. Taper ratios are ignored for boxcar windows.
Example row for -R0/10:
2 3 cosine 0.2/0.2
Grid points not covered by any blendfile interval within -R receive weight 0.
-C<f|l|o|u|a|g|p>, --clobber=<mode>
Select how overlapping interval weights from -B are combined [Default is p].
f Use the first interval listed in the blendfile.
l Use the lowest weight among overlapping intervals.
o Use the last interval listed in the blendfile.
u Use the highest weight among overlapping intervals.
a Use the arithmetic average of overlapping weights.
g Use the geometric average of overlapping weights.
p Use the product of overlapping weights.
-V[level], --verbose=<level>
Select verbosity level [w]. Choose among q, e, w, t, i, c, and d:
q Quiet; suppress all diagnostic messages.
e Error messages only.
w Warnings and errors [Default].
t Timings, warnings, and errors.
i Informational messages, timings, warnings, and errors.
c Compatibility messages and all lower verbosity messages.
d Debug messages and all lower verbosity messages.
-?, --help
Print this usage message and exit.
EXAMPLES:
blend window1d -R0/10 -I1 -Fcosine -T0.2/0.2
Generate one cosine-tapered window over the full domain.
printf '2.5\n' | blend window1d -R0/10 -I1 -Fcosine -T0.2
Query the interpolated weight at x = 2.5.
blend window1d -R0/10 -I0.5 -Bsupports.txt -Ca
Read multiple interval supports from supports.txt and average overlaps.
Use shell redirection to write the output to a file, e.g., > weights.txt.