aglie / meerkat Goto Github PK
View Code? Open in Web Editor NEWA python program for performing reciprocal space reconstruction from single crystal x-ray measurements.
License: MIT License
A python program for performing reciprocal space reconstruction from single crystal x-ray measurements.
License: MIT License
Is meerkat able to do some reconstructions of frames with multiple revolutions, having several frames at the same angle?
In the case the orthographic coordinates are selected, now the unit cell vectors would change accordingly.
It would be nice to preserve information on the original cell, in order to have a data cursor in the reconstructed image. Probably lattice transformation should be condensed in one additional matrix used after the unit-cell-vectors.
The output currently is not in the "Yell 1.0" format since it does not contain several keywords. Meerkat should be updated so that all of the programs can interoperate.
For creating some nice pictures for presentations, I wanted to create a really large reconstruction using:
reconstruct_data(filename_template='./frames/set1_1_%04i.cbf',
first_image=1,
last_image=3600,
reconstruct_in_orthonormal_basis=False,
maxind=[37,37,37], #the reconstruction will be made for h=-4...4, k=-5...5, l=-16...16
number_of_pixels=[2047, 2047, 2047], #The resulting size of the array. Controls the step size
polarization_factor=0.99,
path_to_XPARM='./',
measured_pixels=measured_pixels,
output_filename='mega.h5',
all_in_memory=False,
size_of_cache=2000,
override=True)
Note the large indices and pixels. From the hkl file of XDS I know that I still have reflections out there, however, if I look at the reconstruction (intentionally not undistorted):
Note all the white space around the reconstruction. It looks more or less similar to my reconstruction with hkl=16 and 800 pixels:
Any ideas?
The rebinned_data
and number_of_pixels_rebinned
in the HDF5 output when I specified reconstruct_in_orthonormal_basis=True
was all zeroes. Using the same meerkat input and diffraction data with reconstruct_in_orthonormal_basis=False
works though. Here is the script I used:
from meerkat import reconstruct_data
import fabio
#reconstruct dataset
reconstruct_data(filename_template='../images/ALS_A_223_5_1_%03i.img',
first_image=1,
last_image=360,
reconstruct_in_orthonormal_basis=True,
maxind=[8,8,8], #the reconstruction will be made for specified index range [+/-h,+/-k,+/-l]
number_of_pixels=[801, 801, 801], #The resulting size of the array. Controls the step size
polarization_factor=0.98,
path_to_XPARM='/home/MDH/Documents/ISF_B_136/xds_1',
output_filename='ISF_B_136_11_01_.h5',
all_in_memory=False,
size_of_cache=100,
override=True)
On a related note, since specifying reconstruct_in_orthonormal_basis=False
will produce a 3D matrix with its coordinates parallel to a *, b * and c *, such that a slice through the volume along a * b * will look something like this for a hexagonal cell:
I was wondering if there is a way to reconstruct the volume such that the plane looks like this, with only one of the reciprocal vectors along a matrix coordinate:
Or would it be easier to just apply a shearing transform to the reconstructed plane afterwards?
At least check the obvious: when reconstructing everything with angle increment 1 suggest [1,1,5].
I'm finding it difficult to understand how to specify specific reciprocal planes with just maxind. Say I wished to reconstruct the plane h,k,2±0.1, how would I go about specifying that in meerkat?
Hi @aglie ,
I am using the meerkat software on two datasets but the output matrix every time solely contains NANs. Do you have any idea what could cause this problem?
My settings:
Thank you very much!
Best, Sani
Would be very helpful to know how much time is left till the end of reconstruction.
I just realized that there maybe something wrong with either the print out or the reconstruction loop:
I told it to reconstruct 3600 frames but the last print-out message on the shell is "reconstructing frame number 3599". I did a fast run with only ten frames and the las message was "reconstructing frame number 9". Is this just a printing bug or does the loop skips the last frame?
Check that libraries allow to work under python3
Allow the user to pass the list of scale factors for the images.
In the process of comparing reconstructed planes between those produced by meerkat and those done in APEX2 from the same data I noticed some differences in background intensity. Whereas in APEX2 the background is fairly consistent across the entire reconstructed plane, those from meerkat seem to show an increase in background (and possibly peak) intensity towards the edges of the plane. Raw frames themselves have an even background distribution across the detector, so I'm wondering what the cause of the difference in reconstruction is? Would it be possible to get meerkat to produce an even background such such that weak reflections are not lost due to the colour scaling needed to accommodate the range in background intensity?
APEX2 images. The background is always consistent across the plane, irrespective of the plane and colour axis limits.
Meerkat images. Reconstructing on a finer grid shows the same behaviour.
The XDS generated file "BKGPIX.CBF" can not be read by meerkat, converting the file to a TIFF works though!
Also note that reciprocal angstoems are 1/A not 2pi/A and that reconstruction will have more zeros if maxind are not changed.
meerkat does not work under python 3.x due to the change of the print statement to a print function.
The python 2.x
print "foo"
creates an error in 3.x, where a function like
print("foo")
is required.
Fabio works, so there is no reason not to update meerkat for the new python.
Hello, @aglie . I am a new user of meerkat. I have a question on the meaning of "maxind".
For example, maxind = [4, 5, 6] is the reconstruction h=-4...4, k=-5...5, l=-6...6. Then, how is the (h, k, l) defined? A point at (h, k, l) in the reciprocal space is corresponded to a vector 1/wavelength * (h, k, l) or (a * h, b * k, c * l) in the reciprocal space? (a, b, c) are reciprocal lattice constants of the crystal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.