Commit 5988a28c authored by rodolakis's avatar rodolakis
Browse files

weekly commit 03/11/2022

parent ae24c1cc
Get_All()
Close_CBranch() #EA.off(); Close_CValve(); Close_CShutter()
###-------Safe state-------
Close_CBranch() #does the following: EA.off(); Close_CValve(); Close_CShutter()
# Beamline Controls
energy(932)
polarization('V') # 'RCP', 'LCP', 'H', 'V'
slit(100)
scanXAS
scanXAS_BL
# ARPES motors
mprint()
###-------Beamline Controls-------
Get_All() #prints current beamline status
energy(932) #sets the energy (mono,undulator and slits)
polarization('V') #Turns the ID off and then sets the polarization: 'RCP', 'LCP', 'H', 'V' **need to set energy after a mode change!**
slit(100) #changes the slits (flux and resolution 0-300)
resolution() #prints resolution for the current beamlize and analyzer setting
scanXAS #scans the mono with ID fixed (quick and dirty, huge background)
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
mprint() # gets a list of current motor positions
sample([list from mprint]) # to go to a position
###-------motor scans: if EA is on records total number of counts not spectra -------
scanx(start,stop,step) #x,y,z,theta,focus
# EA
EA.get()
EA.put(KE,PE)
scanEA
scanFM
###-------Electron Analyzer (Scienta)-------
EA.off() #turns off analyzer
EA.get() #get current analyzer settings
EA.put(KE,PE) #changes the current analyzer setting
scanEA(EAlist) #takes an analyzer spectra, number of parameters in EAlist determine the scan type
scanFM(RoughPositions, thList, EAlist) #takes a Fermi Map: moveS th, linear interp between RoughPositions, takes spectra
scanEA_hv(hvlist,EAlist=EAlist) #takes a spectra as a function of photon energy
scanx_EA(EAlist, start,stop,step, mode) #takes a spectra as a function of x/y/z/th
#graphing
data=IEXdata(start)
###-------loading the data and graphing-------
data=IEXdata(start)#initializes the loading and loads filenumber start
data.update(start,inf,overwrite=False) # loads only unloaded data
data.mda[scanNum].detAll() => lists all detectors
data.mda.keys() => lists all the mda data loaded
data.mda[scanNum].EA.keys() => lists all the EA data loaded for a give EA scan (useful for Fermi maps, multiple sweeps)
#ploting specta: *kwargs are the standard plotting kwargs plus some extras listing in the 'help'
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()
#mda scans
det[16] => TEY
det[17] => EA
data.plotMDA(scanNum,detNum)#plots 1D and 2D mda scans, TEY: detNum=16, EA: detNum=17
data.mda[scanNum].detAll() => lists all detectors
data.mda.keys() => lists all the mda data loaded
data.mda[scanNum].EA.keys() => lists all the EA data loaded for a give EA scan (useful for Fermi maps, multiple sweeps)
#metadata
data.mda[scanNum].EA[EAnum].header.all => dictionary of all the meta data
data.mda[scanNum].EA[EAnum].header.hv => mono readback
data.mda[scanNum].EA[EAnum].header.BeamlineInfo => beamline parameters
data.mda[171].EA[1].header.HVscanInfo => analyzer parameters
data.mda[171].EA[1].header.sampleInfo => sample parameter (position and temp)
niceplot(data.mda[scanNum].det[detNum]) => mda data plot
niceplot(data.mda[scanNum].EA[EAscanNum]) => plot EA image
niceplot(data.mda[scanNum].EA[EAscanNum].EDC) => angle integrated data
\ No newline at end of file
......@@ -78,3 +78,16 @@ mv_mag( sample_number, phi)
scanXAS
scanXAS_BL
#
# To setup SRS baseline: (to be added to github)
#======================
#
# With shutter close or slit at 0 (faster), 'INPUT OFFSET' set 'ON' and 'UNCAL'
#- make sure the counts go down (not up) when closing the shutter! If the count goes up without beam, change the INVERT ON/OFF - as of 2021_2 all of our SRSs are INVERT ON (D3/D4/TEY/mesh)
#- Set gain relatively high for the offset (same as sensitivity or more)
#- play with the tweak button one way or the other to get a stable number (ie does not slowly goes down to zero); you might need to play with the +/- for that
#- try decreasing the offset gain: if it drops to zero, then go back to previous gain and increase the number; try again.
#- The goal is to slowly bring the gain down while keeping a non zero signal;
#- adjust until the final INPUT OFFSET gain should be at least 1 order of magnitude lower than the SENSITIVITY with a few hundreds counts
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -237,10 +237,6 @@
"execution_count": 3,
"id": "f14c9c82-bb33-4d90-b131-b109e79a2a63",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
},
"tags": []
},
"outputs": [
......@@ -1238,7 +1234,9 @@
{
"cell_type": "markdown",
"id": "99a12ebd-bdfb-4927-8c60-4982dca1ebe8",
"metadata": {},
"metadata": {
"tags": []
},
"source": [
"<font color='blue'>Since the sample was not perfectly grazing when we measured z, so we iterate:"
]
......@@ -1301,7 +1299,13 @@
"cell_type": "code",
"execution_count": 57,
"id": "7199c4ea-b770-4111-b75b-74c8363b75c5",
"metadata": {},
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
},
"tags": []
},
"outputs": [
{
"name": "stdout",
......@@ -528,7 +528,7 @@ class Scienta:
else:
if len(EAlist)==7: #Swept Mode
scanType="Sweep"
self._spectra_Swept(KElist[0],KElist[1],KElist[2],PE)
self._spectra_Swept(KElist[0],KElist[1],KElist[2],PassEnergy)
parms={'LensMode':LensMode,'PassEnergy':PassEnergy,'KineticEnergy':KElist[0]-.01,'Frames':Frames}
elif len(EAlist)==5: #fixed or baby sweep
if BS is True:
......
......@@ -17,4 +17,11 @@
{'HEG': {0: [[600, [-6635.813431810828, 53.075898114105726, -0.15253171108859886, 0.00019792480095656869, -9.598209896301075e-08]], [3000, [46.600135556920925, 0.8412063733137993, 0.00023492720237763438, -1.2593652551917328e-07, 2.5435326557098538e-11]]], 3: [[400, [1051.452570904546, -13.099314837713008, 0.06939879665006896, -0.00014784669111041307, 1.155031075284652e-07]], [600, [2782.786054275039, -21.145755715684032, 0.06554921272398154, -8.534237586539917e-05, 4.134061079155964e-08]], [3000, [87.23060103156234, 0.7171860430279529, 0.0003793918782124725, -1.9605428816497513e-07, 3.6770897051532086e-11]]], 2: [[590, [-12422.076427583952, 100.54771064816772, -0.29845648627641835, 0.00039688772576782855, -1.97439876026206e-07]], [3000, [-33.02431482418943, 1.1302724323594304, -0.00013479679549416608, 7.22272393581498e-08, -1.373032035520199e-11]]], 1: [[600.0,[-4765.159827798981,39.08508762376964,-0.11372474852884872,0.00015063687981483728,-7.456557379431018e-08]], [3000, [84.53488099145231, 0.7066601865786498, 0.00043283422433330405, -2.2608518373215027e-07, 4.202604094132355e-11]]]}, 'MEG': {0: [[600.0, [-5940.176848239725, 48.30636368582396, -0.14075467796987542, 0.00018579017325356665, -9.17653113254405e-08]], [2200.0, [20.344164869431648, 0.942351240250947, 0.00010121556917763097, -4.949527030585497e-08, 9.675448511744878e-12]], [3000.0, [-4404763.957023886, 8771.484099309775, -6.96403516159204, 0.0027567541197318075, -5.440997034278868e-07, 4.283864981515836e-11]]], 3: [[600.0, [-634.0261758446517, 7.262520018224911, -0.022419323576083252, 3.49681129089603e-05, -1.999932008653819e-08]], [2200.0, [58.93716149881088, 0.8198484295498225, 0.0002490011121555607, -1.2688431897796926e-07, 2.37752539333468e-11]], [3000.0, [-4631113.606305979, 9166.887699472501, -7.234158616723412, 0.002846359389924523, -5.583729142369206e-07, 4.369437481746841e-11]]], 2: [[600.0, [-604.5006436697821, 3.0530278050672597, 0.0006285185258970196, -7.876285868395855e-06, 6.618688516815772e-09]], [2200.0, [34.67137980324179, 0.8848938354598829, 0.00017775770898386393, -9.469862981232054e-08, 1.8324158207531115e-11]], [3000.0, [-2860246.725610371, 5647.919349714751, -4.443144683580959, 0.0017419171106990991, -3.403199365489676e-07, 2.651081000072826e-11]]], 1: [[600.0, [-3677.005333394253, 29.772255818860682, -0.0843978889369737, 0.00011023738262993015, -5.399238835077749e-08]], [2200.0, [46.243321909129264, 0.8454613578261618, 0.00024604317670495594, -1.1956387793694198e-07, 2.0350719268411266e-11]], [3000.0, [-3805516.9914133963, 7585.769563793042, -6.02924886735418, 0.0023897269861474146, -4.7232898993001013e-07, 3.724663288363978e-11]]]}}
======= 20220209:
{'HEG': {0: [[600, [-6635.813431810828, 53.075898114105726, -0.15253171108859886, 0.00019792480095656869, -9.598209896301075e-08]], [3000, [46.600135556920925, 0.8412063733137993, 0.00023492720237763438, -1.2593652551917328e-07, 2.5435326557098538e-11]]], 3: [[400, [1051.452570904546, -13.099314837713008, 0.06939879665006896, -0.00014784669111041307, 1.155031075284652e-07]], [600, [2782.786054275039, -21.145755715684032, 0.06554921272398154, -8.534237586539917e-05, 4.134061079155964e-08]], [3000, [87.23060103156234, 0.7171860430279529, 0.0003793918782124725, -1.9605428816497513e-07, 3.6770897051532086e-11]]], 2: [[590, [-12422.076427583952, 100.54771064816772, -0.29845648627641835, 0.00039688772576782855, -1.97439876026206e-07]], [3000, [-33.02431482418943, 1.1302724323594304, -0.00013479679549416608, 7.22272393581498e-08, -1.373032035520199e-11]]], 1: [[600.0, [-4765.159827798981, 39.08508762376964, -0.11372474852884872, 0.00015063687981483728, -7.456557379431018e-08]], [3000, [84.53488099145231, 0.7066601865786498, 0.00043283422433330405, -2.2608518373215027e-07, 4.202604094132355e-11]]]}, 'MEG': {0: [[600.0, [-3934.5121751152246, 33.06771682164138, -0.09748027014943843, 0.00013134538357912652, -6.6156258423234e-08]], [2200.0, [37.641114276917925, 0.8805247038981882, 0.000177319710501711, -8.681533726733966e-08, 1.637418437746742e-11]], [2475.0, [37283044.37499022, -66946.28212137106, 45.04278902689384, -0.013457675462255252, 1.506533154743431e-06]], [2975.0, [17.45662531316536, 0.9879977565183667, -1.4023065577422464e-05, 4.13598612141151e-08, -1.10678651468184e-11]]], 3: [[600.0, [-327.2776484031912, 4.250523583656505, -0.011420286241297649, 1.7377653116404346e-05, -9.625686600221612e-09]], [2200.0, [115.13378003090979, 0.62518020085401, 0.000493471405264986, -2.541590613504621e-07, 4.7566608931331754e-11]], [2475.0, [67723621.24081981, -121554.95831214589, 81.75236674834781, -0.02441691402082744, 2.7324624578449198e-06]], [2975.0, [282015.3094934323, -421.5392502375951, 0.2368599641813117, -5.886206039411446e-05, 5.4722692634234e-09]]], 1: [[600.0, [-5546.5982856048695, 45.335675108612506, -0.13258153746595475, 0.000176077206850398, -8.750569596947354e-08]], [2200.0, [92.51295555787782, 0.6803805602551622, 0.000465091752020332, -2.401401686918187e-07, 4.423893424043697e-11]], [2475.0, [3449361.27208402, -5801.739949520198, 3.631288689620224, -0.0010005763773733346, 1.0226450881073942e-07]], [2975.0, [3927.9644361329165, 2.1528284786200116, -0.004967658772507909, 2.429386882858212e-06, -3.4831847463365186e-10]]]}}
{'HEG': {0: [[600, [-6635.813431810828, 53.075898114105726, -0.15253171108859886, 0.00019792480095656869, -9.598209896301075e-08]], [3000, [46.600135556920925, 0.8412063733137993, 0.00023492720237763438, -1.2593652551917328e-07, 2.5435326557098538e-11]]], 3: [[400, [1051.452570904546, -13.099314837713008, 0.06939879665006896, -0.00014784669111041307, 1.155031075284652e-07]], [600, [2782.786054275039, -21.145755715684032, 0.06554921272398154, -8.534237586539917e-05, 4.134061079155964e-08]], [3000, [87.23060103156234, 0.7171860430279529, 0.0003793918782124725, -1.9605428816497513e-07, 3.6770897051532086e-11]]], 2: [[590, [-12422.076427583952, 100.54771064816772, -0.29845648627641835, 0.00039688772576782855, -1.97439876026206e-07]], [3000, [-33.02431482418943, 1.1302724323594304, -0.00013479679549416608, 7.22272393581498e-08, -1.373032035520199e-11]]], 1: [[600.0, [-4765.159827798981, 39.08508762376964, -0.11372474852884872, 0.00015063687981483728, -7.456557379431018e-08]], [3000, [84.53488099145231, 0.7066601865786498, 0.00043283422433330405, -2.2608518373215027e-07, 4.202604094132355e-11]]]}, 'MEG': {0: [[600.0, [-3934.5121751152246, 33.06771682164138, -0.09748027014943843, 0.00013134538357912652, -6.6156258423234e-08]], [2200.0, [37.641114276917925, 0.8805247038981882, 0.000177319710501711, -8.681533726733966e-08, 1.637418437746742e-11]], [2475.0, [37283044.37499022, -66946.28212137106, 45.04278902689384, -0.013457675462255252, 1.506533154743431e-06]], [2975.0, [17.45662531316536, 0.9879977565183667, -1.4023065577422464e-05, 4.13598612141151e-08, -1.10678651468184e-11]]], 3: [[600.0, [-327.2776484031912, 4.250523583656505, -0.011420286241297649, 1.7377653116404346e-05, -9.625686600221612e-09]], [2200.0, [115.13378003090979, 0.62518020085401, 0.000493471405264986, -2.541590613504621e-07, 4.7566608931331754e-11]], [2475.0, [67723621.24081981, -121554.95831214589, 81.75236674834781, -0.02441691402082744, 2.7324624578449198e-06]], [2975.0, [282015.3094934323, -421.5392502375951, 0.2368599641813117, -5.886206039411446e-05, 5.4722692634234e-09]]], 2: [[600.0, [-604.5006436697821, 3.0530278050672597, 0.0006285185258970196, -7.876285868395855e-06, 6.618688516815772e-09]], [2200.0, [34.67137980324179, 0.8848938354598829, 0.00017775770898386393, -9.469862981232054e-08, 1.8324158207531115e-11]], [3000.0, [-2860246.725610371, 5647.919349714751, -4.443144683580959, 0.0017419171106990991, -3.403199365489676e-07, 2.651081000072826e-11]]], 1: [[600.0, [-5546.5982856048695, 45.335675108612506, -0.13258153746595475, 0.000176077206850398, -8.750569596947354e-08]], [2200.0, [92.51295555787782, 0.6803805602551622, 0.000465091752020332, -2.401401686918187e-07, 4.423893424043697e-11]], [2475.0, [3449361.27208402, -5801.739949520198, 3.631288689620224, -0.0010005763773733346, 1.0226450881073942e-07]], [2975.0, [3927.9644361329165, 2.1528284786200116, -0.004967658772507909, 2.429386882858212e-06, -3.4831847463365186e-10]]]}}
======= 20220224:
{'HEG': {0: [[600, [-6635.813431810828, 53.075898114105726, -0.15253171108859886, 0.00019792480095656869, -9.598209896301075e-08]], [3000, [46.600135556920925, 0.8412063733137993, 0.00023492720237763438, -1.2593652551917328e-07, 2.5435326557098538e-11]]], 3: [[400, [1051.452570904546, -13.099314837713008, 0.06939879665006896, -0.00014784669111041307, 1.155031075284652e-07]], [600, [2782.786054275039, -21.145755715684032, 0.06554921272398154, -8.534237586539917e-05, 4.134061079155964e-08]], [3000, [87.23060103156234, 0.7171860430279529, 0.0003793918782124725, -1.9605428816497513e-07, 3.6770897051532086e-11]]], 2: [[590, [-12422.076427583952, 100.54771064816772, -0.29845648627641835, 0.00039688772576782855, -1.97439876026206e-07]], [3000, [-33.02431482418943, 1.1302724323594304, -0.00013479679549416608, 7.22272393581498e-08, -1.373032035520199e-11]]], 1: [[600.0, [-4765.159827798981, 39.08508762376964, -0.11372474852884872, 0.00015063687981483728, -7.456557379431018e-08]], [3000, [84.53488099145231, 0.7066601865786498, 0.00043283422433330405, -2.2608518373215027e-07, 4.202604094132355e-11]]]}, 'MEG': {0: [[600.0, [-3934.5121751152246, 33.06771682164138, -0.09748027014943843, 0.00013134538357912652, -6.6156258423234e-08]], [2200.0, [37.641114276917925, 0.8805247038981882, 0.000177319710501711, -8.681533726733966e-08, 1.637418437746742e-11]], [2475.0, [37283044.37499022, -66946.28212137106, 45.04278902689384, -0.013457675462255252, 1.506533154743431e-06]], [3000.0, [17.45662531316536, 0.9879977565183667, -1.4023065577422464e-05, 4.13598612141151e-08, -1.10678651468184e-11]]], 3: [[600.0, [-327.2776484031912, 4.250523583656505, -0.011420286241297649, 1.7377653116404346e-05, -9.625686600221612e-09]], [2200.0, [115.13378003090979, 0.62518020085401, 0.000493471405264986, -2.541590613504621e-07, 4.7566608931331754e-11]], [2475.0, [67723621.24081981, -121554.95831214589, 81.75236674834781, -0.02441691402082744, 2.7324624578449198e-06]], [3000.0, [282015.3094934323, -421.5392502375951, 0.2368599641813117, -5.886206039411446e-05, 5.4722692634234e-09]]], 2: [[600.0, [-604.5006436697821, 3.0530278050672597, 0.0006285185258970196, -7.876285868395855e-06, 6.618688516815772e-09]], [2200.0, [34.67137980324179, 0.8848938354598829, 0.00017775770898386393, -9.469862981232054e-08, 1.8324158207531115e-11]], [3000.0, [-2860246.725610371, 5647.919349714751, -4.443144683580959, 0.0017419171106990991, -3.403199365489676e-07, 2.651081000072826e-11]]], 1: [[600.0, [-5546.5982856048695, 45.335675108612506, -0.13258153746595475, 0.000176077206850398, -8.750569596947354e-08]], [2200.0, [92.51295555787782, 0.6803805602551622, 0.000465091752020332, -2.401401686918187e-07, 4.423893424043697e-11]], [2475.0, [3449361.27208402, -5801.739949520198, 3.631288689620224, -0.0010005763773733346, 1.0226450881073942e-07]], [3000.0, [3927.9644361329165, 2.1528284786200116, -0.004967658772507909, 2.429386882858212e-06, -3.4831847463365186e-10]]]}}
======= 20220302:
{'HEG': {0: [[600.0, [-3934.5121751152246, 33.06771682164138, -0.09748027014943843, 0.00013134538357912652, -6.6156258423234e-08]], [2200.0, [37.641114276917925, 0.8805247038981882, 0.000177319710501711, -8.681533726733966e-08, 1.637418437746742e-11]], [2475.0, [37283044.37499022, -66946.28212137106, 45.04278902689384, -0.013457675462255252, 1.506533154743431e-06]], [3000.0, [17.45662531316536, 0.9879977565183667, -1.4023065577422464e-05, 4.13598612141151e-08, -1.10678651468184e-11]]], 3: [[600.0, [-327.2776484031912, 4.250523583656505, -0.011420286241297649, 1.7377653116404346e-05, -9.625686600221612e-09]], [2200.0, [115.13378003090979, 0.62518020085401, 0.000493471405264986, -2.541590613504621e-07, 4.7566608931331754e-11]], [2475.0, [67723621.24081981, -121554.95831214589, 81.75236674834781, -0.02441691402082744, 2.7324624578449198e-06]], [3000.0, [282015.3094934323, -421.5392502375951, 0.2368599641813117, -5.886206039411446e-05, 5.4722692634234e-09]]], 2: [[600.0, [-604.5006436697821, 3.0530278050672597, 0.0006285185258970196, -7.876285868395855e-06, 6.618688516815772e-09]], [2200.0, [34.67137980324179, 0.8848938354598829, 0.00017775770898386393, -9.469862981232054e-08, 1.8324158207531115e-11]], [3000.0, [-2860246.725610371, 5647.919349714751, -4.443144683580959, 0.0017419171106990991, -3.403199365489676e-07, 2.651081000072826e-11]]], 1: [[600.0, [-5546.5982856048695, 45.335675108612506, -0.13258153746595475, 0.000176077206850398, -8.750569596947354e-08]], [2200.0, [92.51295555787782, 0.6803805602551622, 0.000465091752020332, -2.401401686918187e-07, 4.423893424043697e-11]], [2475.0, [3449361.27208402, -5801.739949520198, 3.631288689620224, -0.0010005763773733346, 1.0226450881073942e-07]], [3000.0, [3927.9644361329165, 2.1528284786200116, -0.004967658772507909, 2.429386882858212e-06, -3.4831847463365186e-10]]]}, 'MEG': {0: [[600.0, [-3934.5121751152246, 33.06771682164138, -0.09748027014943843, 0.00013134538357912652, -6.6156258423234e-08]], [2200.0, [37.641114276917925, 0.8805247038981882, 0.000177319710501711, -8.681533726733966e-08, 1.637418437746742e-11]], [2475.0, [37283044.37499022, -66946.28212137106, 45.04278902689384, -0.013457675462255252, 1.506533154743431e-06]], [3000.0, [17.45662531316536, 0.9879977565183667, -1.4023065577422464e-05, 4.13598612141151e-08, -1.10678651468184e-11]]], 3: [[600.0, [-327.2776484031912, 4.250523583656505, -0.011420286241297649, 1.7377653116404346e-05, -9.625686600221612e-09]], [2200.0, [115.13378003090979, 0.62518020085401, 0.000493471405264986, -2.541590613504621e-07, 4.7566608931331754e-11]], [2475.0, [67723621.24081981, -121554.95831214589, 81.75236674834781, -0.02441691402082744, 2.7324624578449198e-06]], [3000.0, [282015.3094934323, -421.5392502375951, 0.2368599641813117, -5.886206039411446e-05, 5.4722692634234e-09]]], 2: [[600.0, [-604.5006436697821, 3.0530278050672597, 0.0006285185258970196, -7.876285868395855e-06, 6.618688516815772e-09]], [2200.0, [34.67137980324179, 0.8848938354598829, 0.00017775770898386393, -9.469862981232054e-08, 1.8324158207531115e-11]], [3000.0, [-2860246.725610371, 5647.919349714751, -4.443144683580959, 0.0017419171106990991, -3.403199365489676e-07, 2.651081000072826e-11]]], 1: [[600.0, [-5546.5982856048695, 45.335675108612506, -0.13258153746595475, 0.000176077206850398, -8.750569596947354e-08]], [2200.0, [92.51295555787782, 0.6803805602551622, 0.000465091752020332, -2.401401686918187e-07, 4.423893424043697e-11]], [2475.0, [3449361.27208402, -5801.739949520198, 3.631288689620224, -0.0010005763773733346, 1.0226450881073942e-07]], [3000.0, [3927.9644361329165, 2.1528284786200116, -0.004967658772507909, 2.429386882858212e-06, -3.4831847463365186e-10]]]}}
\ No newline at end of file
......@@ -100,3 +100,24 @@
======= 20220215:
{'HEG': {'S1H': 0.25, 'S1V': 0.0, 'S2H': 0.25, 'S2V': 0.25}, 'MEG': {'S1H': 0.125, 'S1V': 0.0, 'S2H': -0.25, 'S2V': 0.0}}
======= 20220222:
{'HEG': {'S1H': 0.25, 'S1V': 0.0, 'S2H': 0.25, 'S2V': 0.25}, 'MEG': {'S1H': 0.1, 'S1V': 0.0, 'S2H': 0.22, 'S2V': 0.0}}
======= 20220228:
{'HEG': {'S2V': 0.25, 'S2H': 0.25, 'S1V': 0.0,'S1H': 0.25 }, 'MEG': {'S2V': 0.0, 'S2H': 0.22, 'S1V': 0.0, 'S1H': 0.1}}
======= 20220302:
{'HEG': {'S2V': 0.25, 'S2H': 0.25, 'S1V': 0.0, 'S1H': 0.25}, 'MEG': {'S2V': 0.0, 'S2H': 0.352, 'S1V': -0.132, 'S1H': 0.12}}
======= 20220302:
{'HEG': {'S2V': -0.3, 'S2H': 0.2, 'S1V': 0.0, 'S1H': 0.0}, 'MEG': {'S2V': 0.0, 'S2H': 0.352, 'S1V': -0.132, 'S1H': 0.12}}
======= 20220308:
{'HEG': {'S2V': -0.3, 'S2H': 0.2, 'S1V': 0.0, 'S1H': 0.0}, 'MEG': {'S2V': 0.2, 'S2H': 0.2, 'S1V': -0.08, 'S1H': 0.16}}
======= 20220310:
{'HEG': {'S2V': -0.3, 'S2H': 0.2, 'S1V': 0.0, 'S1H': 0.0}, 'MEG': {'S2V': 0.133, 'S2H': 0.245, 'S1V': -0.105, 'S1H': 0.17}}
======= 20220310:
{'HEG': {'S2V': -0.3, 'S2H': 0.2, 'S1V': 0.0, 'S1H': 0.0}, 'MEG': {'S2V': 0.107, 'S2H': 0.109, 'S1V': -0.105, 'S1H': 0.166}}
......@@ -722,7 +722,7 @@ class IEXdata:
returns the array for a positioner (x-vale)
usage for 1D data:
plt.plot(mdaPos(305),mdaDet(305,16)/5)
plt..m(mdaPos(305),mdaDet(305,16)/5)
"""
return self.mda[scanNum].posx[posNum].data
......@@ -735,57 +735,138 @@ class IEXdata:
"""
return self.mda[scanNum].det[detNum].data
def plotmda(self,scanNum, detNum, posNum=0, Norm2One=False, **kwargs):
def _plot1D(self,x,y,**kwargs):
"""
x / y 1D numpy arrays
**kwargs
Norm2One: True/False to normalize graph between zero and one
offset: y += offset
scale: y *= scale
offset_x: x += offset_x
scale_x: x *= scale_x
"""
kwargs.setdefault('Norm2One',False)
kwargs.setdefault("offset",0)
kwargs.setdefault("scale",1)
kwargs.setdefault("offset_x",0)
kwargs.setdefault("scale_x",1)
if kwargs['Norm2One']:
y=(y-min(y))/(max(y)-min(y))
#offset and scaling
y=y*kwargs["scale"]+kwargs["offset"]
x=x*kwargs["scale_x"]+kwargs["offset_x"]
#remove nonstandard kwargs
for key in ["Norm2One","offset","scale","offset_x","scale_x"]:
del kwargs[key]
plt.plot(x,y,**kwargs)
def plotmda(self,scanNum, detNum, posNum=0,**kwargs):
"""
simple plot for an mda scans either 1D or a row/column of a 2D data set
detector vs positioner
unscale = False => plotting like normal
= True => normalizes 0-1
**kwargs
row = index for plotting a single row from a 2D data set
column = index for plotting a single row from a 2D data set
Norm2One: True/False to normalize spectra between zero and one (default => False)
offset: y += offset
scale: y *= scale
offset_x: x += offset_x
scale_x: x *= scale_x
2D data: plots image by default
row = index for plotting a single row from a 2D data set
column = index for plotting a single row from a 2D data set
and standard plt.plot **kwargs
e.g. label=str(scanNum), marker="o"
"""
kwargs.setdefault("offset",0)
kwargs.setdefault("scale",1)
kwargs.setdefault("offset_x",0)
kwargs.setdefault("scale_x",1)
if len(self.mda[scanNum].det[detNum].data.shape)==1:
x=self.mda[scanNum].posx[posNum].data
y=self.mda[scanNum].det[detNum].data
pltkwargs = kwargs
elif len(self.mda[scanNum].det[detNum].data.shape)==2:
if "row" in kwargs:
x=self.mda[scanNum].posx[posNum].data[kwargs['row'],:]
y=self.mda[scanNum].det[detNum].data[kwargs['row'],:]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'row'}
if "column" in kwargs:
x=self.mda[scanNum].posx[posNum].data[:,kwargs['column']]
y=self.mda[scanNum].det[detNum].data[:,kwargs['column']]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'column'}
if len(self.mda[scanNum].det[detNum].data.shape)==2:
if "row" not in kwargs and "column" not in kwargs:
self.plotmda2D(scanNum, detNum, **kwargs)
else:
if len(self.mda[scanNum].det[detNum].data.shape)==1:
x=self.mda[scanNum].posx[posNum].data
y=self.mda[scanNum].det[detNum].data
pltkwargs = kwargs
elif len(self.mda[scanNum].det[detNum].data.shape)==2:
if "row" in kwargs:
x=self.mda[scanNum].posx[posNum].data[kwargs['row'],:]
y=self.mda[scanNum].det[detNum].data[kwargs['row'],:]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'row'}
if "column" in kwargs:
x=self.mda[scanNum].posx[posNum].data[:,kwargs['column']]
y=self.mda[scanNum].det[detNum].data[:,kwargs['column']]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'column'}
if Norm2One:
y=(y-min(y))/(max(y)-min(y))
plt.plot(x,y,**pltkwargs)
self._plot1D(x,y,**pltkwargs)
def plotmda_detVdet(self,scanNum, y_detNum, x_detNum,Norm2One=False, **plotkwargs):
"""
simple plotting for an mda scan
detector vs detector
unscale = False => plotting like normal
= True => normalizes 0-1
pltkwargs are the standard plt.plot **kwargs
Norm2One: True/False to normalize spectra between zero and one
**kwargs
offset: y += offset
scale: y *= scale
offset_x: x += offset_x
scale_x: x *= scale_x
2D data: plots image by default
row = index for plotting a single row from a 2D data set
column = index for plotting a single row from a 2D data set
and standard plt.plot **kwargs
e.g. label=str(scanNum), marker="o"
"""
kwargs.setdefault("offset",0)
kwargs.setdefault("scale",1)
kwargs.setdefault("offset_x",0)
kwargs.setdefault("scale_x",1)
x=self.mda[scanNum].det[x_detNum].data
y=self.mda[scanNum].det[y_detNum].data
if Norm2One:
y=(y-min(y))/(max(y)-min(y))
plt.plot(x,y,**plotkwargs)
if len(self.mda[scanNum].det[detNum].data.shape)==2:
if "row" not in kwargs and "column" not in kwargs:
self.plotmda2D(scanNum, detNum, **kwargs)
else:
if len(self.mda[scanNum].det[detNum].data.shape)==1:
x=self.mda[scanNum].posx[posNum].data
y=self.mda[scanNum].det[detNum].data
pltkwargs = kwargs
elif len(self.mda[scanNum].det[detNum].data.shape)==2:
if "row" in kwargs:
x=self.mda[scanNum].posx[posNum].data[kwargs['row'],:]
y=self.mda[scanNum].det[detNum].data[kwargs['row'],:]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'row'}
if "column" in kwargs:
x=self.mda[scanNum].posx[posNum].data[:,kwargs['column']]
y=self.mda[scanNum].det[detNum].data[:,kwargs['column']]
pltkwargs = {key:val for key, val in kwargs.items() if key != 'column'}
self._plot1D(x,y,**pltkwargs)
def plotmda2D(self, scanNum, detNum, **plotkwargs):
"""
......@@ -795,6 +876,53 @@ class IEXdata:
"""
niceplot(self.mda[scanNum].det[detNum], **plotkwargs)
def EAspectra(self,scanNum, EAnum=1, BE=False):
"""
returns the array for an EAspectra, and x and y scaling
usage:
plt.imgshow(data.EAspectra))
"""
EA = self.mda[scanNum].EA[EAnum]
img = EA.data
x = EA.scale['x']
y = EA.scale['y']
if BE:
hv=d.hv
if wk == None:
if d.wk == None:
wk=0
else:
wk=d.wk
x=hv-wk-x
return img, x,y
def EAspectraEDC(self,scanNum, EAnum=1, BE=False):
"""
returns x,y energy scaling, EDC spectra
usage:
plt.plot(data.EAspectraEDC(151))
"""
EA = self.mda[scanNum].EA[EAnum]
x = EA.EDC.scale['x']
y = EA.EDC.data
if BE:
hv=d.hv
if wk == None:
if d.wk == None:
wk=0
else:
wk=d.wk
x=hv-wk-x
return x,y
def plotEDC(self,scanNum, EAnum=1,**kwargs):
"""
simple plotting for EDC
......@@ -815,10 +943,10 @@ class IEXdata:
offset_x: x += offset_x
scale_x: x *= scale_x
"""
kwargs.setdefault("Norm2One",False)
kwargs.setdefault("BE",False)
kwargs.setdefault("wk",None)
kwargs.setdefault("Norm2One",False)
kwargs.setdefault("offset",0)
kwargs.setdefault("scale",1)
kwargs.setdefault("offset_x",0)
......@@ -832,11 +960,6 @@ class IEXdata:
y=d.EDC.data
x=d.EDC.scale['x']
y=y*kwargs["scale"]+kwargs["offset"]
x=x*kwargs["scale_x"]+kwargs["offset_x"]
if kwargs["Norm2One"]:
y=(y-min(y))/(max(y)-min(y))
BE=kwargs["BE"]
wk=kwargs["wk"]
......@@ -849,9 +972,10 @@ class IEXdata:
wk=d.wk
x=hv-wk-x
for key in ["Norm2One","BE","wk","offset","scale","offset_x","scale_x"]:
del kwargs[key]
plt.plot(x,y,**kwargs)
for key in ["BE","wk"]:
del kwargs[key]
self._plot1D(x,y,**kwargs)
if BE:
plt.xlim(max(x),min(x))
......@@ -885,7 +1009,7 @@ class IEXdata:
imkwargs.setdefault("extent",[xscale[0],xscale[-1],yscale[0],yscale[-1]])
plt.xlabel(xunit)
plt.ylabel(yunit)
plt.imshow(img,**imkwargs)
plt.imshow(img,aspect='auto',**imkwargs)
def IT_EA(self):
......
......@@ -264,10 +264,10 @@
#
#
#
# To setup SRS baseline:
# To setup SRS baseline: (to be added to github)
#======================
#
# With shutter close, 'INPUT OFFSET' set 'ON' and 'UNCAL'
# With shutter close or slit at 0 (faster), 'INPUT OFFSET' set 'ON' and 'UNCAL'
#- make sure the counts go down (not up) when closing the shutter! If the count goes up without beam, change the INVERT ON/OFF - as of 2021_2 all of our SRSs are INVERT ON (D3/D4/TEY/mesh)
#- Set gain relatively high for the offset (same as sensitivity or more)
#- play with the tweak button one way or the other to get a stable number (ie does not slowly goes down to zero); you might need to play with the +/- for that
......
......@@ -94,7 +94,7 @@ def AD_SaveFileSetup(ADplugin,**kwargs):
else:
fileNumber=getNextFileNumber(fpath,kwargs["prefix"])
print("NextFile: "+str(fileNumber))
caput(ADplugin+"CreateDirectory",-1) #allows IOC to create directories
caput(ADplugin+"FilePath",fpath)
caput(ADplugin+"FileName",kwargs["prefix"])
caput(ADplugin+"FileNumber",fileNumber)
......@@ -170,9 +170,9 @@ def AD_FreeRun(ADplugin,**kwargs):
kwargs.setdefault("P",ADplugin.split(":")[0]+":")
kwargs.setdefault("R","cam1:")
caput(kwargs["P"]+kwargs["R"]+"Acquire","Done",wait=True,timeout=5*60)
caput(kwargs["P"]+kwargs["R"]+"ImageMode","Continuous");sleep(.1)
caput(ADplugin+"EnableCallbacks","Disable");sleep(.1)
caput(kwargs["P"]+kwargs["R"]+"Acquire","Acquire",wait=True,timeout=5*60);sleep(.1)
caput(kwargs["P"]+kwargs["R"]+"ImageMode","Continuous");sleep(.1)
caput(kwargs["P"]+kwargs["R"]+"Acquire","Acquire");sleep(.1)
def AD_snap(ADplugin,**kwargs):
......@@ -213,6 +213,7 @@ def AD_snap(ADplugin,**kwargs):
caput(kwargs["P"]+kwargs["R"]+"AcquireTime",acqT)
if kwargs["FreeRun"]:
sleep(.1)
AD_FreeRun(ADplugin,**kwargs)
......
......@@ -14,7 +14,7 @@ from datetime import timedelta
#from Macros_29id.EA_29idcEA import*
from Macros_29id.EA_29idcScienta import*
from Macros_29id.ScanFunctions_IEX import ARPES_PVmotor,ARPES_PVextras
from Macros_29id.ScanFunctions_IEX import ARPES_PVmotor,ARPES_PVextras,Scan_ARPES_Motor,Scan_ARPES_2D
from Macros_29id.ScanFunctions_IEX import logname,SaveFile,getNextFileNumber,MDA_CurrentDirectory,mkdir
from Macros_29id.ScanFunctions_IEX import Clear_Scan_Positioners,Scan_FillIn,Scan_FillIn_Table,Scan_Reset_AfterTable
from Macros_29id.ScanFunctions_IEX import Scan_Go, BL_ioc,Tables_BLenergy,ScanFillIn_BLenergy, energy,BL_Mode_Read
......@@ -42,6 +42,8 @@ def EA_IOC_init(**kwargs):
#Addding HDF5 atttributes
filepath='/xorApps/epics/synApps_6_1/ioc/29idcScienta/iocBoot/ioc29idcScienta/HDF5Attributes.xml'
EA._updateAttributes(filepath)
#Allow EA to make directories
caput('29idcScienta:HDF1:CreateDirectory',-1)
#Enabling User CalcOut, needed for BE
caput("29idcScienta:userCalcOutEnable.VAL","Enable")
#Enabling User StringCalc for caQtDM
......@@ -359,6 +361,10 @@ def _BE2KE_setupCalc(BE,DESC,CalcOutNum,OutputPV):
used by scanEA for talking in BE
"""
pvCalcOut="29idcScienta:userCalcOut"+str(CalcOutNum)
if len(OutputPV)==0:
caput(pvCalcOut+"Enable","D")
else:
caput(pvCalcOut+"Enable","E")
caput(pvCalcOut+".DESC", DESC)
caput(pvCalcOut+".A",BE)
caput(pvCalcOut+".INPB","29idmono:ENERGY_MON CP NMS")
......@@ -457,7 +463,9 @@ def scanEA(EAlist,**kwargs):
print("npvCalcOut2",npvCalcOut2)
print('Pos1 table:',arrayP1)
print('Pos2 table:',arrayP2)
else:
_BE2KE_setupCalc(0,"",9,"")
_BE2KE_setupCalc(0,"",10,"")
if kwargs['debug']:
print("EA._spectraSetup: ")
print(EAscanType,EAscanPV, KElist)
......@@ -468,6 +476,7 @@ def scanEA(EAlist,**kwargs):
#executing the scan
if kwargs["run"]==True:
EA.put(EAparms['KineticEnergy'],EAparms['PassEnergy'],LensMode="Angular",Frames=EAparms['Frames'],**kwargs)
sleep(10)
Scan_Go(kwargs["scanIOC"],kwargs["scanDIM"])
#After scan
log_EA(**kwargs)
......@@ -640,8 +649,117 @@ def scanEA_hv(*hvs,EAlist=[],**kwargs):
#After scan
scanEA_reset(**kwargs)
Scan_Reset_AfterTable(kwargs['scanIOC'],scanDIM)
def scanEA_y(EAlist, start,stop,step,mode='absolute',**kwargs):
scanEA_motor(EAlist,'y',start,stop,step,mode=mode,**kwargs)
def scanEA_z(EAlist, start,stop,step,mode='absolute',**kwargs):
scanEA_motor(EAlist,'z',start,stop,step,mode=mode,**kwargs)
def scanEA_motor(EAlist, motor,start,stop,step,mode='absolute',**kwargs):
"""
scans an ARPES motor (scanDIM=2) while triggering the EA (scanDIM=1)
EAlist =
Fixed Mode:["BE",CenterEnergy,PassEnergy,Frames,Sweeps] (5)
Swept Mode:["BE",StartEnergy,StopEnergy,StepEnergy,PassEnergy,Frames,Sweeps] (7)
Baby Sweep (dither):["KE"/"BE",CenterEnergy,PassEnergy,Frames,Sweeps,"BS"] (6)
(+) BE is positive below Ef
(-) BE is negative above Ef
**kwargs
scanIOC=BL_ioc()
run=True
debug=False
(Note: scanDIM=2 is hardcoded)
"""
kwargs.setdefault("scanIOC",BL_ioc())
kwargs.setdefault("run",True)
kwargs.setdefault("debug",False)
#setting up EA
run=kwargs['run']
kwargs['run']=False
kwargs['scanDIM']=1