arrayprobe 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arrayprobe/__init__.py +219 -0
- arrayprobe/__main__.py +19 -0
- arrayprobe/_v314_lazy.py +48 -0
- arrayprobe/ai_ready.py +212 -0
- arrayprobe/attributed_export.py +1333 -0
- arrayprobe/authordefaults.py +267 -0
- arrayprobe/cli.py +3510 -0
- arrayprobe/combine.py +12 -0
- arrayprobe/compare.py +950 -0
- arrayprobe/config.py +1239 -0
- arrayprobe/constants.py +12 -0
- arrayprobe/count_closure.py +204 -0
- arrayprobe/diagnostic_views.py +769 -0
- arrayprobe/diode_report.py +265 -0
- arrayprobe/driver/__init__.py +5 -0
- arrayprobe/driver/_load_record.py +331 -0
- arrayprobe/driver/preflight_inputs.py +250 -0
- arrayprobe/driver/reprocess.py +553 -0
- arrayprobe/driver/run_flight.py +8166 -0
- arrayprobe/driver/tas_from_probe_housekeeping.py +124 -0
- arrayprobe/dropsize.py +519 -0
- arrayprobe/friendly.py +206 -0
- arrayprobe/geometry/__init__.py +77 -0
- arrayprobe/geometry/min_rectangle.py +92 -0
- arrayprobe/intarr.py +12 -0
- arrayprobe/intarr_analysis.py +16 -0
- arrayprobe/intarr_plots.py +12 -0
- arrayprobe/inventory.py +129 -0
- arrayprobe/jit_kernels.py +344 -0
- arrayprobe/lwc.py +44 -0
- arrayprobe/masks.py +349 -0
- arrayprobe/matio.py +410 -0
- arrayprobe/matlab_compat.py +13 -0
- arrayprobe/ncio.py +26 -0
- arrayprobe/particle.py +55 -0
- arrayprobe/particle_perimeter.py +12 -0
- arrayprobe/products.py +78 -0
- arrayprobe/profiles.py +179 -0
- arrayprobe/provenance.py +21 -0
- arrayprobe/py.typed +11 -0
- arrayprobe/readers/__init__.py +9 -0
- arrayprobe/readers/dmt.py +603 -0
- arrayprobe/readers/mask_csv.py +12 -0
- arrayprobe/readers/pms.py +12 -0
- arrayprobe/readers/sea.py +433 -0
- arrayprobe/readers/tasinfo.py +12 -0
- arrayprobe/regimes.py +507 -0
- arrayprobe/render.py +728 -0
- arrayprobe/reproduce_report.py +149 -0
- arrayprobe/review_agreement.py +135 -0
- arrayprobe/review_sampling.py +327 -0
- arrayprobe/run_page.py +624 -0
- arrayprobe/sample_area.py +12 -0
- arrayprobe/selector.py +206 -0
- arrayprobe/sizing.py +151 -0
- arrayprobe/time_convert.py +12 -0
- arrayprobe/timing_closure.py +141 -0
- arrayprobe/tools/__init__.py +27 -0
- arrayprobe/tools/make_demo_flight.py +1089 -0
- arrayprobe/tools/make_tas_file.py +760 -0
- arrayprobe/tools/probe_comparison.py +569 -0
- arrayprobe/tools/synthetic_truth.py +698 -0
- arrayprobe/tools/tas_sources.py +705 -0
- arrayprobe/triage_context.py +488 -0
- arrayprobe/triage_server.py +5215 -0
- arrayprobe/tune/__init__.py +15 -0
- arrayprobe/tune/diodes.py +400 -0
- arrayprobe/tune/distributions.py +300 -0
- arrayprobe/tune/sample.py +243 -0
- arrayprobe/tune/score.py +230 -0
- arrayprobe/tune/settings.py +354 -0
- arrayprobe/validate_by_condition.py +208 -0
- arrayprobe/validation_report.py +166 -0
- arrayprobe-0.1.0.dist-info/METADATA +260 -0
- arrayprobe-0.1.0.dist-info/RECORD +189 -0
- arrayprobe-0.1.0.dist-info/WHEEL +5 -0
- arrayprobe-0.1.0.dist-info/entry_points.txt +2 -0
- arrayprobe-0.1.0.dist-info/licenses/LICENSE +31 -0
- arrayprobe-0.1.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +47 -0
- arrayprobe-0.1.0.dist-info/licenses/NOTICE.md +369 -0
- arrayprobe-0.1.0.dist-info/top_level.txt +4 -0
- arrayprobe_soda2/__init__.py +131 -0
- arrayprobe_soda2/angles.py +143 -0
- arrayprobe_soda2/aspect_ratio.py +541 -0
- arrayprobe_soda2/backfill.py +100 -0
- arrayprobe_soda2/binary_dof.py +181 -0
- arrayprobe_soda2/buildindex.py +113 -0
- arrayprobe_soda2/decompress_dmt.py +285 -0
- arrayprobe_soda2/enhancement_hooks.py +275 -0
- arrayprobe_soda2/export_ascii.py +732 -0
- arrayprobe_soda2/export_ncdf.py +683 -0
- arrayprobe_soda2/export_ncdf_raf.py +396 -0
- arrayprobe_soda2/fillholes.py +161 -0
- arrayprobe_soda2/find_radius.py +105 -0
- arrayprobe_soda2/findsize.py +407 -0
- arrayprobe_soda2/fit_poisson.py +170 -0
- arrayprobe_soda2/fix2dimage.py +63 -0
- arrayprobe_soda2/fixraking.py +162 -0
- arrayprobe_soda2/fixstuckbits.py +146 -0
- arrayprobe_soda2/hvps4_read_frame.py +121 -0
- arrayprobe_soda2/jit_kernels.py +152 -0
- arrayprobe_soda2/label_blobs.py +177 -0
- arrayprobe_soda2/min_circle_fast.py +320 -0
- arrayprobe_soda2/particlesort.py +703 -0
- arrayprobe_soda2/pbp_writer.py +558 -0
- arrayprobe_soda2/poisson_spot_correct.py +183 -0
- arrayprobe_soda2/princomp.py +107 -0
- arrayprobe_soda2/probespecs.py +361 -0
- arrayprobe_soda2/process_2d.py +1364 -0
- arrayprobe_soda2/process_2d_parallel.py +626 -0
- arrayprobe_soda2/process_hk.py +512 -0
- arrayprobe_soda2/processbuffer_2dc.py +155 -0
- arrayprobe_soda2/processbuffer_cip.py +213 -0
- arrayprobe_soda2/processbuffer_f2dc.py +139 -0
- arrayprobe_soda2/processbuffer_spec.py +441 -0
- arrayprobe_soda2/processbuffer_tail.py +350 -0
- arrayprobe_soda2/pth_readers.py +245 -0
- arrayprobe_soda2/py.typed +11 -0
- arrayprobe_soda2/read2dbuffer.py +371 -0
- arrayprobe_soda2/reject.py +246 -0
- arrayprobe_soda2/reprocess_pbp.py +156 -0
- arrayprobe_soda2/sample_area.py +264 -0
- arrayprobe_soda2/save_writer.py +480 -0
- arrayprobe_soda2/sea.py +324 -0
- arrayprobe_soda2/spec_absolutepointers.py +109 -0
- arrayprobe_soda2/spec_decompress.py +203 -0
- arrayprobe_soda2/spec_index.py +476 -0
- arrayprobe_soda2/spec_read_frame.py +286 -0
- arrayprobe_soda2/spec_read_hk.py +301 -0
- arrayprobe_soda2/spec_readint.py +127 -0
- arrayprobe_soda2/timeconv.py +77 -0
- arrayprobe_soda2/update_op.py +101 -0
- arrayprobe_uiops/__init__.py +45 -0
- arrayprobe_uiops/combine.py +192 -0
- arrayprobe_uiops/combine_fork.py +359 -0
- arrayprobe_uiops/constants.py +830 -0
- arrayprobe_uiops/decode_naming.py +113 -0
- arrayprobe_uiops/diode_mask.py +250 -0
- arrayprobe_uiops/engine_absence.py +41 -0
- arrayprobe_uiops/export_oap.py +325 -0
- arrayprobe_uiops/geometry_core.py +366 -0
- arrayprobe_uiops/habit.py +749 -0
- arrayprobe_uiops/habit_core.py +248 -0
- arrayprobe_uiops/hollow_size_rule.py +376 -0
- arrayprobe_uiops/imgproc.py +2081 -0
- arrayprobe_uiops/imgproc_core.py +275 -0
- arrayprobe_uiops/intarr.py +167 -0
- arrayprobe_uiops/intarr_analysis.py +569 -0
- arrayprobe_uiops/intarr_plots.py +119 -0
- arrayprobe_uiops/jit_kernels.py +430 -0
- arrayprobe_uiops/lwc.py +70 -0
- arrayprobe_uiops/matlab_compat.py +860 -0
- arrayprobe_uiops/measure.py +346 -0
- arrayprobe_uiops/min_circle.py +204 -0
- arrayprobe_uiops/min_ellipse.py +161 -0
- arrayprobe_uiops/min_rectangle.py +200 -0
- arrayprobe_uiops/ncar_2dc_timing.py +100 -0
- arrayprobe_uiops/ncio.py +810 -0
- arrayprobe_uiops/oap_read.py +228 -0
- arrayprobe_uiops/particle.py +51 -0
- arrayprobe_uiops/particle_perimeter.py +94 -0
- arrayprobe_uiops/particle_physics.py +199 -0
- arrayprobe_uiops/pecan_params.py +134 -0
- arrayprobe_uiops/probe_cases.py +298 -0
- arrayprobe_uiops/product_sanity.py +337 -0
- arrayprobe_uiops/profile.py +71 -0
- arrayprobe_uiops/profiles.py +756 -0
- arrayprobe_uiops/provenance.py +804 -0
- arrayprobe_uiops/py.typed +11 -0
- arrayprobe_uiops/qc.py +169 -0
- arrayprobe_uiops/readers/__init__.py +8 -0
- arrayprobe_uiops/readers/mask_csv.py +74 -0
- arrayprobe_uiops/readers/pms.py +239 -0
- arrayprobe_uiops/readers/tasinfo.py +57 -0
- arrayprobe_uiops/rect_ellipse.py +129 -0
- arrayprobe_uiops/register_image_assisted.py +25 -0
- arrayprobe_uiops/reject.py +501 -0
- arrayprobe_uiops/reject_core.py +220 -0
- arrayprobe_uiops/sample_area.py +93 -0
- arrayprobe_uiops/sizedist.py +1923 -0
- arrayprobe_uiops/sizedist_core.py +814 -0
- arrayprobe_uiops/sizedist_tables.py +642 -0
- arrayprobe_uiops/spec.py +1094 -0
- arrayprobe_uiops/spec_core.py +703 -0
- arrayprobe_uiops/stray_pixel.py +103 -0
- arrayprobe_uiops/tas.py +191 -0
- arrayprobe_uiops/time_convert.py +41 -0
- uiops/__init__.py +402 -0
- uiops/py.typed +11 -0
arrayprobe/constants.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
import sys as _sys
|
|
3
|
+
import typing as _typing
|
|
4
|
+
|
|
5
|
+
from arrayprobe_uiops import constants as _impl
|
|
6
|
+
|
|
7
|
+
# Static view for type checkers only: the alias below replaces this module at run time,
|
|
8
|
+
# so mypy would otherwise see an empty module. No run-time effect.
|
|
9
|
+
if _typing.TYPE_CHECKING:
|
|
10
|
+
from arrayprobe_uiops.constants import * # noqa: F403
|
|
11
|
+
|
|
12
|
+
_sys.modules[__name__] = _impl
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
"""Count closure: do a size-distribution product's binned counts sum to the particles S3 holds?
|
|
3
|
+
|
|
4
|
+
Read only. Compares, for one size-distribution product (``sd`` netCDF) and its
|
|
5
|
+
per-particle proc file, **per second, the way sizeDist does**:
|
|
6
|
+
|
|
7
|
+
* ``binned``: the sum of ``count`` over bins (``sizedist.py:1408``,
|
|
8
|
+
``count = dist_minR * binwidth / 10``) per second;
|
|
9
|
+
* ``accepted``: the particles of the proc file that ``sizeDist`` puts in the
|
|
10
|
+
accepted population of a second on the sd time axis. Every particle that is
|
|
11
|
+
not accepted is listed in ``excluded`` with a named cause and the port line
|
|
12
|
+
that excludes it (``CAUSES``); the closure is exact or the residual is
|
|
13
|
+
attributed particle by particle, never a tolerance.
|
|
14
|
+
* ``probe_reported``: the probe's own particle total. Neither the SPEC reader's
|
|
15
|
+
proc output nor the DMT proc output written by this package carries a
|
|
16
|
+
per-second probe total that is read here, so it is ``None`` ("not available").
|
|
17
|
+
|
|
18
|
+
Causes, each measured on the tracked demo-flight fixtures:
|
|
19
|
+
|
|
20
|
+
``outside-tas-axis``
|
|
21
|
+
The particle's second (probetype 2: ``Time`` in hhmmss, v3.5
|
|
22
|
+
``arrayprobe_uiops/sizedist.py:1562-1571``, v3.1.4: the v3.1.4 engine's sizedist
|
|
23
|
+
module, lines 720-734)
|
|
24
|
+
is not on the sd ``time`` axis, which is the TAS axis: sizeDist loops over
|
|
25
|
+
``n_sec = len(tas)`` seconds only (v3.5 ``:1510``/``:1608``, v3.1.4
|
|
26
|
+
``:691``/``:786``) and the last edge ``tas_time[-1] + 1`` is exclusive
|
|
27
|
+
(v3.5 ``:1552``/``:1468``). A block past the last TAS second is never read.
|
|
28
|
+
``shattered-interarrival``
|
|
29
|
+
v3.1.4 with a shattering threshold (``iat_file`` -> ``'NONE'`` ->
|
|
30
|
+
``default_int_arr_thresh``, ``sizeDist.m:874``; the v3.1.4 engine's sizedist
|
|
31
|
+
module, line 1217, whose line numbers the rest of this entry cites):
|
|
32
|
+
the inter-arrival time, ``0`` for the file's first particle (``:906``) and
|
|
33
|
+
``diff(Time_in_seconds)`` to the previous particle in file order otherwise
|
|
34
|
+
(``:909-911``), is ``<=`` the threshold, so ``auto_reject`` becomes ``'S'`` in
|
|
35
|
+
memory (``:1221-1227``, ``sizeDist.m:876-888``, the hit and its predecessor).
|
|
36
|
+
The proc file keeps its original code; the sd's ``Reject_ratio`` shows it.
|
|
37
|
+
``reject-code`` / ``center-out`` / ``diameter-out-of-bins``
|
|
38
|
+
``image_auto_reject`` not in ``GOOD_REJECT_CODES`` (``"0HhuR"``,
|
|
39
|
+
``sizedist_core.py:63``, ``sizeDist.m:1080``); ``image_center_in != 1`` under
|
|
40
|
+
``SAmethod == 0`` (``sizedist.py:1268-1270``); ``image_diam_minR`` outside
|
|
41
|
+
``[bin_min[0], bin_max[-1])`` (``bin_index``, ``sizedist_core.py:446-464``).
|
|
42
|
+
|
|
43
|
+
The shattering threshold is read from the sd ``.call`` sidecar
|
|
44
|
+
(``default_int_arr_thresh=<value>``) and applied only when the sd's
|
|
45
|
+
``Shattering Algorithm`` attribute says it was applied; a ``.call`` naming a real
|
|
46
|
+
threshold file is refused rather than guessed. The v3.5 corrupt-time pass
|
|
47
|
+
(``while k < n - 1``) is not re-derived: it runs only on a
|
|
48
|
+
non-monotonic particle-time series (``arrayprobe_uiops/sizedist.py:498``), and
|
|
49
|
+
this module raises ``NotImplementedError`` on one instead of attributing silently.
|
|
50
|
+
"""
|
|
51
|
+
from __future__ import annotations
|
|
52
|
+
|
|
53
|
+
import os
|
|
54
|
+
import re
|
|
55
|
+
|
|
56
|
+
import numpy as np
|
|
57
|
+
|
|
58
|
+
from arrayprobe import provenance
|
|
59
|
+
|
|
60
|
+
GOOD_REJECT_CODES = "0HhuR"
|
|
61
|
+
NOT_AVAILABLE = "not available"
|
|
62
|
+
CAUSES = (
|
|
63
|
+
"outside-tas-axis",
|
|
64
|
+
"shattered-interarrival",
|
|
65
|
+
"reject-code",
|
|
66
|
+
"center-out",
|
|
67
|
+
"diameter-out-of-bins",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _var(ds, name):
|
|
72
|
+
x = ds.variables[name][:]
|
|
73
|
+
if np.ma.isMaskedArray(x) and not np.issubdtype(x.dtype, np.floating):
|
|
74
|
+
# NaN is not a value of an integer dtype; a masked int (a netCDF fill value in an
|
|
75
|
+
# int16/int32 particle variable) is widened to float64 so the fill can be NaN.
|
|
76
|
+
x = x.astype(np.float64)
|
|
77
|
+
return np.ma.filled(x, np.nan)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _hhmmss_to_insec(t):
|
|
81
|
+
t = np.asarray(t, dtype=np.float64)
|
|
82
|
+
return (np.floor(t / 10000) * 3600 + np.floor((t % 10000) / 100) * 60
|
|
83
|
+
+ np.floor(t % 100))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _shattering_threshold(sd_path, sd_attrs):
|
|
87
|
+
"""The per-particle threshold sizeDist applied, or ``None`` when it skipped the block."""
|
|
88
|
+
alg = str(sd_attrs.get("Shattering Algorithm", "Not applied"))
|
|
89
|
+
if alg.startswith("Not applied"):
|
|
90
|
+
return None
|
|
91
|
+
# The driver writes ``<file>.nc.call`` (``run_flight.call_path``); a hand-named
|
|
92
|
+
# ``<stem>.call`` is the fallback, as in ``reproduce_report._call_stamp``.
|
|
93
|
+
call = str(sd_path) + ".call"
|
|
94
|
+
if not os.path.isfile(call):
|
|
95
|
+
call = os.path.splitext(str(sd_path))[0] + ".call"
|
|
96
|
+
if not os.path.isfile(call):
|
|
97
|
+
raise FileNotFoundError(f"{call}: the sd stamp names the shattering threshold")
|
|
98
|
+
with open(call, encoding="utf-8") as fh:
|
|
99
|
+
fields = provenance.parse(fh.read()).fields
|
|
100
|
+
# A field's value runs to the next key ("6e-06 (default)"); its first token is the value.
|
|
101
|
+
iat_file = (fields.get("iat_file") or "").split()
|
|
102
|
+
if iat_file and iat_file[0] not in ("<none>", "NONE") \
|
|
103
|
+
and not iat_file[0].endswith("MISSING.cdf"):
|
|
104
|
+
raise NotImplementedError(
|
|
105
|
+
f"{call} names a real threshold file {iat_file[0]}; "
|
|
106
|
+
"per-particle thresholds from a file are not re-derived here")
|
|
107
|
+
m = re.match(r"[0-9.eE+-]+", fields.get("default_int_arr_thresh") or "")
|
|
108
|
+
if m is None:
|
|
109
|
+
raise ValueError(f"{call}: shattering was applied but no default_int_arr_thresh= stamp")
|
|
110
|
+
return float(m.group(0))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def count_closure(sd_path, proc_path):
|
|
114
|
+
"""Return per-second ``binned``/``accepted``, the residual and every excluded particle."""
|
|
115
|
+
import netCDF4
|
|
116
|
+
|
|
117
|
+
with netCDF4.Dataset(str(sd_path)) as sd:
|
|
118
|
+
counts = _var(sd, "count") # (Time, bins)
|
|
119
|
+
bin_min = _var(sd, "bin_min")
|
|
120
|
+
bin_max = _var(sd, "bin_max")
|
|
121
|
+
times = _var(sd, "time")
|
|
122
|
+
attrs = {k: sd.getncattr(k) for k in sd.ncattrs()}
|
|
123
|
+
with netCDF4.Dataset(str(proc_path)) as pr:
|
|
124
|
+
code = _var(pr, "image_auto_reject")
|
|
125
|
+
center = _var(pr, "image_center_in")
|
|
126
|
+
diam = _var(pr, "image_diam_minR")
|
|
127
|
+
ptime = _var(pr, "Time") # hhmmss, probetype 2
|
|
128
|
+
tsec = _var(pr, "Time_in_seconds")
|
|
129
|
+
rec = _var(pr, "parent_rec_num")
|
|
130
|
+
n = int(code.size)
|
|
131
|
+
sa_method = attrs.get("SA Method")
|
|
132
|
+
if sa_method is not None and str(sa_method) != "Center-in":
|
|
133
|
+
# The center-out cause below is sizeDist's SAmethod == 0 rule only.
|
|
134
|
+
raise NotImplementedError(
|
|
135
|
+
f"SA Method {sa_method!r}: only the Center-in acceptance is re-derived")
|
|
136
|
+
|
|
137
|
+
# -- the second each particle belongs to (sizeDist's TAS-axis loop) --------
|
|
138
|
+
tas_time = _hhmmss_to_insec(times)
|
|
139
|
+
if np.any(np.diff(tas_time) <= 0):
|
|
140
|
+
raise NotImplementedError("non-monotonic sd time axis: fix_time_grid path not re-derived")
|
|
141
|
+
image_time = _hhmmss_to_insec(ptime)
|
|
142
|
+
if np.any(np.diff(image_time) < 0):
|
|
143
|
+
raise NotImplementedError(
|
|
144
|
+
"non-monotonic particle times: v3.5's corrupt-time pass is not re-derived")
|
|
145
|
+
if tas_time.size:
|
|
146
|
+
edges = np.concatenate([tas_time, [tas_time[-1] + 1]])
|
|
147
|
+
sec_index = np.searchsorted(edges, image_time, side="right") - 1
|
|
148
|
+
else: # a zero-second sd: no particle lies on its axis
|
|
149
|
+
sec_index = np.full(n, -1)
|
|
150
|
+
on_axis = (sec_index >= 0) & (sec_index < len(tas_time))
|
|
151
|
+
|
|
152
|
+
# -- shattering, v3.1.4 production gate (:866-888) --------------------------
|
|
153
|
+
thresh = _shattering_threshold(sd_path, attrs)
|
|
154
|
+
shattered = np.zeros(n, dtype=bool)
|
|
155
|
+
if thresh is not None and n:
|
|
156
|
+
int_arr = np.concatenate([[0.0], np.diff(tsec)])
|
|
157
|
+
hit = int_arr <= thresh
|
|
158
|
+
shattered = hit.copy()
|
|
159
|
+
shattered[:-1] |= hit[1:] # :884-888 flags ix-1 and ix
|
|
160
|
+
|
|
161
|
+
good_code = np.isin(code, [ord(c) for c in GOOD_REJECT_CODES])
|
|
162
|
+
center_ok = center == 1
|
|
163
|
+
in_range = (diam >= bin_min[0]) & (diam < bin_max[-1])
|
|
164
|
+
|
|
165
|
+
excluded = []
|
|
166
|
+
accepted = np.ones(n, dtype=bool)
|
|
167
|
+
for k in range(n):
|
|
168
|
+
cause = None
|
|
169
|
+
if not on_axis[k]:
|
|
170
|
+
cause = "outside-tas-axis"
|
|
171
|
+
elif shattered[k]:
|
|
172
|
+
cause = "shattered-interarrival"
|
|
173
|
+
elif not good_code[k]:
|
|
174
|
+
cause = "reject-code"
|
|
175
|
+
elif not center_ok[k]:
|
|
176
|
+
cause = "center-out"
|
|
177
|
+
elif not in_range[k]:
|
|
178
|
+
cause = "diameter-out-of-bins"
|
|
179
|
+
if cause is not None:
|
|
180
|
+
accepted[k] = False
|
|
181
|
+
excluded.append({"index": k,
|
|
182
|
+
"parent_rec_num": None if np.isnan(rec[k]) else int(rec[k]),
|
|
183
|
+
"time": float(ptime[k]), "cause": cause})
|
|
184
|
+
|
|
185
|
+
accepted_per_second = np.zeros(len(tas_time))
|
|
186
|
+
for k in np.flatnonzero(accepted):
|
|
187
|
+
accepted_per_second[sec_index[k]] += 1
|
|
188
|
+
binned_per_second = np.nansum(counts, axis=1)
|
|
189
|
+
total_binned = float(np.sum(binned_per_second))
|
|
190
|
+
total_accepted = int(np.count_nonzero(accepted))
|
|
191
|
+
return {
|
|
192
|
+
"time": times,
|
|
193
|
+
"binned_per_second": binned_per_second,
|
|
194
|
+
"accepted_per_second": accepted_per_second,
|
|
195
|
+
"total_binned": total_binned,
|
|
196
|
+
"total_accepted": total_accepted,
|
|
197
|
+
"total_in_proc": n,
|
|
198
|
+
"residual": total_binned - total_accepted,
|
|
199
|
+
"residual_per_second": binned_per_second - accepted_per_second,
|
|
200
|
+
"excluded": excluded,
|
|
201
|
+
"shattering_threshold": thresh,
|
|
202
|
+
"probe_reported": None,
|
|
203
|
+
"probe_reported_note": NOT_AVAILABLE,
|
|
204
|
+
}
|