# initiate id20 instance basi = xrs_read.read_id16('xrstools/things/licl_test_files/raman') basi.eloss = eloss basi.signals = np.absolute(signals) basi.errors = errors basi.E0 = E0 basi.tth = tth # initiate HFspectrum instance from the theory module hf = theory.HFspectrum(basi,['Ba24Si100'],[1.0],correctasym=[[0.0,0.0]]) # initiate instance of extraction class for background removal # (using the instance of the read_id20 and the HFspectrum class): extr = extraction.extraction(basi,hf) # apply energy dependent corrections to the experimental data (absorption, self-absorption, relativistic scattering cross section) extr.energycorrect(range(17),10,2.3,0.1) # for a quick estimate of the core profile and if the edge is not too far into the compton profile: #extr.removeelastic(range(13,17),[0,50],[800,850],overwrite=True,stoploop=False) #extr.remquickval(range(13,17),[400,1000],[90,120],20) # for extraction of the valence profile: extr.removeelastic(range(13,17),[0,50],[800,850],overwrite=True,stoploop=False)
h2o.load_rois(repertorio +'/rois/as_2m_72_big.txt') print "OK " # h2o.getautorois_eachdet([623],thresfrac=10) # h2o.get_zoom_rois([623]) # h2o.save_rois('/home/christoph/data/ihr_feb15/rois/h2o_72_big.txt') h2o.loadloopdirect([625,629,633,637,641],1) h2o.loadlongdirect(624) print " OK " # h2o.getrawdata() h2o.getspectrum() h2o.geteloss() h2o.gettths(rvd=-41,rvu=85,rvb=121.8,rhl=41.0,rhr=41.0,rhb=121.8,order=[0,1,2,3,4,5]) # O K edge hf = theory.HFspectrum(h2o,['O'],[1.0],correctasym=[[0.0,0.0,0.0]]) extr1 = extraction.extraction(h2o,hf) extr1.analyzerAverage(lowq,errorweighing=False) #extr1.removePearsonAv2([480.0,533.0],[550.0,555.0],scale=3.6,hfcoreshift=0.0) extr1.removeLinearAv([520.0,532.0],scale=0.052) extr1.savetxtsqwav(repertorio+'/as_abs/low_q/h2o_OK.txt', emin=500.0, emax=700.0) x= raw_input()
dia.eloss = eloss dia.signals = np.absolute(signals) dia.errors = errors dia.E0 = E0 dia.tth = tth dia.cenom = np.zeros(len(tth))+15.8 # initiate cprofiles instance hf = theory.HFspectrum(dia,['C'],[1.0],correctasym=[[0.0]]) #plot(hf.eloss,hf.J[:,0],dia.eloss,dia.signals[:,0]) # initiate instance of extraction class for background removal: #reload(extraction) extr = extraction.extraction(dia,hf,prenormrange=[20,np.inf]) plot(extr.eloss,extr.signals[:,0],extr.eloss,extr.J[:,0]) extr.extractval_test(8,linrange1=[340,470],linrange2=[1500,2500]) extr.getallvalprof(8,smoothgval=50.0,stoploop=False) extr.remvalenceprof_test(range(9),eoffset=20.0) ion() clf() plot(extr.eloss,extr.sqw[:,0],extr.eloss,extr.C[:,0]) # save some things for gnuplot thedata = np.zeros((len(extr.eloss),5)) thedata[:,0] = extr.eloss thedata[:,1] = extr.signals[:,8]-0.0002
si.eloss = eloss si.signals = signals si.errors = errors si.E0 = E0 si.tth = tth #pylab.plot(si.eloss,si.signals,'.') #pylab.show() # initiate HFspectrum instance from the theory module for low-q extraction without core asymmetry correction: hf = theory.HFspectrum(si,['Si'],[1.0],correctasym=[[1.5]],correctasym_pertth=[0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 1.5, 1.5, 1.5, 1.5]) # initiate instance of extraction class for background removal # (using the instance of the read_id20 and the HFspectrum class): extr = extraction.extraction(si,hf) # apply energy dependent corrections to the experimental data (absorption, self-absorption, relativistic scattering cross section) extr.energycorrect(range(15),10,2.3,0.2) ion() plot(extr.eloss,extr.signals[:,14],extr.eloss,extr.J[:,14]) # example of removing a pearson function from low-q data (here, you have to play around with # the fitting regions quite a bit, and difficult already for whichq=2) extr.removecoreppearson2(0,[60,98],[105,350]) extr.removecoreppearson2(1,[80,98],[105,250]) # high q valence extraction
licl.geteloss() # set the scattering angle licl.gettths(35) # calculate the momentum transfers licl.getqvals() # plot the experimental data for n in range(len(licl.signals[0,:])): pylab.plot(licl.eloss,licl.signals[:,n],'.') pylab.axis([-50.0,620.0,0.0,0.005]) pylab.show() # create an instance of the HFspectrum class from the theory module hf = theory.HFspectrum(licl,['H2O'],[1.0],correctasym=[[0.0,0.0]]) # create an instance of the extraction class from the extraction # module (using the instances of the read_id20 and HFspectrum classes) extr = extraction.extraction(licl,hf) # remove a constant from the raw data and scale the data to the Hartree-Fock edge jump extr.removeconstpcore(range(9),[527.0,534.5],[545.0,588.0],weights=[1,1],stoploop=False) # average over all 9 spectra extr.averageqs(range(9)) # plot the result pylab.plot(extr.eloss,extr.sqwav) pylab.show()