tjlane / pypad

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

Assemble crashes when using metrology output from optgeom #19

Closed sellberg closed 11 years ago

sellberg commented 11 years ago

I tried to run assemble with the default metrology and it works fine, but when I try and run it with the output from optgeom, it crashes:

[psana0210:pypad:529 14:12:51] optgeom ~/source/pypad/examples/gold-minus490mm.h5 filter_params.yaml

--- ASSEMBLING GEOMETRY FROM CALIBRATION STANDARD ---

...

objective value: -1.5385e+21 objective value: -1.5385e+21 Optimization terminated successfully. Current function value: -1538453417345293484032.000000 Iterations: 436 Function evaluations: 794 Wrote my_cspad.cspad to disk.

[psana0210:pypad:535 15:46:52] assemble ~/source/pypad/examples/gold-minus490mm.h5 --metrology my_cspad.cspad Loading: /reg/neh/home3/sellberg/source/pypad/examples/gold-minus490mm.h5 Traceback (most recent call last): File "/reg/neh/home3/sellberg/local/scripts/assemble", line 5, in pkg_resources.run_script('pypad==0.0.1', 'assemble') File "/reg/g/psdm/sw/releases/ana-current/arch/x86_64-rhel5-gcc41-opt/python/pyextra/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script self.require(requires)[0].run_script(script_name, ns) File "/reg/g/psdm/sw/releases/ana-current/arch/x86_64-rhel5-gcc41-opt/python/pyextra/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1214, in run_script exec script_code in namespace, namespace File "/reg/neh/home3/sellberg/local/site-packages/pypad-0.0.1-py2.7.egg/EGG-INFO/scripts/assemble", line 52, in

File "build/bdist.linux-x86_64/egg/pypad/cspad.py", line 439, in call File "build/bdist.linux-x86_64/egg/pypad/cspad.py", line 1031, in _assemble_image ValueError: qoff_col: -2 out of bounds [0,1900)

sellberg commented 11 years ago

It works fine with the example output though from optgeom:

[psana0210:pypad:539 15:52:41] assemble ~/source/pypad/examples/gold-minus490mm.h5 --metrology ~/source/pypad/examples/my_cspad.cspad Loading: /reg/neh/home3/sellberg/source/pypad/examples/gold-minus490mm.h5

Hmm.....

tjlane commented 11 years ago

@sellberg I know what is causing this: to accomodate the geometry you have, the assemble code needs to put a quad outside the bounds of the (fixed-size) array it fills in before it calls imshow

It should be an easy fix. If you search for the ValueError thrown above in pypad/cspad.py you'll see what I mean.

sellberg commented 11 years ago

@tjlane Cool I'll take a look at it.

sellberg commented 11 years ago

Should work properly for all dilations after https://github.com/tjlane/pypad/commit/a37d5ce2452ea105d524a5478a7c64f2694835dc