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/tune/score.py
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
"""Score a reviewer's labels against what the run decided, per reject code and size bin.
|
|
3
|
+
|
|
4
|
+
For each queue in a queue file (the file ``arrayprobe tune sample`` writes and
|
|
5
|
+
``arrayprobe triage --queue-file`` reads), the verdicts and phases the reviewer recorded in the
|
|
6
|
+
triage verdict store are joined to the queue's particles by ``particle_index``. The store is read
|
|
7
|
+
with the triage server's own loader; a re-check queue (name starting ``recheck-``) is read from
|
|
8
|
+
its own store, ``<flight>.recheck.json``, exactly as the server shows it.
|
|
9
|
+
|
|
10
|
+
Two crossings per queue:
|
|
11
|
+
|
|
12
|
+
* **per size bin**: verdict counts, and the phase recorded beside each verdict in
|
|
13
|
+
``phase_verdicts`` (default ``real``), with the ice fraction ``ice / (ice + drizzle)`` and a
|
|
14
|
+
Wilson 95 % interval. Bins with no ice or drizzle label get no fraction and are named.
|
|
15
|
+
* **per reject code** (the code each particle carried when the queue was drawn): verdict counts
|
|
16
|
+
per size bin, and for the code as a whole how many particles it **rejected that the reviewer
|
|
17
|
+
labelled real**, or, for an accepted code, how many it **accepted that the reviewer labelled
|
|
18
|
+
artifact**.
|
|
19
|
+
|
|
20
|
+
The reject code is read from the queue item's ``reject_code`` field when there is one, else from
|
|
21
|
+
the ``code X`` in the note ``arrayprobe.tune.sample.queue_items`` writes beside each particle; a
|
|
22
|
+
particle with neither is counted under ``unknown``. Nothing here reads a proc file, runs the
|
|
23
|
+
pipeline or writes anything but the report.
|
|
24
|
+
"""
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
import math
|
|
28
|
+
import re
|
|
29
|
+
from collections.abc import Callable, Sequence
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
from arrayprobe.matlab_compat import REJECT_CODE_WORDS
|
|
33
|
+
from arrayprobe.tune.sample import ACCEPTED_CODES, COVERAGE_KEY
|
|
34
|
+
|
|
35
|
+
VERDICTS = ("real", "artifact", "mixed", "unsure")
|
|
36
|
+
PHASES = ("ice", "drizzle", "unsure")
|
|
37
|
+
UNKNOWN_CODE = "unknown"
|
|
38
|
+
_NOTE_CODE_RE = re.compile(r"(?:^|,\s*)code (\S+?)(?:,|$)")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def wilson(k: float, n: float, z: float = 1.959963984540054) -> tuple[float, float]:
|
|
42
|
+
"""Wilson score interval; ``(nan, nan)`` for n == 0 (as ``scripts/score_ena_reject_fields``)."""
|
|
43
|
+
if n <= 0:
|
|
44
|
+
return (math.nan, math.nan)
|
|
45
|
+
p = k / n
|
|
46
|
+
den = 1 + z * z / n
|
|
47
|
+
mid = (p + z * z / (2 * n)) / den
|
|
48
|
+
half = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / den
|
|
49
|
+
return (max(0.0, mid - half), min(1.0, mid + half))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def reject_code_of(item: dict) -> str:
|
|
53
|
+
"""The reject code a queue item carries, as a character, or :data:`UNKNOWN_CODE`."""
|
|
54
|
+
code = item.get("reject_code")
|
|
55
|
+
if code is not None:
|
|
56
|
+
return str(code)
|
|
57
|
+
m = _NOTE_CODE_RE.search(str(item.get("note", "")))
|
|
58
|
+
return m.group(1) if m else UNKNOWN_CODE
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _verdict_counts() -> dict:
|
|
62
|
+
return {**{f"v_{v}": 0 for v in VERDICTS}, "v_other": 0}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _bins_of(items: list[dict], coverage: dict | None) -> tuple[list[str | None], dict]:
|
|
66
|
+
# str | None: an item without a size_bin contributes None as its own bin below.
|
|
67
|
+
if coverage and coverage.get("strata"):
|
|
68
|
+
bins = [s["bin"] for s in coverage["strata"]]
|
|
69
|
+
available = {s["bin"]: int(s["available"]) for s in coverage["strata"]}
|
|
70
|
+
else:
|
|
71
|
+
bins, available = [], {}
|
|
72
|
+
for item in items:
|
|
73
|
+
if item.get("size_bin") not in bins:
|
|
74
|
+
bins.append(item.get("size_bin"))
|
|
75
|
+
return bins, available
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _score(items: list[dict], record: Callable[[dict], object], coverage: dict | None,
|
|
79
|
+
phase_verdicts: Sequence[str]) -> dict:
|
|
80
|
+
bins, available = _bins_of(items, coverage)
|
|
81
|
+
rows = {b: {"bin": b, "available": available.get(b), "queued": 0, "labelled": 0,
|
|
82
|
+
**_verdict_counts(),
|
|
83
|
+
**{f"p_{p}": 0 for p in PHASES}, "p_none": 0, "p_other": 0}
|
|
84
|
+
for b in bins}
|
|
85
|
+
for item in items:
|
|
86
|
+
row = rows[item.get("size_bin")]
|
|
87
|
+
row["queued"] += 1
|
|
88
|
+
rec = record(item)
|
|
89
|
+
if not isinstance(rec, dict):
|
|
90
|
+
continue
|
|
91
|
+
row["labelled"] += 1
|
|
92
|
+
v = rec.get("verdict")
|
|
93
|
+
row[f"v_{v}" if v in VERDICTS else "v_other"] += 1
|
|
94
|
+
if v not in phase_verdicts:
|
|
95
|
+
continue
|
|
96
|
+
p = rec.get("phase")
|
|
97
|
+
row["p_none" if p is None else (f"p_{p}" if p in PHASES else "p_other")] += 1
|
|
98
|
+
weighted_num = weighted_den = 0.0
|
|
99
|
+
excluded = []
|
|
100
|
+
for b in bins:
|
|
101
|
+
r = rows[b]
|
|
102
|
+
n = r["p_ice"] + r["p_drizzle"]
|
|
103
|
+
r["decided"] = n
|
|
104
|
+
if n:
|
|
105
|
+
r["ice_fraction"] = r["p_ice"] / n
|
|
106
|
+
r["wilson95"] = list(wilson(r["p_ice"], n))
|
|
107
|
+
if r["available"] is not None:
|
|
108
|
+
weighted_num += r["available"] * r["ice_fraction"]
|
|
109
|
+
weighted_den += r["available"]
|
|
110
|
+
else:
|
|
111
|
+
r["ice_fraction"] = None
|
|
112
|
+
r["wilson95"] = None
|
|
113
|
+
excluded.append({"bin": b, "available": r["available"], "labelled": r["labelled"]})
|
|
114
|
+
return {"rows": [rows[b] for b in bins],
|
|
115
|
+
"weighted_ice_fraction": weighted_num / weighted_den if weighted_den else None,
|
|
116
|
+
"weighted_over_available": int(weighted_den),
|
|
117
|
+
"excluded_bins": excluded,
|
|
118
|
+
"phase_verdicts": list(phase_verdicts)}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def score_queue(items: list[dict], verdicts: dict, coverage: dict,
|
|
122
|
+
phase_verdicts: Sequence[str] = ("real",)) -> dict:
|
|
123
|
+
"""Per-bin counts and fractions for one queue whose particles are all in ``verdicts``.
|
|
124
|
+
|
|
125
|
+
``verdicts`` is one flight's store as the triage server loads it (particle index as a
|
|
126
|
+
string to record). The fraction is weighted by each bin's ``available`` count from the
|
|
127
|
+
coverage block; bins with no decided label are left out of the weighting and named.
|
|
128
|
+
"""
|
|
129
|
+
return _score(items, lambda it: verdicts.get(str(int(it["particle_index"]))), coverage,
|
|
130
|
+
phase_verdicts)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def cross_codes(items: list[dict], record: Callable[[dict], object],
|
|
134
|
+
accepted_codes: str = ACCEPTED_CODES) -> list[dict]:
|
|
135
|
+
"""Per reject code: verdict counts per size bin and in total, and the disagreement count.
|
|
136
|
+
|
|
137
|
+
For a code outside ``accepted_codes`` the disagreement is the particles it rejected that
|
|
138
|
+
the reviewer labelled real; for an accepted code, those it accepted labelled artifact.
|
|
139
|
+
"""
|
|
140
|
+
out: dict[str, dict] = {}
|
|
141
|
+
for item in items:
|
|
142
|
+
code = reject_code_of(item)
|
|
143
|
+
c = out.setdefault(code, {
|
|
144
|
+
"code": code, "words": REJECT_CODE_WORDS.get(code),
|
|
145
|
+
"accepted": None if code == UNKNOWN_CODE else code in accepted_codes,
|
|
146
|
+
"queued": 0, "labelled": 0, **_verdict_counts(), "bins": {}})
|
|
147
|
+
b = c["bins"].setdefault(item.get("size_bin"),
|
|
148
|
+
{"queued": 0, "labelled": 0, **_verdict_counts()})
|
|
149
|
+
for d in (c, b):
|
|
150
|
+
d["queued"] += 1
|
|
151
|
+
rec = record(item)
|
|
152
|
+
if not isinstance(rec, dict):
|
|
153
|
+
continue
|
|
154
|
+
v = rec.get("verdict")
|
|
155
|
+
key = f"v_{v}" if v in VERDICTS else "v_other"
|
|
156
|
+
for d in (c, b):
|
|
157
|
+
d["labelled"] += 1
|
|
158
|
+
d[key] += 1
|
|
159
|
+
rows = []
|
|
160
|
+
for code in sorted(out):
|
|
161
|
+
c = out[code]
|
|
162
|
+
c["rejected_labelled_real"] = c["v_real"] if c["accepted"] is False else None
|
|
163
|
+
c["accepted_labelled_artifact"] = c["v_artifact"] if c["accepted"] else None
|
|
164
|
+
rows.append(c)
|
|
165
|
+
return rows
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def store_lookup(decoded_dir: Path) -> Callable[[str, dict], object]:
|
|
169
|
+
"""``record(queue_name, item)`` reading the triage verdict store, one load per store."""
|
|
170
|
+
from arrayprobe.triage_server import _load_verdicts, is_recheck_queue
|
|
171
|
+
|
|
172
|
+
cache: dict[tuple[str, bool], dict] = {}
|
|
173
|
+
|
|
174
|
+
def record(queue: str, item: dict):
|
|
175
|
+
key = (str(item["flight"]), is_recheck_queue(queue))
|
|
176
|
+
if key not in cache:
|
|
177
|
+
cache[key] = _load_verdicts(Path(decoded_dir), key[0], recheck=key[1])
|
|
178
|
+
return cache[key].get(str(int(item["particle_index"])))
|
|
179
|
+
|
|
180
|
+
return record
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def score_file(queue_data: dict, decoded_dir: Path,
|
|
184
|
+
phase_verdicts: Sequence[str] = ("real",)) -> dict:
|
|
185
|
+
"""The report for every queue in a loaded queue file (underscore keys are metadata)."""
|
|
186
|
+
from arrayprobe.triage_server import is_recheck_queue
|
|
187
|
+
|
|
188
|
+
unknown = [v for v in phase_verdicts if v not in VERDICTS]
|
|
189
|
+
if unknown:
|
|
190
|
+
raise ValueError(f"unknown verdict(s) {unknown}; known: {list(VERDICTS)}")
|
|
191
|
+
lookup = store_lookup(decoded_dir)
|
|
192
|
+
coverages = queue_data.get(COVERAGE_KEY, {}) or {}
|
|
193
|
+
queues = {}
|
|
194
|
+
for name in sorted(n for n in queue_data if not n.startswith("_")):
|
|
195
|
+
items = queue_data[name]
|
|
196
|
+
cov = coverages.get(name)
|
|
197
|
+
accepted = (cov.get("accepted_codes") if cov and cov.get("accepted_codes")
|
|
198
|
+
else ACCEPTED_CODES)
|
|
199
|
+
|
|
200
|
+
def record(item, _name=name):
|
|
201
|
+
return lookup(_name, item)
|
|
202
|
+
|
|
203
|
+
queues[name] = {
|
|
204
|
+
"store": "recheck" if is_recheck_queue(name) else "first",
|
|
205
|
+
"flights": sorted({str(it["flight"]) for it in items}),
|
|
206
|
+
"accepted_codes": accepted,
|
|
207
|
+
"by_bin": _score(items, record, cov, phase_verdicts),
|
|
208
|
+
"by_code": cross_codes(items, record, accepted),
|
|
209
|
+
}
|
|
210
|
+
return {"decoded_dir": str(decoded_dir), "phase_verdicts": list(phase_verdicts),
|
|
211
|
+
"queues": queues}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def summary_lines(report: dict) -> list[str]:
|
|
215
|
+
"""Per queue and reject code: labelled count, and the disagreement with the run."""
|
|
216
|
+
lines = []
|
|
217
|
+
for name, q in report["queues"].items():
|
|
218
|
+
n_lab = sum(r["labelled"] for r in q["by_bin"]["rows"])
|
|
219
|
+
n_q = sum(r["queued"] for r in q["by_bin"]["rows"])
|
|
220
|
+
lines.append(f"{name} ({q['store']} store): {n_lab} of {n_q} labelled")
|
|
221
|
+
for c in q["by_code"]:
|
|
222
|
+
if c["accepted"] is None:
|
|
223
|
+
what = "code unknown"
|
|
224
|
+
elif c["accepted"]:
|
|
225
|
+
what = f"accepted, {c['accepted_labelled_artifact']} labelled artifact"
|
|
226
|
+
else:
|
|
227
|
+
what = f"rejected, {c['rejected_labelled_real']} labelled real"
|
|
228
|
+
lines.append(f" code {c['code']:>7s}: {c['labelled']:4d} of {c['queued']:4d} "
|
|
229
|
+
f"labelled; {what}")
|
|
230
|
+
return lines
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
"""Every setting a user can change for the v3.5 engine, and whether it reaches the output.
|
|
3
|
+
|
|
4
|
+
One row per setting in :data:`SETTINGS`. Each row says what the setting does, its default, where
|
|
5
|
+
it is set, whether ``--engine 3.5`` accepts it, and -- through :meth:`Setting.effect` -- whether it
|
|
6
|
+
has any effect on a given probe case. Every default and location is cited to a ``file:line`` and
|
|
7
|
+
the substring that line holds (:class:`Cite`); ``tests/test_tune_settings.py`` reads each one.
|
|
8
|
+
|
|
9
|
+
**Why the probe case and the run's iaThreshType matter.** The shattering (inter-arrival)
|
|
10
|
+
settings act only when the probe case's ``applyIntArrThresh`` is 1 *and* the run's
|
|
11
|
+
``iaThreshType`` is not 0. ``arrayprobe_uiops.sizedist.apply_shattering`` returns before any test
|
|
12
|
+
when ``iaThreshType`` is 0 (``sizedist.py:625``, mirroring ``sizeDist.m``'s
|
|
13
|
+
``if iaThreshType==1``/``==2``/``==3`` branches), and inside each branch when the gate is 0
|
|
14
|
+
(``:634``, ``:657``, ``:692``). Engine 3.5 runs with ``iaThreshType`` 0 unless a threshold file
|
|
15
|
+
(type 1) or ``[shattering].ia_thresh_type = 2`` is given, so on a gate-on case the default run
|
|
16
|
+
still changes no particle. ``defaultIntArrThresh`` is read only by type 2 (``sizeDist.m:520``);
|
|
17
|
+
type 1 reads the file's thresholds instead. The shipped 2D-S case ``v35-2ds-ladder-fix`` (the
|
|
18
|
+
case the batch driver applies by default to a 2D-S on engine 3.5) takes v3.5's
|
|
19
|
+
``otherwise``/``'2DS'`` record, whose gate is 0 (``sizeDist.m:514``), so a threshold file is
|
|
20
|
+
accepted and stamped there and changes no particle.
|
|
21
|
+
|
|
22
|
+
**Where values come from.** ``TOML`` is a run-file key (``arrayprobe run run.toml``), ``CLI`` a
|
|
23
|
+
``scripts/run_flight.py`` flag (source ``arrayprobe.driver.run_flight``), ``authordefaults`` the
|
|
24
|
+
``[fidelity].authordefaults`` cited-overrides file, ``profile`` a registered ``FidelityProfile``,
|
|
25
|
+
``probe case`` a registered ``arrayprobe_uiops.probe_cases.ProbeCase`` (Python only), ``preset`` the
|
|
26
|
+
required ``--preset``.
|
|
27
|
+
|
|
28
|
+
Importing this module loads nothing from the v3.5 engine; :func:`resolve_probe_defaults` imports it
|
|
29
|
+
only when called.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
import dataclasses
|
|
35
|
+
import importlib
|
|
36
|
+
from typing import Any
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
"Cite",
|
|
40
|
+
"Effect",
|
|
41
|
+
"Setting",
|
|
42
|
+
"SETTINGS",
|
|
43
|
+
"settings_by_name",
|
|
44
|
+
"resolve_probe_defaults",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
#: Vendored v3.5 sources and the port's files, relative to the repository root.
|
|
48
|
+
_V35 = "UIOPS-v3.5/joefinlon-UIOPS-039be82"
|
|
49
|
+
_SIZEDIST_M = f"{_V35}/sizeDist.m"
|
|
50
|
+
_REJECT_M = f"{_V35}/calculate_reject_unified.m"
|
|
51
|
+
_RUN_FLIGHT = "src/arrayprobe/driver/run_flight.py"
|
|
52
|
+
_CONFIG = "src/arrayprobe/config.py"
|
|
53
|
+
_REGIMES = "src/arrayprobe/regimes.py"
|
|
54
|
+
#: RejectConfig's defaults live in the v3.5 engine and v3.1.4 imports them (one copy).
|
|
55
|
+
_REJECT_PY = "src/arrayprobe_uiops/reject_core.py"
|
|
56
|
+
_AUTHORDEFAULTS = "src/arrayprobe/authordefaults.py"
|
|
57
|
+
_V35_SIZEDIST = "src/arrayprobe_uiops/sizedist.py"
|
|
58
|
+
_V35_PROFILE = "src/arrayprobe_uiops/profile.py"
|
|
59
|
+
_PROBE_CASES = "src/arrayprobe_uiops/probe_cases.py"
|
|
60
|
+
_PARITY_TEST = "tests/test_engine_flag_parity.py"
|
|
61
|
+
|
|
62
|
+
ACCEPTED = "accepted"
|
|
63
|
+
REFUSED = "refused (exit 2)"
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclasses.dataclass(frozen=True)
|
|
67
|
+
class Cite:
|
|
68
|
+
"""``path:line`` (repository-relative, 1-based) and a substring that line contains."""
|
|
69
|
+
|
|
70
|
+
path: str
|
|
71
|
+
line: int
|
|
72
|
+
contains: str
|
|
73
|
+
|
|
74
|
+
def __str__(self) -> str:
|
|
75
|
+
return f"{self.path}:{self.line}"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@dataclasses.dataclass(frozen=True)
|
|
79
|
+
class Effect:
|
|
80
|
+
"""Whether a setting changes the output on one probe case, and why."""
|
|
81
|
+
|
|
82
|
+
effective: bool
|
|
83
|
+
reason: str
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
_GATE_OFF = "no effect: the gate is off on this probe case (applyIntArrThresh = 0)"
|
|
87
|
+
_TYPE_0 = "no effect: iaThreshType 0, the default for engine 3.5 without a threshold file"
|
|
88
|
+
_TYPE_UNREAD = "no effect: iaThreshType {t} does not read it"
|
|
89
|
+
_ACTS = "acts: the gate is on (applyIntArrThresh = 1) and iaThreshType is {t}"
|
|
90
|
+
_REFUSED_35 = "no effect: engine 3.5 refuses it (exit 2)"
|
|
91
|
+
_UNGATED = "effect: not gated by the probe case"
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclasses.dataclass(frozen=True)
|
|
95
|
+
class Setting:
|
|
96
|
+
"""One row of :data:`SETTINGS`."""
|
|
97
|
+
|
|
98
|
+
name: str
|
|
99
|
+
does: str
|
|
100
|
+
default: str
|
|
101
|
+
where: tuple[str, ...]
|
|
102
|
+
engine_35: str
|
|
103
|
+
cites: tuple[Cite, ...]
|
|
104
|
+
shattering_gated: bool = False
|
|
105
|
+
#: The iaThreshType values whose branch reads this setting (shattering rows only).
|
|
106
|
+
read_by_ia_thresh_types: tuple[int, ...] = (1, 2, 3)
|
|
107
|
+
#: The iaThreshType that setting this row selects (the threshold file selects 1).
|
|
108
|
+
selects_ia_thresh_type: int | None = None
|
|
109
|
+
|
|
110
|
+
def effect(self, probe_case: Any, ia_thresh_type: int = 0) -> Effect:
|
|
111
|
+
"""Whether this setting changes the v3.5 output on ``probe_case``.
|
|
112
|
+
|
|
113
|
+
``probe_case`` is a registered case name (``"v35-2ds-ladder-fix"``), an
|
|
114
|
+
``arrayprobe_uiops.probe_cases.ProbeCase`` or an
|
|
115
|
+
``arrayprobe_uiops.sizedist_tables.ProbeDefaults``
|
|
116
|
+
(what ``probe_defaults(project, probe)`` returns for a campaign's own case).
|
|
117
|
+
``ia_thresh_type`` is the run's ``iaThreshType``; 0, the default, is what engine 3.5
|
|
118
|
+
runs without a threshold file or ``[shattering].ia_thresh_type``.
|
|
119
|
+
"""
|
|
120
|
+
if self.engine_35 != ACCEPTED:
|
|
121
|
+
return Effect(False, _REFUSED_35)
|
|
122
|
+
if not self.shattering_gated:
|
|
123
|
+
return Effect(True, _UNGATED)
|
|
124
|
+
if ia_thresh_type not in (0, 1, 2, 3):
|
|
125
|
+
raise ValueError(f"iaThreshType is 0, 1, 2 or 3; got {ia_thresh_type!r}")
|
|
126
|
+
if not resolve_probe_defaults(probe_case).applyIntArrThresh:
|
|
127
|
+
return Effect(False, _GATE_OFF)
|
|
128
|
+
t = self.selects_ia_thresh_type
|
|
129
|
+
if t is None:
|
|
130
|
+
t = ia_thresh_type
|
|
131
|
+
if t == 0:
|
|
132
|
+
return Effect(False, _TYPE_0)
|
|
133
|
+
if t not in self.read_by_ia_thresh_types:
|
|
134
|
+
return Effect(False, _TYPE_UNREAD.format(t=t))
|
|
135
|
+
return Effect(True, _ACTS.format(t=t))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def resolve_probe_defaults(probe_case: Any) -> Any:
|
|
139
|
+
"""The ``ProbeDefaults`` record behind ``probe_case`` (see :meth:`Setting.effect`)."""
|
|
140
|
+
from arrayprobe_uiops import probe_cases
|
|
141
|
+
from arrayprobe_uiops.sizedist_tables import ProbeDefaults
|
|
142
|
+
|
|
143
|
+
if isinstance(probe_case, ProbeDefaults):
|
|
144
|
+
return probe_case
|
|
145
|
+
if isinstance(probe_case, probe_cases.ProbeCase):
|
|
146
|
+
return probe_case.defaults
|
|
147
|
+
if isinstance(probe_case, str):
|
|
148
|
+
# Development-tree cases registered by modules a distribution may not carry.
|
|
149
|
+
dev_cases = {"arm-ena-2ds": "arrayprobe_uiops.register_arm_ena_2ds",
|
|
150
|
+
"arm-ena-2ds-cold": "arrayprobe_uiops.register_arm_ena_2ds_cold"}
|
|
151
|
+
if probe_case in dev_cases and probe_case not in probe_cases.PROBE_CASES:
|
|
152
|
+
try:
|
|
153
|
+
importlib.import_module(dev_cases[probe_case])
|
|
154
|
+
except ModuleNotFoundError:
|
|
155
|
+
# A distribution without the ARM ENA registration modules: fall through,
|
|
156
|
+
# so the name is refused as any unregistered case is.
|
|
157
|
+
pass
|
|
158
|
+
# The shipped case registers on first use, as in the batch driver's preflight.
|
|
159
|
+
return probe_cases.resolve_shipped_probe_case(probe_case).defaults
|
|
160
|
+
raise TypeError(
|
|
161
|
+
f"probe_case must be a registered name, a ProbeCase or a ProbeDefaults; got {probe_case!r}"
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
_PRESET_WHERE = ("preset (CLI --preset, required)",)
|
|
166
|
+
_PROBE_WHERE = ("probe case (register_probe_case, Python only; selected by CLI --probe-case)",)
|
|
167
|
+
_REJECT_WHERE = ("profile reject_thresholds (register_profile, Python only)",
|
|
168
|
+
"authordefaults ([fidelity].authordefaults file)")
|
|
169
|
+
_PROFILE_KEYS = Cite(_CONFIG, 223, '"fidelity": {"profile", "profile_module", "authordefaults"}')
|
|
170
|
+
_AD_KEYS = Cite(_AUTHORDEFAULTS, 70, "THRESHOLD_KEYS")
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _reject(name: str, does: str, default: str, m_line: int, m_text: str, py_line: int,
|
|
174
|
+
py_text: str, prof_line: int) -> Setting:
|
|
175
|
+
return Setting(
|
|
176
|
+
name=name, does=does, default=default, where=_REJECT_WHERE, engine_35=ACCEPTED,
|
|
177
|
+
cites=(Cite(_REJECT_M, m_line, m_text), Cite(_REJECT_PY, py_line, py_text),
|
|
178
|
+
Cite(_V35_PROFILE, prof_line, f"reject_thresholds.{name}"), _PROFILE_KEYS,
|
|
179
|
+
_AD_KEYS),
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
SETTINGS: tuple[Setting, ...] = (
|
|
184
|
+
# --- the size-distribution stage's own thresholds -------------------------------------
|
|
185
|
+
Setting(
|
|
186
|
+
name="area_ratio_z",
|
|
187
|
+
does="Rejects a particle (reject code 'z') whose area ratio is below this value.",
|
|
188
|
+
default="0.2",
|
|
189
|
+
where=("TOML [thresholds].area_ratio_z", "CLI --area-ratio-z"),
|
|
190
|
+
engine_35=ACCEPTED,
|
|
191
|
+
cites=(Cite(_SIZEDIST_M, 1162, "area_ratio < .2"),
|
|
192
|
+
Cite(_RUN_FLIGHT, 7156, '"--area-ratio-z"'),
|
|
193
|
+
Cite(_CONFIG, 85, "area_ratio_z"),
|
|
194
|
+
Cite(_V35_SIZEDIST, 1015, "area_ratio_z=None")),
|
|
195
|
+
),
|
|
196
|
+
Setting(
|
|
197
|
+
name="regime",
|
|
198
|
+
does="Names a bundle of the area-ratio gate and the shattering threshold.",
|
|
199
|
+
default="none",
|
|
200
|
+
where=("TOML [thresholds].regime", "CLI --regime"),
|
|
201
|
+
engine_35=ACCEPTED,
|
|
202
|
+
cites=(Cite(_RUN_FLIGHT, 7143, '"--regime"'),
|
|
203
|
+
Cite(_CONFIG, 84, 'regime = "ice"'),
|
|
204
|
+
Cite(_REGIMES, 123, "area_ratio_z: float"),
|
|
205
|
+
Cite(_REGIMES, 125, "default_int_arr_thresh: float"),
|
|
206
|
+
Cite(_RUN_FLIGHT, 1421, "def _v35_s4_thresholds"),
|
|
207
|
+
Cite(_PARITY_TEST, 280, "test_regime_is_accepted_under_engine_35")),
|
|
208
|
+
),
|
|
209
|
+
Setting(
|
|
210
|
+
name="default_int_arr_thresh (driver override)",
|
|
211
|
+
does="Replaces the probe case's shattering threshold with a raw value.",
|
|
212
|
+
default="none (the probe case's defaultIntArrThresh)",
|
|
213
|
+
where=("TOML [thresholds].default_int_arr_thresh", "CLI --default-int-arr-thresh"),
|
|
214
|
+
engine_35=ACCEPTED,
|
|
215
|
+
cites=(Cite(_RUN_FLIGHT, 7168, '"--default-int-arr-thresh"'),
|
|
216
|
+
Cite(_CONFIG, 86, "default_int_arr_thresh"),
|
|
217
|
+
Cite(_V35_SIZEDIST, 1016, "default_int_arr_thresh=None"),
|
|
218
|
+
Cite(_RUN_FLIGHT, 1421, "def _v35_s4_thresholds"),
|
|
219
|
+
Cite(_PARITY_TEST, 330, "test_default_int_arr_thresh_is_accepted_under_engine_35")),
|
|
220
|
+
# sizedist.run's docstring: read only by the iaThreshType == 2 && applyIntArrThresh block.
|
|
221
|
+
shattering_gated=True,
|
|
222
|
+
read_by_ia_thresh_types=(2,),
|
|
223
|
+
),
|
|
224
|
+
# --- shattering: the threshold file and the probe case's constants ---------------------
|
|
225
|
+
Setting(
|
|
226
|
+
name="shattering threshold file",
|
|
227
|
+
does=("Names a per-time inter-arrival threshold file (sizeDist's iaThreshFile); with one, "
|
|
228
|
+
"the run uses iaThreshType 1, without one iaThreshType 0 (or 2, when "
|
|
229
|
+
"[shattering].ia_thresh_type = 2)."),
|
|
230
|
+
default="none under engine 3.5 (iaThreshType 0)",
|
|
231
|
+
where=("TOML [shattering].threshold_file", "CLI --iat-file"),
|
|
232
|
+
engine_35=ACCEPTED,
|
|
233
|
+
cites=(Cite(_RUN_FLIGHT, 6926, '"--iat-file"'),
|
|
234
|
+
Cite(_CONFIG, 58, "threshold_file"),
|
|
235
|
+
Cite(_RUN_FLIGHT, 5686,
|
|
236
|
+
'engine == "3.5" and cfg.shattering_threshold_file is None'),
|
|
237
|
+
Cite(_RUN_FLIGHT, 1801, "derived per run from ``--iat-file``"),
|
|
238
|
+
Cite(_SIZEDIST_M, 99, "if iaThreshType==1"),
|
|
239
|
+
Cite(_V35_SIZEDIST, 745, "cfg.applyIntArrThresh")),
|
|
240
|
+
shattering_gated=True,
|
|
241
|
+
read_by_ia_thresh_types=(1,),
|
|
242
|
+
selects_ia_thresh_type=1,
|
|
243
|
+
),
|
|
244
|
+
Setting(
|
|
245
|
+
name="applyIntArrThresh",
|
|
246
|
+
does="Turns the shattering (inter-arrival) rejection on or off for the probe case.",
|
|
247
|
+
default="per probe case; v35-2ds-ladder-fix: 0 (off)",
|
|
248
|
+
where=_PROBE_WHERE,
|
|
249
|
+
engine_35=ACCEPTED,
|
|
250
|
+
cites=(Cite(_SIZEDIST_M, 514, "applyIntArrThresh = 0"),
|
|
251
|
+
Cite(_V35_SIZEDIST, 1528, "apply_int_arr_thresh = cfg.applyIntArrThresh"),
|
|
252
|
+
Cite(_PROBE_CASES, 139, "def register_probe_case"),
|
|
253
|
+
Cite(_RUN_FLIGHT, 7101, '"--probe-case"')),
|
|
254
|
+
),
|
|
255
|
+
Setting(
|
|
256
|
+
name="defaultIntArrThresh",
|
|
257
|
+
does="Inter-arrival time (s) below which a particle is rejected as a shattering fragment.",
|
|
258
|
+
default="per probe case; v35-2ds-ladder-fix: 4e-6 s",
|
|
259
|
+
where=_PROBE_WHERE,
|
|
260
|
+
engine_35=ACCEPTED,
|
|
261
|
+
cites=(Cite(_SIZEDIST_M, 515, "defaultIntArrThresh = 4e-6"),
|
|
262
|
+
Cite(_SIZEDIST_M, 520, "intar_threshold = ones(size(tas_time))*defaultIntArrThresh"),
|
|
263
|
+
Cite(_V35_SIZEDIST, 771, "if not cfg.applyIntArrThresh")),
|
|
264
|
+
shattering_gated=True,
|
|
265
|
+
read_by_ia_thresh_types=(2,),
|
|
266
|
+
),
|
|
267
|
+
Setting(
|
|
268
|
+
name="reaccptShatrs",
|
|
269
|
+
does="Re-accepts particles the shattering test rejected, by the two limits below.",
|
|
270
|
+
default="per probe case; v35-2ds-ladder-fix: 0 (off)",
|
|
271
|
+
where=_PROBE_WHERE,
|
|
272
|
+
engine_35=ACCEPTED,
|
|
273
|
+
cites=(Cite(_SIZEDIST_M, 516, "reaccptShatrs = 0"),
|
|
274
|
+
Cite(_V35_SIZEDIST, 932, "if apply_int_arr_thresh and reaccpt_shatrs")),
|
|
275
|
+
shattering_gated=True,
|
|
276
|
+
),
|
|
277
|
+
Setting(
|
|
278
|
+
name="reaccptD",
|
|
279
|
+
does="Minimum size (mm) of a shattering-rejected particle that may be re-accepted.",
|
|
280
|
+
default="per probe case; v35-2ds-ladder-fix: 0.5",
|
|
281
|
+
where=_PROBE_WHERE,
|
|
282
|
+
engine_35=ACCEPTED,
|
|
283
|
+
cites=(Cite(_SIZEDIST_M, 517, "reaccptD = 0.5"),
|
|
284
|
+
Cite(_V35_SIZEDIST, 932, "if apply_int_arr_thresh and reaccpt_shatrs")),
|
|
285
|
+
shattering_gated=True,
|
|
286
|
+
),
|
|
287
|
+
Setting(
|
|
288
|
+
name="reaccptMaxIA",
|
|
289
|
+
does="Maximum inter-arrival time (s) for a shattering-rejected particle to be re-accepted.",
|
|
290
|
+
default="per probe case; v35-2ds-ladder-fix: 1e-6 s",
|
|
291
|
+
where=_PROBE_WHERE,
|
|
292
|
+
engine_35=ACCEPTED,
|
|
293
|
+
cites=(Cite(_SIZEDIST_M, 518, "reaccptMaxIA = 1e-6"),
|
|
294
|
+
Cite(_V35_SIZEDIST, 932, "if apply_int_arr_thresh and reaccpt_shatrs")),
|
|
295
|
+
shattering_gated=True,
|
|
296
|
+
),
|
|
297
|
+
# --- the six image-stage reject thresholds ---------------------------------------------
|
|
298
|
+
_reject("rej_zero_area", "Rejects a particle with zero area.", "1 (on)",
|
|
299
|
+
60, "handles.rej_zero_area = 1", 47, "rej_zero_area: bool = True", 59),
|
|
300
|
+
_reject("rej_split", "Rejects a particle split into separate pieces.", "1 (on)",
|
|
301
|
+
61, "handles.rej_split = 1", 53, "rej_split: bool = True", 61),
|
|
302
|
+
_reject("rej_hollow", "Rejects a hollow (out-of-focus drop) image.", "1 (on)",
|
|
303
|
+
62, "handles.rej_hollow = 1", 56, "rej_hollow: bool = True", 63),
|
|
304
|
+
_reject("shadowed_area",
|
|
305
|
+
"Rejects a particle (code 'p') shadowing less than this percentage of its bounding "
|
|
306
|
+
"rectangle.", "25",
|
|
307
|
+
64, "handles.shadowed_area = 25", 60, "shadowed_area: float = 25", 65),
|
|
308
|
+
_reject("max_edge_img_ar",
|
|
309
|
+
"Aspect-ratio ceiling for a particle touching the array edge.", "6",
|
|
310
|
+
65, "handles.max_edge_img_ar = 6", 65, "max_edge_img_ar: float = 6", 67),
|
|
311
|
+
_reject("max_comp_img_ar",
|
|
312
|
+
"Aspect-ratio ceiling (code 'a') for a particle wholly inside the array.", "5",
|
|
313
|
+
66, "handles.max_comp_img_ar = 5", 71, "max_comp_img_ar: float = 5", 69),
|
|
314
|
+
# --- the preset: sizeDist's call arguments ---------------------------------------------
|
|
315
|
+
Setting(
|
|
316
|
+
name="d_choice",
|
|
317
|
+
does="Chooses which particle dimension is used as its size.",
|
|
318
|
+
default="set by the preset (ORACLES_2016_2DS_H: 6, the minimum enclosing circle)",
|
|
319
|
+
where=_PRESET_WHERE,
|
|
320
|
+
engine_35=ACCEPTED,
|
|
321
|
+
cites=(Cite(_SIZEDIST_M, 90, "d_choice"), Cite(_RUN_FLIGHT, 191, "d_choice: int"),
|
|
322
|
+
Cite(_RUN_FLIGHT, 203, "d_choice=6")),
|
|
323
|
+
),
|
|
324
|
+
Setting(
|
|
325
|
+
name="SAmethod",
|
|
326
|
+
does="Chooses the sample-area method.",
|
|
327
|
+
default="set by the preset (ORACLES_2016_2DS_H: 0, centre-in)",
|
|
328
|
+
where=_PRESET_WHERE,
|
|
329
|
+
engine_35=ACCEPTED,
|
|
330
|
+
cites=(Cite(_SIZEDIST_M, 90, "SAmethod"), Cite(_RUN_FLIGHT, 192, "sa_method: int"),
|
|
331
|
+
Cite(_RUN_FLIGHT, 204, "sa_method=0")),
|
|
332
|
+
),
|
|
333
|
+
Setting(
|
|
334
|
+
name="Pres",
|
|
335
|
+
does="Static pressure (Pa) passed to sizeDist.",
|
|
336
|
+
default="set by the preset",
|
|
337
|
+
where=_PRESET_WHERE,
|
|
338
|
+
engine_35=ACCEPTED,
|
|
339
|
+
cites=(Cite(_SIZEDIST_M, 90, "Pres"), Cite(_RUN_FLIGHT, 193, "pres_pa: float")),
|
|
340
|
+
),
|
|
341
|
+
Setting(
|
|
342
|
+
name="Temp",
|
|
343
|
+
does="Temperature (C) passed to sizeDist.",
|
|
344
|
+
default="set by the preset",
|
|
345
|
+
where=_PRESET_WHERE,
|
|
346
|
+
engine_35=ACCEPTED,
|
|
347
|
+
cites=(Cite(_SIZEDIST_M, 90, "Temp"), Cite(_RUN_FLIGHT, 194, "temp_c: float")),
|
|
348
|
+
),
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def settings_by_name() -> dict[str, Setting]:
|
|
353
|
+
""":data:`SETTINGS` keyed by row name."""
|
|
354
|
+
return {s.name: s for s in SETTINGS}
|