{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 🔬 XRayLabTool: Getting Started\n", "\n", "**Interactive tutorial for high-performance X-ray optical property calculations**\n", "\n", "This notebook provides hands-on examples of XRayLabTool's core functionality, from basic calculations to advanced performance optimization techniques.\n", "\n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/imewei/pyXRayLabTool/HEAD?labpath=docs%2Fexamples%2Fgetting_started.ipynb)\n", "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/imewei/pyXRayLabTool/blob/main/docs/examples/getting_started.ipynb)\n", "[![nbviewer](https://img.shields.io/badge/nbviewer-view-blue)](https://nbviewer.org/github/imewei/pyXRayLabTool/blob/main/docs/examples/getting_started.ipynb)\n", "\n", "## 📦 Installation\n", "\n", "If you're running this notebook locally or in Colab, install XRayLabTool first:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "colab-setup" ] }, "outputs": [], "source": [ "# Colab setup: install XRayLabTool and set paths\n", "import os\n", "from pathlib import Path\n", "import sys\n", "\n", "IN_COLAB = \"google.colab\" in sys.modules\n", "if IN_COLAB and sys.version_info < (3, 12):\n", " raise SystemExit(\n", " \"Please switch the Colab runtime to Python 3.12+ (Runtime → Change runtime type).\"\n", " )\n", "\n", "if IN_COLAB:\n", " %pip install -q xraylabtool\n", "\n", "ROOT = Path(\"/content\") if IN_COLAB else Path.cwd()\n", "DATA_DIR = ROOT / \"data\"\n", "DATA_DIR.mkdir(exist_ok=True)\n", "if IN_COLAB:\n", " os.chdir(ROOT)\n", "print(f\"Working dir: {ROOT}\\nData dir: {DATA_DIR}\\nColab: {IN_COLAB}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🚀 Quick Start: Your First Calculation\n", "\n", "Let's start with a simple calculation for silicon dioxide (SiO₂) at 10 keV:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "import xraylabtool as xlt\n", "\n", "# Calculate X-ray properties for quartz (SiO2) at 10 keV\n", "result = xlt.calculate_single_material_properties(\"SiO2\", 10.0, 2.2)\n", "\n", "print(\"🔬 X-ray Properties of SiO₂ at 10 keV:\")\n", "print(f\"📋 Formula: {result.formula}\")\n", "print(f\"⚖️ Molecular Weight: {result.molecular_weight_g_mol:.2f} g/mol\")\n", "print(f\"🎯 Critical Angle: {result.critical_angle_degrees[0]:.3f}°\")\n", "print(f\"📏 Attenuation Length: {result.attenuation_length_cm[0]:.2f} cm\")\n", "print(f\"⚡ Dispersion (δ): {result.dispersion_delta[0]:.2e}\")\n", "print(f\"🔥 Absorption (β): {result.absorption_beta[0]:.2e}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 📊 Energy-Dependent Analysis\n", "\n", "XRayLabTool excels at energy-dependent calculations. Let's analyze how X-ray properties vary across a wide energy range:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Energy range from 1 to 30 keV (logarithmic spacing)\n", "energies = np.logspace(np.log10(1.0), np.log10(30.0), 100)\n", "\n", "# Calculate properties for silicon\n", "si_result = xlt.calculate_single_material_properties(\"Si\", energies, 2.33)\n", "\n", "print(f\"📈 Calculated {len(energies)} energy points for Silicon\")\n", "print(f\"⚡ Energy range: {energies[0]:.1f} - {energies[-1]:.1f} keV\")\n", "print(\n", " f\"📉 δ range: {si_result.dispersion_delta.min():.2e} - {si_result.dispersion_delta.max():.2e}\"\n", ")\n", "print(\n", " f\"📈 Critical angle range: {si_result.critical_angle_degrees.min():.3f}° - {si_result.critical_angle_degrees.max():.3f}°\"\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 📊 Visualization: Energy Dependence\n", "\n", "Let's create an interactive plot showing how X-ray properties change with energy:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Create a comprehensive plot\n", "fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(14, 10))\n", "\n", "# Plot 1: Optical constants (δ and β)\n", "ax1.loglog(\n", " si_result.energy_kev,\n", " si_result.dispersion_delta,\n", " \"b-\",\n", " linewidth=2,\n", " label=\"δ (dispersion)\",\n", ")\n", "ax1.loglog(\n", " si_result.energy_kev,\n", " si_result.absorption_beta,\n", " \"r-\",\n", " linewidth=2,\n", " label=\"β (absorption)\",\n", ")\n", "ax1.set_xlabel(\"Energy (keV)\")\n", "ax1.set_ylabel(\"Optical constants\")\n", "ax1.set_title(\"Silicon: Dispersion & Absorption\")\n", "ax1.legend()\n", "ax1.grid(True, alpha=0.3)\n", "\n", "# Plot 2: Critical angle\n", "ax2.semilogx(si_result.energy_kev, si_result.critical_angle_degrees, \"g-\", linewidth=2)\n", "ax2.set_xlabel(\"Energy (keV)\")\n", "ax2.set_ylabel(\"Critical angle (°)\")\n", "ax2.set_title(\"Silicon: Critical Angle\")\n", "ax2.grid(True, alpha=0.3)\n", "\n", "# Plot 3: Attenuation length\n", "ax3.loglog(si_result.energy_kev, si_result.attenuation_length_cm, \"purple\", linewidth=2)\n", "ax3.set_xlabel(\"Energy (keV)\")\n", "ax3.set_ylabel(\"Attenuation length (cm)\")\n", "ax3.set_title(\"Silicon: Attenuation Length\")\n", "ax3.grid(True, alpha=0.3)\n", "\n", "# Plot 4: Scattering factors\n", "ax4.semilogx(\n", " si_result.energy_kev,\n", " si_result.scattering_factor_f1,\n", " \"orange\",\n", " linewidth=2,\n", " label=\"f1 (real)\",\n", ")\n", "ax4.semilogx(\n", " si_result.energy_kev,\n", " si_result.scattering_factor_f2,\n", " \"cyan\",\n", " linewidth=2,\n", " label=\"f2 (imaginary)\",\n", ")\n", "ax4.set_xlabel(\"Energy (keV)\")\n", "ax4.set_ylabel(\"Scattering factors\")\n", "ax4.set_title(\"Silicon: Atomic Scattering Factors\")\n", "ax4.legend()\n", "ax4.grid(True, alpha=0.3)\n", "\n", "plt.tight_layout()\n", "plt.suptitle(\"🔬 Silicon X-ray Properties: Energy Dependence\", fontsize=16, y=0.98)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔬 Multi-Material Comparison\n", "\n", "Let's compare common X-ray optics materials using XRayLabTool's parallel processing capabilities:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Define common X-ray optics materials\n", "materials_data = {\n", " \"SiO₂ (Fused Silica)\": {\"formula\": \"SiO2\", \"density\": 2.2},\n", " \"Si (Silicon)\": {\"formula\": \"Si\", \"density\": 2.33},\n", " \"Al₂O₃ (Sapphire)\": {\"formula\": \"Al2O3\", \"density\": 3.95},\n", " \"C (Diamond)\": {\"formula\": \"C\", \"density\": 3.52},\n", " \"Au (Gold)\": {\"formula\": \"Au\", \"density\": 19.3},\n", " \"Pt (Platinum)\": {\"formula\": \"Pt\", \"density\": 21.45},\n", "}\n", "\n", "# Extract formulas and densities for batch calculation\n", "formulas = [data[\"formula\"] for data in materials_data.values()]\n", "densities = [data[\"density\"] for data in materials_data.values()]\n", "material_names = list(materials_data.keys())\n", "\n", "# Calculate properties at 10 keV for all materials (parallel processing)\n", "results = xlt.calculate_xray_properties(formulas, 10.0, densities)\n", "\n", "print(\"🚀 Multi-Material Analysis at 10 keV (Cu Kα):\")\n", "print(\"=\" * 70)\n", "print(f\"{'Material':<20} {'θc (°)':<8} {'δ':<12} {'β':<12} {'Atten (cm)':<10}\")\n", "print(\"=\" * 70)\n", "\n", "for name, formula in zip(material_names, formulas, strict=False):\n", " result = results[formula]\n", " θc = result.critical_angle_degrees[0]\n", " δ = result.dispersion_delta[0]\n", " β = result.absorption_beta[0]\n", " atten = result.attenuation_length_cm[0]\n", "\n", " print(f\"{name:<20} {θc:<8.3f} {δ:<12.2e} {β:<12.2e} {atten:<10.2f}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 📊 Material Comparison Visualization" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Create comparison plot\n", "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(15, 6))\n", "\n", "# Extract data for plotting\n", "critical_angles = [results[formula].critical_angle_degrees[0] for formula in formulas]\n", "attenuation_lengths = [\n", " results[formula].attenuation_length_cm[0] for formula in formulas\n", "]\n", "\n", "# Plot 1: Critical angles\n", "bars1 = ax1.bar(\n", " range(len(material_names)),\n", " critical_angles,\n", " color=[\"#FF6B6B\", \"#4ECDC4\", \"#45B7D1\", \"#96CEB4\", \"#FFEAA7\", \"#DDA0DD\"],\n", ")\n", "ax1.set_xlabel(\"Material\")\n", "ax1.set_ylabel(\"Critical Angle (°)\")\n", "ax1.set_title(\"Critical Angles at 10 keV\")\n", "ax1.set_xticks(range(len(material_names)))\n", "ax1.set_xticklabels([name.split(\" \")[0] for name in material_names], rotation=45)\n", "ax1.grid(True, alpha=0.3)\n", "\n", "# Add value labels on bars\n", "for bar, value in zip(bars1, critical_angles, strict=False):\n", " ax1.text(\n", " bar.get_x() + bar.get_width() / 2,\n", " bar.get_height() + 0.01,\n", " f\"{value:.3f}°\",\n", " ha=\"center\",\n", " va=\"bottom\",\n", " fontsize=9,\n", " )\n", "\n", "# Plot 2: Attenuation lengths (log scale)\n", "bars2 = ax2.bar(\n", " range(len(material_names)),\n", " attenuation_lengths,\n", " color=[\"#FF6B6B\", \"#4ECDC4\", \"#45B7D1\", \"#96CEB4\", \"#FFEAA7\", \"#DDA0DD\"],\n", ")\n", "ax2.set_xlabel(\"Material\")\n", "ax2.set_ylabel(\"Attenuation Length (cm)\")\n", "ax2.set_title(\"Attenuation Lengths at 10 keV\")\n", "ax2.set_yscale(\"log\")\n", "ax2.set_xticks(range(len(material_names)))\n", "ax2.set_xticklabels([name.split(\" \")[0] for name in material_names], rotation=45)\n", "ax2.grid(True, alpha=0.3)\n", "\n", "# Add value labels on bars\n", "for bar, value in zip(bars2, attenuation_lengths, strict=False):\n", " ax2.text(\n", " bar.get_x() + bar.get_width() / 2,\n", " bar.get_height() * 1.1,\n", " f\"{value:.2f}\",\n", " ha=\"center\",\n", " va=\"bottom\",\n", " fontsize=9,\n", " )\n", "\n", "plt.tight_layout()\n", "plt.suptitle(\"🔬 X-ray Optics Materials Comparison\", fontsize=16, y=1.02)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ⚡ Performance Demonstration\n", "\n", "XRayLabTool is optimized for high-performance calculations. Let's demonstrate its speed with a large-scale calculation:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import time\n", "\n", "# Large-scale performance test\n", "energy_points = np.linspace(1, 30, 1000) # 1000 energy points\n", "test_materials = [\"Si\", \"SiO2\", \"Al\", \"Al2O3\", \"Fe\", \"Fe2O3\"] * 10 # 60 materials\n", "test_densities = [2.33, 2.2, 2.70, 3.95, 7.87, 5.24] * 10\n", "\n", "print(\"🚀 Performance Test:\")\n", "print(f\"📊 Materials: {len(test_materials)}\")\n", "print(f\"⚡ Energy points: {len(energy_points)}\")\n", "print(f\"🧮 Total calculations: {len(test_materials) * len(energy_points):,}\")\n", "print()\n", "\n", "# Time the calculation\n", "start_time = time.time()\n", "performance_results = xlt.calculate_xray_properties(\n", " test_materials, energy_points, test_densities\n", ")\n", "end_time = time.time()\n", "\n", "# Calculate performance metrics\n", "total_time = end_time - start_time\n", "total_calculations = len(test_materials) * len(energy_points)\n", "calculations_per_second = total_calculations / total_time\n", "\n", "print(f\"⏱️ Calculation time: {total_time:.2f} seconds\")\n", "print(f\"🚀 Performance: {calculations_per_second:,.0f} calculations/second\")\n", "print(\n", " f\"⚡ Average per calculation: {(total_time / total_calculations) * 1000:.3f} milliseconds\"\n", ")\n", "print()\n", "print(\"🎯 This demonstrates XRayLabTool's high-performance capabilities!\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔬 Advanced Example: Synchrotron Beamline Analysis\n", "\n", "Let's simulate a realistic synchrotron beamline scenario where we need to optimize mirror coatings:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Synchrotron beamline energy range (white beam)\n", "beamline_energies = np.logspace(np.log10(5), np.log10(25), 50) # 5-25 keV\n", "\n", "# Mirror coating materials\n", "coating_materials = {\n", " \"Uncoated Si\": {\"formula\": \"Si\", \"density\": 2.33},\n", " \"Pt coating\": {\"formula\": \"Pt\", \"density\": 21.45},\n", " \"Au coating\": {\"formula\": \"Au\", \"density\": 19.3},\n", " \"Rh coating\": {\"formula\": \"Rh\", \"density\": 12.4},\n", " \"Pd coating\": {\"formula\": \"Pd\", \"density\": 12.0},\n", "}\n", "\n", "# Calculate properties for all coatings across the energy range\n", "coating_results = {}\n", "for name, data in coating_materials.items():\n", " result = xlt.calculate_single_material_properties(\n", " data[\"formula\"], beamline_energies, data[\"density\"]\n", " )\n", " coating_results[name] = result\n", "\n", "print(\"🔬 Synchrotron Mirror Coating Analysis\")\n", "print(\"Energy range: 5-25 keV (typical hard X-ray beamline)\")\n", "print(f\"Calculated for {len(coating_materials)} different coatings\")\n", "print(f\"Energy points: {len(beamline_energies)}\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Create comprehensive beamline analysis plot\n", "fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(16, 12))\n", "\n", "colors = [\"#FF6B6B\", \"#4ECDC4\", \"#45B7D1\", \"#96CEB4\", \"#FFEAA7\"]\n", "\n", "# Plot 1: Critical angles vs energy\n", "for i, (name, result) in enumerate(coating_results.items()):\n", " ax1.semilogx(\n", " result.energy_kev,\n", " result.critical_angle_degrees,\n", " color=colors[i],\n", " linewidth=2,\n", " label=name,\n", " marker=\"o\",\n", " markersize=3,\n", " )\n", "ax1.set_xlabel(\"Energy (keV)\")\n", "ax1.set_ylabel(\"Critical Angle (°)\")\n", "ax1.set_title(\"Mirror Coating Critical Angles\")\n", "ax1.legend()\n", "ax1.grid(True, alpha=0.3)\n", "\n", "# Plot 2: Absorption vs energy\n", "for i, (name, result) in enumerate(coating_results.items()):\n", " ax2.loglog(\n", " result.energy_kev,\n", " result.absorption_beta,\n", " color=colors[i],\n", " linewidth=2,\n", " label=name,\n", " marker=\"s\",\n", " markersize=3,\n", " )\n", "ax2.set_xlabel(\"Energy (keV)\")\n", "ax2.set_ylabel(\"Absorption β\")\n", "ax2.set_title(\"Mirror Coating Absorption\")\n", "ax2.legend()\n", "ax2.grid(True, alpha=0.3)\n", "\n", "# Plot 3: Attenuation length\n", "for i, (name, result) in enumerate(coating_results.items()):\n", " ax3.loglog(\n", " result.energy_kev,\n", " result.attenuation_length_cm,\n", " color=colors[i],\n", " linewidth=2,\n", " label=name,\n", " marker=\"^\",\n", " markersize=3,\n", " )\n", "ax3.set_xlabel(\"Energy (keV)\")\n", "ax3.set_ylabel(\"Attenuation Length (cm)\")\n", "ax3.set_title(\"Mirror Coating Penetration Depth\")\n", "ax3.legend()\n", "ax3.grid(True, alpha=0.3)\n", "\n", "# Plot 4: Dispersion\n", "for i, (name, result) in enumerate(coating_results.items()):\n", " ax4.loglog(\n", " result.energy_kev,\n", " result.dispersion_delta,\n", " color=colors[i],\n", " linewidth=2,\n", " label=name,\n", " marker=\"d\",\n", " markersize=3,\n", " )\n", "ax4.set_xlabel(\"Energy (keV)\")\n", "ax4.set_ylabel(\"Dispersion δ\")\n", "ax4.set_title(\"Mirror Coating Dispersion\")\n", "ax4.legend()\n", "ax4.grid(True, alpha=0.3)\n", "\n", "plt.tight_layout()\n", "plt.suptitle(\"🔬 Synchrotron Mirror Coating Optimization Analysis\", fontsize=16, y=0.98)\n", "plt.show()\n", "\n", "# Analysis summary\n", "print(\"\\n📊 Analysis Summary:\")\n", "print(\"• Heavy metals (Pt, Au) show higher critical angles at low energies\")\n", "print(\"• Silicon shows lowest absorption but also lowest critical angles\")\n", "print(\"• Rhodium offers good compromise between reflectivity and stability\")\n", "print(\"• Consider energy-dependent coating selection for optimal performance\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🎯 Interactive Exercises\n", "\n", "Try these exercises to explore XRayLabTool's capabilities:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 1: Custom Material Analysis\n", "\n", "Modify the cell below to analyze your own material of interest:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# 🎯 Exercise 1: Try your own material!\n", "# Change the formula, energy, and density below:\n", "\n", "my_formula = \"CaCO3\" # Try: \"TiO2\", \"BaTiO3\", \"LiF\", etc.\n", "my_energy = 8.048 # Try different energies (Cu Kα = 8.048 keV)\n", "my_density = 2.71 # Look up the density for your material\n", "\n", "my_result = xlt.calculate_single_material_properties(my_formula, my_energy, my_density)\n", "\n", "print(f\"🔬 Analysis of {my_formula} at {my_energy} keV:\")\n", "print(f\"⚖️ Molecular Weight: {my_result.molecular_weight_g_mol:.2f} g/mol\")\n", "print(f\"🎯 Critical Angle: {my_result.critical_angle_degrees[0]:.3f}°\")\n", "print(f\"📏 Attenuation Length: {my_result.attenuation_length_cm[0]:.2f} cm\")\n", "print(f\"⚡ Dispersion: {my_result.dispersion_delta[0]:.2e}\")\n", "print(f\"🔥 Absorption: {my_result.absorption_beta[0]:.2e}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 2: Energy Range Optimization\n", "\n", "Find the optimal energy range for your application:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# 🎯 Exercise 2: Find optimal energy for maximum critical angle\n", "material = \"Si\" # Change this to your material of interest\n", "density = 2.33 # Corresponding density\n", "\n", "# Test different energy ranges\n", "low_energy = np.linspace(1, 10, 50) # Low energy range\n", "high_energy = np.linspace(10, 30, 50) # High energy range\n", "\n", "low_result = xlt.calculate_single_material_properties(material, low_energy, density)\n", "high_result = xlt.calculate_single_material_properties(material, high_energy, density)\n", "\n", "# Find energy with maximum critical angle\n", "max_idx_low = np.argmax(low_result.critical_angle_degrees)\n", "max_idx_high = np.argmax(high_result.critical_angle_degrees)\n", "\n", "print(f\"🔍 Optimization Results for {material}:\")\n", "print(\"Low energy range (1-10 keV):\")\n", "print(\n", " f\" Max critical angle: {low_result.critical_angle_degrees[max_idx_low]:.3f}° at {low_energy[max_idx_low]:.1f} keV\"\n", ")\n", "print(\"High energy range (10-30 keV):\")\n", "print(\n", " f\" Max critical angle: {high_result.critical_angle_degrees[max_idx_high]:.3f}° at {high_energy[max_idx_high]:.1f} keV\"\n", ")\n", "\n", "# Plot the results\n", "plt.figure(figsize=(10, 6))\n", "plt.plot(\n", " low_energy, low_result.critical_angle_degrees, \"b-\", linewidth=2, label=\"1-10 keV\"\n", ")\n", "plt.plot(\n", " high_energy,\n", " high_result.critical_angle_degrees,\n", " \"r-\",\n", " linewidth=2,\n", " label=\"10-30 keV\",\n", ")\n", "plt.scatter(\n", " low_energy[max_idx_low],\n", " low_result.critical_angle_degrees[max_idx_low],\n", " color=\"blue\",\n", " s=100,\n", " marker=\"*\",\n", " label=f\"Max at {low_energy[max_idx_low]:.1f} keV\",\n", ")\n", "plt.xlabel(\"Energy (keV)\")\n", "plt.ylabel(\"Critical Angle (°)\")\n", "plt.title(f\"Critical Angle Optimization for {material}\")\n", "plt.legend()\n", "plt.grid(True, alpha=0.3)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 📚 Next Steps\n", "\n", "**Congratulations!** 🎉 You've completed the XRayLabTool getting started tutorial.\n", "\n", "### 🚀 Explore More:\n", "\n", "- **📖 Documentation**: [pyxraylabtool.readthedocs.io](https://pyxraylabtool.readthedocs.io)\n", "- **💻 CLI Guide**: Learn about the powerful command-line interface\n", "- **⚡ Performance Guide**: Advanced optimization techniques\n", "- **🧬 Scientific Applications**: Real-world case studies\n", "\n", "### 🔬 Advanced Notebooks:\n", "\n", "- **Synchrotron Beamline Design**: Complete beamline optimization\n", "- **X-ray Reflectometry**: Thin film analysis techniques \n", "- **Materials Characterization**: Comprehensive materials analysis\n", "- **Performance Benchmarking**: Speed optimization techniques\n", "\n", "### 💡 Tips for Success:\n", "\n", "1. **Use vectorization**: Pass energy arrays instead of looping\n", "2. **Leverage caching**: Common elements (Si, O, Al, Fe) are pre-cached\n", "3. **Parallel processing**: Use `calculate_xray_properties()` for multiple materials\n", "4. **Monitor performance**: XRayLabTool can achieve 150,000+ calculations/second\n", "\n", "### 🙋 Need Help?\n", "\n", "- **GitHub Issues**: [Report bugs or request features](https://github.com/imewei/pyXRayLabTool/issues)\n", "- **Discussions**: [Community support](https://github.com/imewei/pyXRayLabTool/discussions)\n", "- **CLI Help**: Use `xraylabtool --help` for command-line assistance\n", "\n", "**Happy analyzing!** 🔬✨" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.0" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }