Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'coffset' unit when write_crystfel_geom #101

Open
JunCEEE opened this issue Aug 26, 2021 · 2 comments
Open

'coffset' unit when write_crystfel_geom #101

JunCEEE opened this issue Aug 26, 2021 · 2 comments

Comments

@JunCEEE
Copy link
Contributor

JunCEEE commented Aug 26, 2021

Hi @takluyver,

I just found a 'coffset' problem related to #59. Although we fixed the 'coffset' unit in reading, it still writes in pixel unit (line 77):

c = fragment.corner_pos / pixel_size

return PANEL_TEMPLATE.format(
dims='\n'.join(dim_list),
name=tile_name,
min_ss=ss_slice.start,
max_ss=ss_slice.stop - 1,
min_fs=fs_slice.start,
max_fs=fs_slice.stop - 1,
ss_vec=_crystfel_format_vec(fragment.ss_vec / pixel_size),
fs_vec=_crystfel_format_vec(fragment.fs_vec/ pixel_size),
corner_x=c[0],
corner_y=c[1],
coffset=c[2],

I could submit a pull request to fix it if you like.


Reproduce:

from extra_geom import AGIPD_1MGeometry
geom_file = 'agipd_20210820.geom'
save_file = 'agipd_20210820_rewrite.geom'
geom = AGIPD_1MGeometry.from_crystfel_geom(geom_file)
geom.inspect()
geom.write_crystfel_geom(save_file,dims=('frame', 'ss', 'fs'),clen=0.1218, adu_per_ev=0.0075, photon_energy=9300)
geom_new = AGIPD_1MGeometry.from_crystfel_geom(save_file)
geom_new.inspect()

Geometry files:
agipd_20210820.zip

Converted file:
image

Original file:
image

@takluyver
Copy link
Member

Thanks Jun - a pull request would be welcome. Maybe we can also add a z-shift in one of the tests (with the offset() method) to check that it's written to and read from CrystFEL files correctly.

@JunCEEE
Copy link
Contributor Author

JunCEEE commented Aug 27, 2021

@takluyver A pull request is submitted. Where should I add the test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants