Skip to content

Commit

Permalink
Add tests for the Correlator
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Feb 16, 2022
1 parent 2eb6306 commit 920e367
Show file tree
Hide file tree
Showing 2 changed files with 576 additions and 3 deletions.
10 changes: 7 additions & 3 deletions extra_foam/pipeline/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def data_with_assembled(cls, tid, shape, *,
histogram=False,
correlation=False,
binning=False,
with_fast_data=[],
**kwargs):
imgs = cls._gen_images(gen, shape, dtype)
processed = cls.processed_data(tid, shape, gen=gen, dtype=dtype,
Expand Down Expand Up @@ -90,6 +91,11 @@ def data_with_assembled(cls, tid, shape, *,
for ch in digitizer:
digitizer[ch].pulse_integral = np.random.rand(n_pulses)

raw_data = { "META timestamp.tid": tid }
if with_fast_data:
for pipeline, pipeline_property in with_fast_data:
raw_data[f"{pipeline} {pipeline_property}"] = np.random.rand(100)

data = {
'processed': processed,
'catalog': catalog,
Expand All @@ -99,9 +105,7 @@ def data_with_assembled(cls, tid, shape, *,
'source_type': src_type,
}
},
'raw': {
src: dict()
},
'raw': raw_data,
'assembled': {
'data': imgs,
}
Expand Down
Loading

0 comments on commit 920e367

Please sign in to comment.