Skip to content
Snippets Groups Projects
Commit b695fd55 authored by Jakobsen, Mads Bregenholt's avatar Jakobsen, Mads Bregenholt
Browse files

adding agipd test data generating function

parent adbfb860
No related branches found
No related tags found
No related merge requests found
......@@ -110,3 +110,24 @@ def agipd_module_number_from_agipd_module_name(module_name):
return -1
def generate_test_data(shape=None, q=0.02,photonEnergy=1, prob_below_threshold=0.005, prob_above_threshold=0.005, prob_nans=0.005):
if shape is None:
shape = (50, 512, 128)
size = shape[0]*shape[1]*shape[2]
propabilityValues = [q**0, q**1, q**2, q**3, q**4, q**5, q**6, prob_below_threshold/shape[0], prob_above_threshold/shape[0], prob_nans/shape[0]]
values = [ 0, 1, 2, 3, 4, 5, 6, -40, 100, np.nan]
photonData = np.reshape(
np.random.choice(
values,
size=size,
p=propabilityValues/np.sum(propabilityValues))
,shape)
detectorData = (
photonData
*photonEnergy
).astype(np.float32)
return detectorData
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment