Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
jokasimr committed Oct 20, 2023
1 parent de67273 commit 8578278
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions docs/examples/amor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
"from essreflectometry.amor.load import load\n",
"from essreflectometry.amor.beamline import make_beamline\n",
"from essreflectometry.amor.conversions import specular_reflection\n",
"from essreflectometry.amor.resolution import add_resolutions, compute_resolution\n",
"from essreflectometry.amor.resolution import compute_resolution\n",
"from essreflectometry.amor.normalize import normalize_by_supermirror\n",
"from essreflectometry.amor.calibrations import supermirror_calibration\n",
"from essreflectometry.reflectometry.corrections import footprint_correction, normalize_by_counts\n",
"from essreflectometry.reflectometry.conversions import providers\n",
"from essreflectometry.reflectometry.types import (\n",
" ThetaBins, WavelengthBins, Sample, Reference, Sample, SampleRotation, Filename,\n",
" ThetaBins, WavelengthBins, Sample, Reference, Sample, SampleRotation, Filename, Raw, BeamlineParams,\n",
" ThetaData, WavelengthData, HistogrammedByQ, QDataWithResolutions, QData, QBins, NormalizedIOverQ\n",
")\n",
"\n",
"\n",
"pipeline = sciline.Pipeline(\n",
" [load, make_beamline, specular_reflection, footprint_correction,\n",
" add_resolutions, compute_resolution, normalize_by_counts, supermirror_calibration, normalize_by_supermirror]\n",
" compute_resolution, normalize_by_counts, supermirror_calibration, normalize_by_supermirror]\n",
" + providers,\n",
" params={\n",
" ThetaBins: sc.linspace(dim='theta', start=0, stop=np.pi/2, num=2, unit='rad'),\n",
Expand All @@ -49,7 +49,8 @@
"metadata": {},
"outputs": [],
"source": [
"pipeline.compute(HistogrammedByQ[QData[Reference]])"
"normalized = pipeline.compute(NormalizedIOverQ)\n",
"normalized.plot(norm='log') + normalized.mean('detector_number').plot(norm='log')\n"
]
},
{
Expand All @@ -58,9 +59,25 @@
"metadata": {},
"outputs": [],
"source": [
"(pipeline.compute(WithResolution)\n",
" .bins.concat('detector_number').hist(wavelength=200)\n",
" .plot())"
"# Diagnostics plot\n",
"(pipeline.compute(ThetaData[Sample])\n",
" .bins.concat('detector_number')\n",
" .hist(\n",
" theta=sc.linspace(dim='theta', start=0.0, stop=1.2, num=165, unit='deg').to(unit='rad'),\n",
" wavelength=sc.linspace(dim='wavelength', start=0, stop=15.0, num=165, unit='angstrom'),\n",
" )\n",
" .plot())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import plopp\n",
"\n",
"[]"
]
}
],
Expand Down

0 comments on commit 8578278

Please sign in to comment.