kklmn / xrt

Package xrt (XRayTracer) is a python software library for ray tracing and wave propagation in x-ray regime. It is primarily meant for modeling synchrotron sources, beamlines and beamline elements.
MIT License
84 stars 30 forks source link

2D flux density from DCM and DMM #50

Closed angelicacecilia closed 4 years ago

angelicacecilia commented 4 years ago

Good morning, Sorry for editing wrongly the python xrt issue. I am very new in this community. I would like to calculate the 2D flux density at the sample position after the beam has been diffracted from a DMM. For this purpose I have specified the DMM as described in the script below to get the 2D flux at 10000 eV.

mL1 = rmats.Material('Si', rho=2.33)
mBC4 = rmats.Material(('B','C'),quantities=(1,4),rho=2.52)
mW = rmats.Material('W',rho=19.3)
mSi = rmats.Material('Si', rho=2.33)
mL = rmats.Multilayer(mW, 18, mBC4, 36, 80, mSi)

P23_Main.SSRL_DMM = roes.DCM(
bl=P23_Main,
name=r"DMM",
center=[0, 50000, r"auto"],
surface =(mL1,), material=(mL,),
material2=(mL,),
fixedOffset=20,
bragg=[10000])

To get the histogram I used this plot option:

plot05 = xrtplot.XYCPlot(
beam=r"SampleScreenFootprint",
xaxis=xrtplot.XYCAxis(
label=r"x"),
yaxis=xrtplot.XYCAxis(
label=r"z"),
caxis=xrtplot.XYCAxis(
label=r"energy",
unit=r"eV",
limits=[4820,4890],
offset=0),
title=r"05 - Sample",
fluxFormatStr=r"%g")
plots.append(plot05)
return plots

where:

SampleScreenFootprint = P23_Main.SampleScreen.expose(
beam=SSRL_DMMbeamGlobal01)

the program does not work with the DMM optical element. Can I ask you for help? thank you in advance for the help. Best Greetings, Angelica