Quickstart
This guide will help you get started with nbragg quickly.
Basic Usage
Here’s a simple example of how to use nbragg:
import nbragg
# Read transmission data
data = nbragg.Data.from_transmission("your_data.csv")
# Define cross-section
xs = nbragg.CrossSection.from_material(nbragg.materials["Silicon"])
# Create transmission model
model = nbragg.TransmissionModel(xs,
vary_background=True,
vary_response=True)
# Perform fitting
result = model.fit(data)
# Plot results
result.plot()
Key Concepts
Data Loading: Use
nbragg.Data.from_transmission()to load experimental data.Cross-Section: Define material properties using
nbragg.CrossSection.Model Creation: Build a transmission model with flexible parameters.
Fitting: Use the
fit()method to analyze your data.Visualization: Easily plot results with the
plot()method.