<jupyter_start><jupyter_text>Simulation We define the position of ds and es in polar coords. For example, here are 8 sensors and 8 emitters drawn from ds and es specified:<jupyter_code>ds, es = r8_des()
s = draw_des(ds, es, 300, 300)
print('Example detector:', ds[3])
s.write_to_png('1.png')
Image('1.png')<jupyter_output>Example detector: {'r': 1, 'a': 4.319689898685965}<jupyter_text>We can also use an image to represent the object being scanned. The intensity represents the transmissivity. For example, a fairly opaque disk located at the cartesian coordinates (0.3, 0.5) would look like this:<jupyter_code>tis, tii, x, y = test_image(300, 300, 40, 0.3, 0.5)
tis.write_to_png('2.png')
Image('2.png')<jupyter_output><empty_output><jupyter_text>The simulation traces along all the paths between emitters and detectors, summing the pixels along each. To show this, we'll overlay the two images and print the simulated readings:<jupyter_code>tis, tii, x, y = test_image(300, 300, 40, 0.3, 0.5)
paths = get_paths(tii, ds, es, 300, 300)
print('Sums along all 64 paths: ',paths)
s = draw_des_surf(tis, ds, es, 300, 300)
s.write_to_png('3.png')
Image('3.png')<jupyter_output>Sums along all 64 paths:  [20201, 0, 0, 0, 0, 0, 0, 0, 0, 17786, 20079, 11493, 0, 0, 0, 0, 0, 0, 0, 0, 13642, 20206, 6994, 0, 0, 0, 0, 0, 0, 0, 20207, 0, 0, 0, 0, 0, 0, 0, 10166, 0, 0, 0, 0, 0, 0, 0, 0, 15575, 0, 0, 0, 0, 0, 0, 0, 20233, 0, 0, 0, 0, 0, 0, 0, 16065]<jupyter_text>We can scale these, add noise and account for the angle and distance between the Emitter and Detector like so:  TODO!  Reconstruction Let's see if we can do some image reconstruction based on these readings.<jupyter_code>plt.imshow(np.asarray(paths).reshape(8,8))
r2 = []
for e in range(8):
    row = []
    for d in range(8):
        row.append(paths[e*8 + (d+e)%8])
    r2.append(row)
plt.imshow(r2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13974495217853347, 'fraction_numerical': 0.10467587672688629, 'mean_word_length': 4.884375, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '416305', 'license': 'MIT', 'n_tokens_mistral': 892, 'n_tokens_neox': 721, 'n_words': 259, 'path': 'Misc Notebooks/Summary 2.ipynb', 'repo_name': 'johnowhitaker/CIRTS', 'size': '1882'}