lshzh-ww / RmMesh

Python scripts for removing mesh patterns in ARPES images
7 stars 3 forks source link

Issue respect to "def startRemoveMesh(self):" #1

Open Dsubires12 opened 2 years ago

Dsubires12 commented 2 years ago

Hi,

I would like to use this code for eliminating a mesh I got in some data from APE (Elettra, Italy). Once I load the data, when I press the "Remove Mesh" button in the GUI, I get several mistakes related to the shapes of the arrays. I think I can correct them, but for it I would like to know why we have to define a

self.avgRawData=np.zeros((1,np.shape(self.rawData[0])[0],np.shape(self.rawData[0])[1]))

and for what should be the dimension of this new array. Thanks :)

lshzh-ww commented 2 years ago

Hi Dsubires,

It's strange that you can load the data but get mistakes later. Would you mind sharing the full console output so I can figure out what happened?

We always acquire tens of images when conducting ARPES measurements. We may choose to rotate the sample to get band dispersion in a kx-ky plane, and the mesh pattern is very likely to be uniform among all the images. In this case, we will take an average of all images to make the mesh pattern easier to be captured, then apply the mesh pattern back to each image to eliminate it.

For example, if I rotate the sample from -10° to 10° with step 1°, I will have a rawData array of the shape (21,500,600) in the main program, meaning I have 21 images of the size 500x600. The avgRawData will be of the shape (1,500,600), which is the average of the 21 images.

Dsubires12 commented 2 years ago

Ok! I understood what was my problem... I thought that this code was done for single scans of data and in that case we should have files with np.arrays with shapes (N,M) instead of (Number of scans, N, M). I introduced a file with a Fermi map (tens of images in a single file) and it works!

Now I would like to optimize the mesh pattern. When I non-click the choice "Use the same mesh pattern for all the images", I guess that it is just for eliminating the mesh pattern of a single image, isn't it? But it prints the following in the console:

Question RmMesh

An when it reaches "900", it starts again. What is happening?

lshzh-ww commented 2 years ago

Ahh...I planned to write a more detailed documentation. As I said, the mesh pattern may or may not change between different scans. If you can sure that all you scans have exactly the same mesh pattern, you can click the choice "Use the same mesh pattern for all the images", and follow steps in the README file. This will create one mesh pattern and apply it to every scan image to eliminate the mesh.

If the mesh pattern changes between different scan images, you will have to non-click the choice "Use the same mesh pattern for all the images". This will automatically create mesh patterns separately for all the scans.

n/900 shows the progress for optimizing one mesh pattern. If you non-click the choice, you have 101 mesh patterns to optimize...

There are some undocumented parameters to control the optimizing process. If you feel that the result isn't good enough, feel free to contact me.