Closed tjlane closed 9 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:
Assembled Image:
I am having similar issues.
Running optgeom looks fine:
But looking at the assembled image, already gives a hint that something went wrong (looks like problems with quad rotations):
It becomes even more obvious that something is wrong when I restart the optgeom with the solution (.cspad file) from the first optgeom:
Any idea what is going on there?
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..
@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.
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
and this is how it looks like
nice thanks!
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.