Closed chuckie82 closed 8 years ago
I think we should do this -- here's my thoughts:
FYI, CompoundCamera and Cspad classes are the only two that call to_crystfel_file(). I suspect any future class that calls this function will require a coffset as an input. So the current PR maintains a common interface. Thoughts?
Set defaults to 0.0 Added documentation
Three remaining comments:
I think test.py is broken (in this branch?). TJ, could you add these tests?
from psgeom import camera cspad = camera.Cspad.from_crystfel_file("ref_files/refgeom_crystfel.geom") cspad.to_psana_file('ref_files/temp.data') # Set distance to default 1 metre
from psgeom import camera cspad = camera.Cspad.from_crystfel_file("ref_files/refgeom_crystfel.geom") cspad.to_psana_file('ref_files/temp.data', dist=0.75) # Set distance to 0.75 metres
from psgeom import camera geom = camera.Cspad.from_psana_file('ref_files/refgeom_psana.data') geom.to_crystfel_file('temp.geom') # Set coffset to default 0.0
from psgeom import camera geom = camera.Cspad.from_psana_file('ref_files/refgeom_psana.data') geom.to_crystfel_file('temp.geom',coffset=0.585) # Set coffset to 0.585 metres
@chuckie82 seems i do not have permissions to update your fork. I added the test but can't push :(. It is in the local repo in a new branch, chuckie82-distance, which you should be able to merge.
To run the tests:
nosetest.py test.py
It seems that these changes broke 4 tests. The "default" distance seems to be overriding z-distances that were previously correctly inferred from the geometry files. Run the tests and see if you agree.
Do you have your own nose installed? I couldn't run it on psana interactive nodes.
[yoon82@psanaphi101 psgeom]$ nosetests test.py
Traceback (most recent call last):
File "/usr/bin/nosetests", line 5, in
Yeah i do have my own version... seems like we should get the psana version working though!
Easy to install if you have a virtualenv set up.
On Oct 31, 2016, at 6:59 AM, TJ Lane notifications@github.com<mailto:notifications@github.com> wrote:
Yeah i do have my own version... seems like we should get the psana version working though!
Easy to install if you have a virtualenv set up.
We could also see if it works in David’s anaconda version (they way of the future, perhaps):
https://confluence.slac.stanford.edu/display/PSDMInternal/Conda+based+Psana+in+LCLS+central+install
chris
I tried testing with nose through anaconda and it seems to work. The tests fail, but at least the first few failures don't seem to have anything to do with my commits.
@tjlane Shall we sit together sometime this week and fix up the tests? Tues or Wed?
@chuckie82 before we meet up try checking out newdets or master (w/o these changes) and run the tests. When I did this, they worked. They seem to fail due to changes along the z-axis...
Time early this week tough due to beamtime. If Chris is flexible: 2pm Wed?
On Oct 31, 2016, at 2:48 PM, TJ Lane notifications@github.com<mailto:notifications@github.com> wrote:
If Chris is flexible: 2pm Wed?
Works me me…
c
OK, let's meet up on Wed 2pm. I'll test the Rayonix conversion in the mean time.
This is the output from newdets w/o my changes: HEAD is now at 8662b05... added non-cspad support to geoconv FAILED (SKIP=1, failures=3)
Discussion with TJ and Chuck to_crystfel_file() sets coffset to dist (default) to_crystfel_file(coffset) sets coffset to coffset
To go back to psana geometry from crystfel geom: translate(0,0,Z) to_psana_file()
Changed default behavior as discussed.
Test still fails due to differences in from_psana_file() and Mikhail's get_pixel_coords(), unrelated to my commits. Safe to merge?
1) to_crystfel_file() now requires coffset (m) This is because psana geometry only has detector distance, but crystfel requires clen and coffset. clen is usually a string to hdf5 dataset. coffset is explicitly required.
2) to_psana_file() now requires detector distance (m) This is because crystfel geom has clen and coffset. Since clen is usually a string to hdf5 dataset, you can not infer the value of detector distance from coffset.