How to get 2D and 3D image manipulation command in IGOR Pro main panel
manojphy
I want to convert my 2D image scale axis using IGOR Pro software. Actually, I want to convert my ARPES data from "eV vs theta" to "eV versus k" value using 2D/3D option but I don't know how to get this 2D option active. If there is any procedure file or script available please help me.
intep2D
function. Or is it something else you want to achieve? It would help if you could post some test experiment or data.May 20, 2014 at 01:16 am - Permalink
Yes, I am trying to convert the angle (degree) scale to k vector using igor. How to use this Interp2D function? Please send the procedure file if possible. I am sending the ARPES energy spectra file.
Best Regards,
manojphy
May 20, 2014 at 01:28 am - Permalink
Wave inwave
String newname = NameofWave(inwave)+"_k"
Duplicate/O inwave, $newname
Wave outwave = $newname
Variable rows,columns,xdelta,xoffset,ydelta,yoffset // inwave parameters
rows = DimSize(inwave,0)
columns = DimSize(inwave,1)
xdelta = DimDelta(inwave,0)
xoffset = DimOffset(inwave,0)
ydelta = DimDelta(inwave,1)
yoffset = DimOffset(inwave,1)
Variable kmin,kmax,kdelta,Emax
Emax = xoffset + xdelta*(rows-1)
kmin = 0.512*sqrt(Emax)*sin(pi/180*(yoffset)) // calculate the k boundaries (i.e., k at highest Ekin)
kmax = 0.512*sqrt(Emax)*sin(pi/180*(yoffset+(columns-1)*ydelta))
SetScale/I y kmin,kmax,"Ang^-1", outwave // scale the y axis
outwave = interp2D(inwave, x, 180/pi*asin(y/ (0.512*sqrt(x)))) // recalculate to k
outwave = (NumType(outwave)==2) ? 0 : outwave // replace NaNs (optional)
End
I also attache it as a file. Just run by typing
angletok(your_wave_name)
in the command line.May 20, 2014 at 02:36 am - Permalink
Thank you very much for your reply and sending the procedure file. I also want to know if the binding energy(eV) versus k plot can be converted into binding energy (intensity) versus k curve plots using igor. I am attaching a sample file for your reference. Please send the procedure file for this also.
Best Regards,
manojphy
May 20, 2014 at 09:14 pm - Permalink
May 21, 2014 at 01:36 am - Permalink
May 21, 2014 at 02:29 am - Permalink
May 21, 2014 at 04:26 am - Permalink
May 21, 2014 at 05:41 pm - Permalink
Thank you very much for your comments.
I could not understand thomas comment "normal emission at zero angle" in regard of my question.
Also, what is the meaning of 'properly prepared data'? Is this comment 'recalculation is quasi' means conversion will be an approximation only?
I didn't understand your last comment fully!!!!
Please elaborate in simpler language so that I also can understand and if you have the procedure file then please post it. Your previous program is running well. Thank you very much again for that.
Best regards,
manojphy
May 21, 2014 at 09:21 pm - Permalink
Anyway, you have to make sure that the angle values in your data correspond to the real emission angles from the sample surface before recalculating to k, i.e., if your sample was tilted by for instance 30° you need to add this to your angle axis.
Regarding your question about the BE case: Of course that is possible if you have the used photon energy available. Since there a several ways to handle binding energy (some people use positive values some use negative values for BE etc.) it would be better if you had again an example file of BE scaled data you are usually using. I could include the recalculation in the procedure. You can also handle the recalculation to KE yourself before using the above procedure.
May 21, 2014 at 10:26 pm - Permalink
I try to use this code to convert angle resolved photoemission (ARPES) data.
My motivation is same as that of the topic of discussion here: changing the raw ARPES data which is Energy vs. angle [E(theta)] to Energy vs. k_parallel [E(k||)]. In this code I can see that it convert the x-scale to k_parallel but if I understood correctly, the last two lines are basically rescaling with uniform spacing, am I right?
But, when one try to go from E(theta) to E(k||), the new x-axis is function of two variable (Energy and angle) and thus it is not just linearly varying. So, how the final data display is done?
As far as I understand, this is suppose to be done by taking two wave of angle and energy and then use the relation 0.51*sin(angle)*sqrt(energy), which is third wave. Then plot third wave with old energy and intensity. So, if possible pls explain how does it work.
I hope you can understand my question!
May 28, 2014 at 06:26 am - Permalink
The angle alpha can be transformed to k_parallel using trigonometry and some physical unit conversion as in chozo's code. In the attached image I've included the governing formulas. The energy value of a pixel/data point is not changed with this kind of conversion.
May 28, 2014 at 09:26 am - Permalink
In short, that's sort of what the second to last line does:
Look how the second argument is your equation solved for the angle, taking both the energy (x) as well as k (y). That is necessary because the old data (inwave) is in angle scaling and the new data is already in the final k vector scaling. So in order to calculate a value for the rescaled data I need to translate from the final scaling (k vector) back to the angle to look up the position in inwave, because, of course, the argument takes the the scaling from the right side,i.e., outwave.
interp2D
looks for the right point in the old data using the conversion formula, so everything's all right.I hope that made a bit sense. Try a simple example with two differently scaled waves if you are still not sure what is going on.
May 28, 2014 at 10:14 pm - Permalink
My question is more related to only final data display.
For example, I have a 2D ARPES data and I used your code to get k||. When I just see the "outwave" in image plot and in table, I cannot see the image rather it is with zeros.
So, I have confused how it worked. If possible you can just try this example data and attach back so that I can find the procedure for final data display.
[I could not attach full image due to memory limitation, so only short range is attached]
May 29, 2014 at 04:43 am - Permalink
If the transformation is done correctly, the image can be displayed in a normal way (i.e., linear in k), as interp2D has interpolated any non-linearity already. The data fidelity of course decreases a bit around the low-KE edges (think of it like doing a lens distortion to an image where the edges get stretched or compressed).
Hope that clears things up a bit.
May 29, 2014 at 06:42 am - Permalink
Thanks a lot.
May 30, 2014 at 07:05 am - Permalink
theta_f=theta_i+atan((e*U*(1-sin(theta_i)/theta_i))/(Ekin-(e*U*(1-sin(theta_i)/theta_i))))^0.5
Again this is function of two variable. But this theta_f is replaced in the k|| calculation equation in the place of theta. So I would like to use your code (because it is much faster compared to converting to XYZ data and do the same and plotting back using XYZ plot). But in single macro so that only once data will be interpolated. So, I have modified as follows. Conceptually appears to be correct. but I have problem.
Since Ekin is in the denominator, i have taken minimum energy.
Here is the code:
Function AngleToK_withbias(inwave) /// needs angle (y-axis) vs energy (x-axis)
Wave inwave
String newname = NameofWave(inwave)+"_kwb"
Duplicate/O inwave, $newname
Wave outwave = $newname
Variable rows,columns,xdelta,xoffset,ydelta,yoffset // inwave parameters
rows = DimSize(inwave,0)
columns = DimSize(inwave,1)
xdelta = DimDelta(inwave,0)
xoffset = DimOffset(inwave,0)
ydelta = DimDelta(inwave,1)
yoffset = DimOffset(inwave,1)
Variable kmin,kmax,kdelta,Emax,Emin
Emax = xoffset + xdelta*(rows-1)
Variable theta_f,theta_i
Variable U=5
Variable e= 1.602176565*10^-19
theta_i=pi/180*(yoffset)
Emin=xoffset
theta_f=theta_i+atan((e*U*(1-sin(theta_i)/theta_i))/(Emin-(e*U*(1-sin(theta_i)/theta_i))))^0.5
kmin = 0.512*sqrt(Emax)*sin(theta_f) // calculate the k boundaries (i.e., k at highest Ekin)
theta_i=pi/180*(yoffset+(columns-1)*ydelta)
theta_f=theta_i+atan((e*U*(1-sin(theta_i)/theta_i))/(Emin-(e*U*(1-sin(theta_i)/theta_i))))^0.5
kmax = 0.512*sqrt(Emax)*sin(theta_f)
SetScale/I y kmin,kmax,"Ang^-1", outwave // scale the y axis
outwave = interp2D(inwave, x, (180/pi)*asin(y/ (0.512*sqrt(x)))) // recalculate to k
outwave = (NumType(outwave)==2) ? 0 : outwave // replace NaNs (optional)
End
If you have any idea pls let me know.
May 30, 2014 at 08:50 am - Permalink
Also, trigonometric functions work in radiants. You will get unexpected results if you just feed in degrees.
May 31, 2014 at 11:18 am - Permalink
The mentioned paper gives details: Phys. Rev. B 77, 085425 (2008).
May 31, 2014 at 03:27 pm - Permalink
Yes, I see that you treated the angles correctly in radiants. Sorry, for the confusion.
I looked at the paper, but I think you are misinterpreting the formula in your previously posted code. As I understand it, the appendix of the paper describes how the angle of the electron trajectory has to be corrected if the sample surface is tilted. This has two implications: For one, you don't need to apply a correction if you measure in normal emission (i.e., if theta_m = 0 then theta_x = theta_e). Secondly, if you use the formula, the input angle (theta_m) is not the measured electron angle but the tilt angle of the sample surface, i.e., a constant just like U. It is possible to incorporate a correction for a tilted surface under bias in the calculation but I think it would be better to do it in a separate step, since a) it's a rather special case and b) the data has to be redistributed anyway separately as theta_x depends on Ekin. I can try to write something, but it would be better if we first agreed on the procedure (and probably do this in a separate thread, since this one has been derailed already considerably).
June 1, 2014 at 07:42 pm - Permalink
I have posted a new post. Link
June 2, 2014 at 07:48 am - Permalink