Commit ff934fc7 authored by rodolakis's avatar rodolakis
Browse files

weekly commit 20220328 - lots of changes in ARPES/EA

parent 575238cd
......@@ -16,7 +16,8 @@ scanXAS_BL #XAS scans: mono and ID move together (slow)
###-------sample position -------
ARPES_transfer() # moves motors to transfer position
ARPES_measure() # moves motors to measure position
scanMesh
scanMesh([-1.5,1.5,.1],[12.5,14,5,.5]) #makes 2D image; EA.put before if you want EA counts
mprint() # gets a list of current motor positions
sample([list from mprint]) # to go to a position
......@@ -42,11 +43,8 @@ data.update(start,inf,overwrite=False) # loads only unloaded data
data.plotEA(MDAscanNum)=> plot EA image
data.plotEDC(MDAscanNum) => angle integrated data
#Fermi maps (each needs of the follwoing to be run in its own cell)
ra=data.stackmdaEA(mdaScanNum)
IT=ImageTool(ra,"LayoutComplete")
IT.show()
#Fermi maps (are run in ipython_29id from the terminal)
EAImageTool(MDAscanNum)=> stacks the data from a single mda file
#mda scans
det[16] => TEY
......
%% Cell type:code id: tags:
 
``` python
%run Macros_29id/pynData/IEX_wrapper.py
```
 
%% Cell type:code id: tags:
 
``` python
#loading all scans from 1, 293 for sample S302
S302=EA_exp(1,293)
```
 
%% Output
 
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-24e9ebdceebb> in <module>
1 #loading all scans from a given sample
----> 2 S302=EA_exp(1,293)
 
NameError: name 'EA_exp' is not defined
 
%% Cell type:code id: tags:
 
``` python
#plotting a single image; scanNum = 293
niceplot(S302.scan[293])
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
#ploting an EDC for scanNum 141
niceplot_avg(S302.scan[141],ax='x')
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
Ni_Res=mkEDCstack(S302,6,95,countby=1)
niceplot(Ni_Res)
```
 
%% Output
 
Dimension y mismatch!
 
 
%% Cell type:code id: tags:
 
``` python
Compare2D(S302.scan[127],S302.scan[143],intScale=.5)
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
Ni_Res3D=mkStack(S302,6,48,countby=1)
```
 
%% Output
 
Dimension z mismatch!
 
%% Cell type:code id: tags:
 
``` python
plot3D(Ni_Res3D)
```
 
%% Output
 
(<pynData.nData at 0x7f3f04ddbb38>,
<pynData.nData at 0x7f3f04ddba20>,
<pynData.nData at 0x7f3f04ddbcc0>,
<pynData.nData at 0x7f3f0522b710>)
 
 
%% Cell type:code id: tags:
 
``` python
S302a=EA_exp(150,293)
```
 
%% Cell type:code id: tags:
 
``` python
S302a.updateExp(294,301)
```
 
%% Output
 
<__main__.EA_exp at 0x7f0fa2a5cda0>
 
%% Cell type:code id: tags:
 
``` python
import matplotlib.pyplot as plt
plt.plot(S302a.scan[300].scale['y'],S302a.scan[300].extras['EDC']*2)
plt.plot(S302a.scan[301].scale['y'],S302a.scan[301].extras['EDC'])
plt.show()
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
S302a.scan[300].scale['y'].shape
```
 
%% Output
 
(301,)
 
%% Cell type:code id: tags:
 
``` python
data=EA_exp(1,inf)
```
 
%% Output
 
/net/s29data/export/data_29idc/2021_1/ZXShen/netCDF/
Loaded scanNums:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
 
%% Cell type:code id: tags:
 
``` python
plotEDCs(data.scan[6],data.scan[7],Escale='BE',wk=4)
```
 
%% Output
 
 
%% Cell type:code id: tags:
 
``` python
for scanNum in range(5,12):
plotEDCs(data.scan[scanNum],Escale='BE')
plt.legend()
```
 
%% Output
 
<matplotlib.legend.Legend at 0x7ff5679a7278>
 
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:code id: tags:
 
``` python
FM=mkStack(data,7,72,countby=1,setscale=(8,-.25,'th'))
```
 
%% Cell type:code id: tags:
 
``` python
FM.info()
```
 
%% Output
 
The 3-dim data has shape (66, 481, 1392)
Axis x: size - 1392, unit - Kinetic Energy (eV)
Axis y: size - 481, unit - Degrees
Axis z: size - 66, unit - th
 
%% Cell type:code id: tags:
 
``` python
plot3D(FM,xCen=496.75,xWidthPix=10)
```
 
%% Output
 
/home/beams22/29IDUSER/Documents/User_Macros/Macros_29id/pynData/pynData.py:712: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.
im1 = ax1.pcolormesh(xyScale[0], xyScale[1], zImage)
/home/beams22/29IDUSER/Documents/User_Macros/Macros_29id/pynData/pynData.py:726: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.
im2 = ax2.pcolormesh(xzScale[0], xzScale[1], yImage)
/home/beams22/29IDUSER/Documents/User_Macros/Macros_29id/pynData/pynData.py:733: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.
im3 = ax3.pcolormesh(zyScale[0], zyScale[1], xImage.transpose())
 
(<pynData.nData at 0x7f52264138d0>,
<pynData.nData at 0x7f52264139e8>,
<pynData.nData at 0x7f5226413a20>,
<pynData.nData at 0x7f52265a7b70>)
 
 
%% Cell type:code id: tags:
 
``` python
```
 
%% Cell type:code id: tags:
 
``` python
data.scan[6].extras.keys()
```
 
%% Output
 
dict_keys(['fileInfo', 'detInfo', 'wk', 'hv', 'angScale', 'KEscale', 'TA', 'TB', 'TEY', 'TEY2', 'Kinetic Energy (eV)', 'Degrees', 'BeamlineInfo', 'Motors', 'scanNum'])
 
%% Cell type:code id: tags:
 
``` python
data.scan[8].extras['detInfo']
```
 
%% Output
 
{'source': 'APS_IEX',
'lensMode': 'Angular',
'acqMode': 2,
'passEnergy': 7,
'kineticEnergy': 490.0,
'frames': 80,
'sweeps': 1}
%% Cell type:code id: tags:
``` python
data.sta
```
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -93,7 +93,7 @@ class Scienta:
if key in ["LensMode","SpectraMode"]:
vars(self)[key]=caget(self.PHV+key+".VAL",as_string=True)
if key == "Frames":
vars(self)[key]=caget(self.PHV.split(':')[0]+":"+"ExpFrames.VAL")
vars(self)[key]=caget(self.PHV.split(':')[0]+':'+"ExpFrames.VAL")
if key == "wk":
vars(self)[key]=caget(self.PHV+"WorkFunction")
if q !=1:
......@@ -200,6 +200,8 @@ class Scienta:
caput(self.PHV+"LensMode",parms["LensMode"])
sleep(.25)
caput(self.PHV+"PassEnergy_Set",str(int(parms["PassEnergy"])))
sleep(0.25)
caput(self.PHV.split(':')[0]+':'+"ExpFrames",parms["Frames"])
sleep(.25)
caput(self.PHV+"KineticEnergy",parms["KineticEnergy"]+0.01)
sleep(1)
......@@ -265,7 +267,7 @@ class Scienta:
Sets the number of frames
Frames >=1
"""
caput(self.PHV.split(':')[0]+":"+"ExpFrames.VAL",val)
caput(self.PHV.split(':')[0]+':'+"ExpFrames.VAL",val)
def _ElementSet(self,mode,q=1):
......
......@@ -10,7 +10,7 @@ from numpy import inf
import re
import h5py
import pandas as pd
from time import sleep
try:
import netCDF4 as nc
import tifffile
......@@ -1071,18 +1071,6 @@ class IEXdata:
plt.imshow(img,aspect='auto',**imkwargs)
def IT_EA(self):
"""
ImageTool for stacking EA data in a single MDAscan
EAscanNum = (1,inf,1) => stacks all e.g. for Fermi maps
EAscanNum = 17 => 2D image of EAfile 17
"""
print("stack the data using ra=stackmdaEA or ra = stackmdaEA_multi" )
print("%matplotlib")
print("it=ImageTool(ra,'LayoutComplete')")
print("it.show()")
def stackmdaEA(self,mdaScanNum,**kwargs):
"""
......@@ -1346,3 +1334,21 @@ def load_IEXnData(fpath):
return mydata
def EAImageTool(mdaScanNum,**kwargs):
"""
to be run in ipython not in jupyter (cause the kernal to crash)
multi=False stacks EA files from a single mda scan
multi=True stacks EA files from multiple mda scans
**kwargs:
includes kwargs for loading data IEXdata
path,prefix,dtype...
include stackEA kwargs
subset,EDConly
"""
global it
data=IEXdata(mdaScanNum, **kwargs)
ra=data.stackmdaEA(mdaScanNum,**kwargs)
it=ImageTool(ra,'LayoutComplete')
it.show()
\ No newline at end of file
......@@ -487,6 +487,8 @@ def scanEA(EAlist,**kwargs):
if kwargs["run"]==True:
EA.put(EAparms['KineticEnergy'],EAparms['PassEnergy'],LensMode="Angular",Frames=EAparms['Frames'],**kwargs)
sleep(10)
EA.put(EAlist[1]-.05,EAlist[-3],LensMode="Angular")
sleep(2)
Scan_Go(kwargs["scanIOC"],kwargs["scanDIM"])
#After scan
log_EA(**kwargs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment