Quick Start Guide
This guide will walk you through running your first EstraPy analysis in just a few minutes.
Prerequisites
Make sure you have installed EstraPy and verified the installation with estrapy --version.
Your First Analysis
Step 1: Get the Example Files
Clone or download the EstraPy repository to access the example files:
git clone https://github.com/ramsteak/EstraPy
cd EstraPy/examples
Alternatively, download the examples folder directly from GitHub.
The examples folder contains several complete analysis workflows, each with:
- Input
.estrafiles defining the analysis - Sample data files from synchrotron experiments
- Expected output for verification
Step 2: Explore the Example Files
List the available examples:
ls
You’ll see folders for different types of analyses. Let’s start with a basic example. Navigate to one of the example directories:
cd basic_analysis # or whichever example you want to try
Each example contains:
*.estra- The input file with analysis commandsdata/- Sample synchrotron data filesREADME.md- Description of the analysis (if available)
Step 3: Examine the Input File
Open the .estra file to see the analysis workflow:
cat example.estra
Input files use a simple, readable syntax. Here’s what a typical file looks like:
# version: 2.0.1
# Each file starts with the version of the EstraPy syntax being used
% title "Basic XANES Analysis"
# Load data from synchrotron experiment
filein AD09.xdi --dir AD09data -E BraggEnergy -t I0_eh1 I0_eh2
# Set the energy of the E0 to the K edge of Manganese
edge set Mn.K
# Correct the baseline and normalize the jump
preedge -200eV -60eV --linear
postedge +150eV .. --divide --quadratic --energy
normalize --factor J0
# Export the processed XANES data to a CSV file named AD09.csv
save AD09.csv --columns E mu
# Export the processed EXAFS data to a CSV file as column k, chi, and k*chi
save AD09.csv --columns k chi k*chi
Don’t worry about understanding every command yet - we’ll cover the syntax in detail later.
Step 4: Run the Analysis
Execute the analysis with:
estrapy example.estra
EstraPy will:
- Read, parse and validate your input file
- Execute commands sequentially
- Process the data files
- Generate plots
- Save output files
- Display a log of all operations
You should see output similar to:
[INF] EstraPy - XAS data analysis tool
[INF] (c) 2024 Marco Stecca
[INF] Version 2.0.1
[INF] Imported 1 file in 99.37 ms (122.6kB).
[INF] Set E0 to 6539.0eV for all pages.
[INF] Completed spline background calculation for all pages.
Step 5: Check the Output
After the analysis completes, check your directory for output files:
ls
A new folder should have been created with the results of your analysis. Inside, you’ll find:
- Generated plots (
.png,.pdf, or other image formats) - Exported data files (
.csv,.txt, etc.) - The log file with analysis details
Try More Examples
The examples folder contains several analysis types to explore:
- Basic analysis - Simple data import, processing, and plotting
- Peak fitting - Identify and fit peaks in spectroscopy data
- Batch processing - Analyze multiple files at once
- Advanced plotting - Custom visualization options
Navigate to each example directory and run the provided .estra files to see different capabilities.
Understanding the Workflow
Every EstraPy analysis follows this pattern:
- Write an input
.estrafile with your analysis steps - Run the analysis:
estrapy run yourfile.estra - Review the output files and plots
The command-line interface provides several options:
estrapy input.estra # Run an analysis
estrapy input.estra --verbose # Show detailed output
Creating Your Own Analysis
Now that you’ve run an example, you can create your own analysis:
- Prepare your data files - Ensure your synchrotron data is in a supported format
- Create an input file - Write a new
.estrafile with your analysis steps - Run the analysis - Execute with
estrapy run yourfile.estra
For details on writing input files, see the Input File Syntax documentation.
Common Commands Overview
Here are some essential commands you’ll use in your .estra files:
| Command | Purpose |
|---|---|
import <file> | Load data from a file |
plot <x> vs <y> | Create a plot |
export <file> | Save processed data |
baseline_correction | Remove baseline signal |
normalize | Normalize data values |
Getting Help
- Syntax questions - See Input File Syntax
- Detailed tutorials - Check out Tutorials
- Troubleshooting - Visit Troubleshooting
- Report issues - Open an issue on GitHub
Next Steps
Now that you’ve run your first analysis:
- Explore more examples in the repository
- Read the Input File Syntax guide
- Try modifying an example to analyze your own data
- Check out Tutorials for specific workflows
Ready to dive deeper? Continue to the Input File Syntax documentation.