Commit 52dfba69 authored by Gonzalez, Miguel's avatar Gonzalez, Miguel
Browse files

Changes to integrate and straight routines to handle better the needs for...

Changes to integrate and straight routines to handle better the needs for Salsa, including the hexapod scan (where datp.z is a string array)
parent 393fc5f4
function str_integrate, w_in,r function str_integrate, w_in, r
;+ ;+
;******* ************* ;******* *************
;** User callable ;** User callable
;** function to read a workspace containing a number of 2D data sets ;** function to read a workspace containing a number of 2D data sets
;** Integrate the 2D data to 1D ;** Integrate the 2D data to 1D
;** Typical call w2=str_integrate(w1) ;** Typical call w2 = str_integrate(w1)
;- ;-
take_datp,datp take_datp, datp
;find dimensions/size of w_in
nx =(size(datp.x))[1]
nspec =(size(datp.z))[1] ; & help,datp,/struct & print, datp.z
w_out =fltarr(nx,nspec) ; array for integrated data
;integrate data ; Find dimensions/size of w_in
for ispec=0,nspec-1 do begin nx = (size(datp.x))[1]
w_out[*,ispec]=total(w_in[*,*,ispec],2) nspec = (size(datp.z))[1] ; & help,datp,/struct & print, datp.z
w_out = fltarr(nx, nspec) ; array for integrated data
; Integrate data
for ispec = 0, nspec-1 do begin
w_out[*,ispec] = total(w_in[*,*,ispec], 2)
endfor endfor
;return 2D workspace ; Deal with the Hexapod case in Salsa, where the point information is stored as a string chain
mod_datp,datp,'y',datp.z datp.y_tit = 'scan'
datp.y_tit='scan' if typename(datp.z) eq 'STRING' then mod_datp, datp, 'y', fix(indgen(nspec) + 1) $
give_datp,datp else mod_datp, datp, 'y', datp.z
; Return 2D workspace
give_datp, datp
return, w_out return, w_out
end end
FUNCTION straight_1d, win, interpol=inter, distance=e_d, datp=datp, dX=deltaX, texture=txtr, integrate=integ, Weights=Iweight FUNCTION straight_1d, win, interpol=inter, distance=e_d, datp=datp, dX=deltaX, $
texture=txtr, integrate=integ, Weights=Iweight, $
verbose=verbose
;+ ;+
;******* *********** ;******* ***********
;** User callable ;** User callable
;** The call is w6=straight_1d(w1) ;** The call is w6 = straight_1d(w1)
;** ;**
;** win is a 2D (3D) diffractogram i.e. I(2theta,h) ;** Win is a 2D (3D) diffractogram, i.e. I(2theta,h)
;** where h is the physical height of the multidetector ;** where h is the physical height of the multidetector.
;** wout is a 1D diffractogram i.e. sum over h of I(2theta,h)
;** in which the DS cones should be straightened out
;** For each detector height calculate a vector of 2theta
;** angles and "interpolate" onto equatorial plane
;** ;**
;** h is the physical height of the multidetector ;** Wout is a 1D diffractogram, i.e. sum over h of I(2theta,h)
;** r is the physical radius of the multidetector ;** in which the Debye-Scherrer cones have been straightened out.
;** set them
;** ;**
;** Nov 2011 call straight_2d adding the integrate keyword ;** For each detector height, it calculates a vector of 2theta
;** angles and "interpolates" onto equatorial plane
;**
;** Set the right values for:
;** h = physical height of the multidetector --> in Y
;** r = physical radius of the multidetector --> in call
;**
;** Nov 2011: Call straight_2d adding the integrate keyword
;- ;-
return, straight_2d(win, interpol=inter, distance=e_d, datp=datp, dX=deltaX, /integrate, Weights=Iweight) return, straight_2d(win, interpol=inter, distance=e_d, datp=datp, dX=deltaX, /integrate, Weights=Iweight, verbose=verbose)
end end
This diff is collapsed.
Markdown is supported
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