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

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
;** function to read a workspace containing a number of 2D data sets
;** Integrate the 2D data to 1D
;** Typical call w2=str_integrate(w1)
;** Typical call w2 = str_integrate(w1)
;-
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
take_datp, datp
;integrate data
for ispec=0,nspec-1 do begin
w_out[*,ispec]=total(w_in[*,*,ispec],2)
; 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
for ispec = 0, nspec-1 do begin
w_out[*,ispec] = total(w_in[*,*,ispec], 2)
endfor
;return 2D workspace
mod_datp,datp,'y',datp.z
datp.y_tit='scan'
give_datp,datp
; Deal with the Hexapod case in Salsa, where the point information is stored as a string chain
datp.y_tit = 'scan'
if typename(datp.z) eq 'STRING' then mod_datp, datp, 'y', fix(indgen(nspec) + 1) $
else mod_datp, datp, 'y', datp.z
; Return 2D workspace
give_datp, datp
return, w_out
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
;** 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)
;** 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
;** Win is a 2D (3D) diffractogram, i.e. I(2theta,h)
;** where h is the physical height of the multidetector.
;**
;** h is the physical height of the multidetector
;** r is the physical radius of the multidetector
;** set them
;** Wout is a 1D diffractogram, i.e. sum over h of I(2theta,h)
;** in which the Debye-Scherrer cones have been straightened out.
;**
;** 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
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