tjlane / pypad

Intuitive, high-level interface to the CSPAD
Other
2 stars 1 forks source link

I think that (pypad manipulated) quad rotations might not be quite right #47

Closed tjlane closed 9 years ago

tjlane commented 11 years ago

The current algorithm tilts each ASIC around its own center -- the rotation should really be around the quad center!

This may just be in assemble.

tjlane commented 10 years ago

This is indeed just a problem in the assemble method. It also looks like it's rotating in the wrong direction in assemble! Below I rotated the 1st quad 10 extra degrees.

Sketch based on pixel positions:

sketch

Assembled Image:

assemble

daurer commented 9 years ago

I am having similar issues.

Running optgeom looks fine:

optgeom_start

But looking at the assembled image, already gives a hint that something went wrong (looks like problems with quad rotations):

assemble_solution

It becomes even more obvious that something is wrong when I restart the optgeom with the solution (.cspad file) from the first optgeom:

optgeom_solution

Any idea what is going on there?

sellberg commented 9 years ago

After some debugging me and Benedikt concluded that plot.sketch_2x1s(cs1.pixel_positions, ax) outputs the proper result (the reason for the weird image in optgeom was that we applied the dilation and center_shift in filter_params.yaml twice), but imshow_cspad( cs1(raw_image), ax=ax, scrollable=True ) does not, which is what is used in assemble. I'll take a look to see if I can find the bug in CSPad._assemble_image() and will let you know if I find something interesting..

tjlane commented 9 years ago

@sellberg @daurer that was my experience with this bug -- sketch is trustworthy, assemble is not. Can you guys email me the files & commands you're running to produce the above? I have some limited time I can devote to this over the next day or two. We should get it working!

Also you guys should be aware LCLS is adopting a new geometry convention that will be more pypad-esque, and it may make sense to drop support for pypad and switch to that in the near future if it turns out well.

sellberg commented 9 years ago

think I got assemble to work properly with https://github.com/tjlane/pypad/commit/81dac0a6ebacd8025bf1a10c5a38cc83ff0b5706 after some debugging, can't say I exactly understand what CSPad._assemble_image() is doing, but the empirical tests say that a change in the rotation direction + some mirroring solved things. Try it out with python test/test_rotation.py

sellberg commented 9 years ago

and this is how it looks like screen shot 2014-12-10 at 15 43 16

tjlane commented 9 years ago

nice thanks!