diff --git a/docs/source/algorithms/Rebin-v1.rst b/docs/source/algorithms/Rebin-v1.rst index 50e225683de98defcd7d1c9005e2d8681c3822f9..593accdcd915f07846aeb10ed543e60e5c786b4c 100644 --- a/docs/source/algorithms/Rebin-v1.rst +++ b/docs/source/algorithms/Rebin-v1.rst @@ -26,6 +26,15 @@ be no gaps between bins. Rebin ensures that any of these space filling bins cannot be less than 25% or more than 125% of the width that was specified. +In both cases, where a new bin only partially overlaps one or more input +bins, the new counts are calculated as the sum of the old bins weighted +by the fractional overlaping widths of the new bin over the old bin: + +.. math:: Y^{\mathrm{new}} = \sum_i Y^{\mathrm{old}}_i F_i +.. math:: E^{\mathrm{new}} = \sqrt{\sum_i (E^{\mathrm{old}}_i)^2 F_i} + +where :math:`F_i = w^{\mathrm{overlap}}_i / w^{\mathrm{old}}_i` is the +ratio of the overlap width of the new and old bin over the old bin width. .. _rebin-example-strings: @@ -79,7 +88,6 @@ following will happen: Hence the actual *Param* string used is "0, 2, 4, 3, 10". - .. _rebin-usage: Usage diff --git a/docs/source/algorithms/Rebin2D-v1.rst b/docs/source/algorithms/Rebin2D-v1.rst index 83313f033f0d54636e8b1806c2d3681009810f91..d9efd20d2ac63482ece4e919113ffa384152e62f 100644 --- a/docs/source/algorithms/Rebin2D-v1.rst +++ b/docs/source/algorithms/Rebin2D-v1.rst @@ -14,8 +14,15 @@ The bin parameters are used to form an output grid. A positive create logarithmic binning using the formula :math:`x(j+1)=x(j)(1+|\Delta x_i|)\,`. The overlap of the polygons formed from the old and new grids is tested to compute the required -signal weight for the each of the new bins on the workspace. The errors -are summed in quadrature. +signal weight for the each of the new bins on the workspace, like in +:ref:`algm-Rebin`, and the errors are summed in quadrature, as: + +.. math:: Y^{\mathrm{new}} = \sum_i Y^{\mathrm{old}}_i F_i +.. math:: E^{\mathrm{new}} = \sqrt{\sum_i (E^{\mathrm{old}}_i)^2 F_i} + +where :math:`F_i = A^{\mathrm{overlap}}_i / A^{\mathrm{old}}_i` is the +ratio of the overlap area of the new and old bin over the area of the +old bin. Requirements ------------ diff --git a/docs/source/images/RebinnedOutputStep1.png b/docs/source/images/RebinnedOutputStep1.png index 06632d534a2aa396e2a3f5f09680bb456d94c541..262108dba3ca28a69e25405f3ec98bf61290b615 100644 Binary files a/docs/source/images/RebinnedOutputStep1.png and b/docs/source/images/RebinnedOutputStep1.png differ diff --git a/docs/source/images/RebinnedOutputStep2.png b/docs/source/images/RebinnedOutputStep2.png index 7a1c20b1978e0df478ad7b8dfb3ef8994b8794cc..280095d3cad56f9fe6f1e56d992b7ba03fb6ccb4 100644 Binary files a/docs/source/images/RebinnedOutputStep2.png and b/docs/source/images/RebinnedOutputStep2.png differ diff --git a/tools/system_test_speed.py b/tools/system_test_speed.py new file mode 100644 index 0000000000000000000000000000000000000000..3a9f84b2fff57a9f6a58d52318860d64a769b2cd --- /dev/null +++ b/tools/system_test_speed.py @@ -0,0 +1,28 @@ +""" +Usage system_test_speed.py <build-log> <output-csv> + +Given a the raw output from a Jenkins build server log this script will output +a CSV file of the speed & memory for each system test. +""" +import sys + +with open(sys.argv[1], 'r') as f: + lines = f.readlines() + +lines = filter(lambda x: "RESULT|" in x or ": Executing" in x, lines) + +# Strip out tests that did not run +# look ahead and remove tests that have no results +idxs = [] +for i, (x, y) in enumerate(zip(lines, lines[1::])): + if "Executing" in x and "Executing" in y: + idxs.append(i) +lines = [i for j, i in enumerate(lines) if j not in idxs] + +with open(sys.argv[2], 'w') as f: + f.write("name, time, memory\n") + for name, time, memory in zip(lines[::3], lines[1::3], lines[2::3]): + name = name.split("Executing")[-1].strip() + time = time.split("|1")[-1].strip() + memory = memory.split("|")[-1].strip() + f.write(", ".join([name, time, memory]) + "\n")