Progressive tutorials for learning Hazelbean geospatial workflows
This directory contains 5 focused tutorial examples that teach core Hazelbean workflows through practical, copy-pasteable code. Each example builds on the previous one and can be run independently.
Learning Time: 5 minutes
Prerequisites: Basic Python knowledge
Learn how to initialize a Hazelbean ProjectFlow for organized geospatial workflows. Understand automatic directory creation and data discovery hierarchy.
Key concepts:
- ProjectFlow initialization
- Directory management (
input/,intermediate/,output/) - Data discovery paths
Learning Time: 10 minutes
Prerequisites: Completed step 1
Learn Hazelbean's intelligent file discovery system and basic raster loading operations.
Key concepts:
get_path()for smart file location- Raster information extraction
- Loading geospatial arrays
- Error handling for missing data
Learning Time: 15 minutes
Prerequisites: Completed steps 1-2
Learn fundamental raster operations including transformations, resampling, and mathematical operations.
Key concepts:
- Raster resampling and warping
- Array-based mathematical operations
- Statistical calculations
- Synthetic data creation
Learning Time: 20 minutes
Prerequisites: Completed steps 1-3
Learn advanced spatial analysis including multi-raster operations, spatial calculations, and pattern analysis.
Key concepts:
- Multi-raster combinations
- Zone-based statistics
- Neighborhood analysis
- Hot spot identification
- Spatial pattern detection
Learning Time: 15 minutes
Prerequisites: Completed steps 1-4
Learn proper result organization, output formatting, and project documentation.
Key concepts:
- Organized output directory structure
- Metadata creation
- Analysis reporting
- Professional project organization
- Hazelbean installed in conda environment
- Basic Python programming knowledge
-
Activate your conda environment:
conda activate hazelbean_env
-
Navigate to examples directory:
cd examples -
Run each example in sequence:
python step_1_project_setup.py python step_2_data_loading.py python step_3_basic_processing.py python step_4_analysis.py python step_5_export_results.py
Each example provides clear console output showing:
- ✓ Successful operations
- ✗ Missing data with graceful fallbacks
- 🎉 Completion messages with next steps
After running all examples, you'll have:
hazelbean_tutorial/
├── input/ # Input data directory
├── intermediate/ # Processing files
│ └── analysis_summary.txt
└── output/ # Final results
└── tutorial_analysis_[timestamp]/
├── rasters/ # Analysis outputs
└── reports/ # Documentation
By completing these tutorials, you will understand:
- Project Organization: How to structure geospatial analysis projects
- Data Management: Intelligent file discovery and loading
- Raster Processing: Basic transformations and mathematical operations
- Spatial Analysis: Multi-raster operations and pattern detection
- Professional Workflow: Result organization and documentation
These examples are designed to be modified for your own projects:
- Replace sample data with your own geospatial files
- Modify processing steps for your specific analysis needs
- Extend analysis functions using additional Hazelbean capabilities
- Adapt output formats for your reporting requirements
- Hazelbean Documentation:
/docs/directory - Test Examples:
/hazelbean_tests/for advanced usage patterns - Performance Demos:
/examples/baseline_management_demos/for benchmarking
Common issues:
- Import errors: Ensure hazelbean conda environment is activated
- Missing data: Examples gracefully handle missing sample files with synthetic data
- Path issues: Examples use
get_path()for cross-platform compatibility
Need help? These examples are self-contained and include error handling for common issues. Each step provides clear guidance for the next tutorial.
Happy learning with Hazelbean! 🌿
These example files are the source for auto-generated QMD tutorials that create a learning website.
# From project root:
python tools/education/generate.py
# Then render to HTML:
conda activate hazelbean_env
cd docs/educational
quarto render *.qmd# Generate only steps 1 and 3:
python tools/education/generate.py --steps step_1,step_3
# Preview what would be generated:
python tools/education/generate.py --dry-run- QMD files:
docs/educational/*.qmd - HTML files:
docs/educational/*.html(after rendering) - Index page:
docs/educational/index.html- Learning path overview
- Main script:
tools/education/generate.py - Configuration:
tools/education/config.yaml - Templates:
tools/education/templates/ - Documentation:
tools/education/README.md
To modify tutorial content: Edit the Python files in this directory, then regenerate.
The Educational Content Generator (5 files, ~300 lines) replaces the complex 58-file QMD automation system with a simple tool focused specifically on educational content.