Commit 28613c61 authored by Alessandro Mirone's avatar Alessandro Mirone
Browse files

prima di passare a RIXS XES

parent 0ce7c228
......@@ -814,6 +814,7 @@ def superR_getVolume(mydata):
nuovoDS[:] = scalDS
scalDS = nuovoDS
scalDS.shape = DIMZ*debin[0], DIMY*debin[1], DIMX
Volume = superr.superr( scalDD, scalDS, scalSS, niter=niter, beta=beta)
......
......@@ -222,6 +222,9 @@ class read_id20:
Sum=None
for number in scannumbers:
data, motors, counters, edfmats = self.readscan(number)
print edfmats.shape
if Sum is None:
Sum = np.zeros(edfmats[0].shape ,"f")
Sum[:] += edfmats.sum(axis=0)
......
......@@ -2,7 +2,10 @@ import numpy as np
import h5py
import math
myrank=0
import skimage.restoration
try:
import skimage.restoration
except:
print " ATTENTION : SKIMAGE RESORATION NOT LOADED "
def superr( scalDD, scalDS, scalSS, niter=15, beta=1.0e-8):
"""
......
......@@ -9,21 +9,31 @@ __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
import numpy as np
import array as arr
# try to import the fast PyMCA parsers
# # try to import the fast PyMCA parsers
# try:
# import PyMca.EdfFile as EdfIO
# # use as: data = EdfIO.EdfFile(fname,"r").GetData(0)
# import PyMca.specfilewrapper as SpecIO
# # use as:
# # sf = SpecIO.Specfile(filename)
# # sf.scanno() # returns the number of scans in the SPEC file
# # scan = sf.select('1') # returns the first scan in the specfile
# # scan.data() # np.array of the data
# # scan.alllabels() # Python list of all counter names
# use_PyMca = True
# except:
# use_PyMca = False
try:
import PyMca.EdfFile as EdfIO
# use as: data = EdfIO.EdfFile(fname,"r").GetData(0)
import PyMca.specfilewrapper as SpecIO
# use as:
# sf = SpecIO.Specfile(filename)
# sf.scanno() # returns the number of scans in the SPEC file
# scan = sf.select('1') # returns the first scan in the specfile
# scan.data() # np.array of the data
# scan.alllabels() # Python list of all counter names
import PyMca5.PyMcaIO.EdfFile as EdfIO
import PyMca5.PyMcaIO.specfilewrapper as SpecIO
use_PyMca = True
except:
use_PyMca = False
print " >>>>>>>> use_PyMca " , use_PyMca
__metaclass__ = type # new style classes
def SpecRead(filename,nscan):
......@@ -203,9 +213,12 @@ def ReadEdfImages(ccdcounter, num_pix_x, num_pix_y, path, EdfPrefix, EdfName, Ed
for m in range(len(ccdcounter)):
ccdnumber = ccdcounter[m]
fname = path + EdfPrefix + EdfName + '_' + "%04d" % ccdnumber + EdfPostfix
print " for file ", fname
if use_PyMca == True:
print " using pymca "
edfmats[m,:,:] = PyMcaEdfRead(fname)
else:
print "NOT using pymca "
edfmats[m,:,:] = EdfRead(fname)
return edfmats
......
reload(xes_read)
from XRStools import xes_read, xrs_rois, roifinder_and_gui
import numpy as np
from pylab import *
ion()
xest = xes_read.read_id20('/home/christoph/data/hc2270_xes/rixs')
# ROI
image4roi = xest.SumDirect( [71] )
roifinder = roifinder_and_gui.roi_finder()
roifinder.get_zoom_rois(image4roi)
# set ROI object, load scans
xest.set_roiObj(roifinder.roi_obj)
xest.loadscandirect(70,'part1')
xest.loadscandirect(71,'part2')
xest.getXESspectrum()
xest.getrawdata()
from XRStools import xrs_read,xrs_imaging, xrs_rois, roifinder_and_gui, rixs_read
from pylab import *
ion()
import numpy as np
#data_home = # '/home/christoph/data/rixs_example/'
data_home = '/data/id20/inhouse/data/run3_13/run7_hc738/'
rixs = rixs_read.read_id20(data_home+'rixs1',energyColumn='Anal Energy',monitorColumn='kap4dio')
# ROI
# energy2 is varying during the same scan. It is the energy of the analyser
image4roi = rixs.SumDirect( [237] )
roifinder = roifinder_and_gui.roi_finder()
roifinder.get_zoom_rois(image4roi)
#
rixs.set_roiObj(roifinder.roi_obj)
rixs.loadscan(237,'elastic')
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