SmartCane/python_app/experiments/README_SAR.md
2025-09-05 15:23:41 +02:00

87 lines
2.6 KiB
Markdown

# Sentinel-1 SAR Download for Aura Fields
This folder contains scripts to download and preprocess Sentinel-1 SAR data for crop monitoring.
## Quick Start
### 1. Setup Environment
```powershell
# Navigate to the python_scripts directory
cd "c:\Users\timon\Resilience BV\4020 SCane ESA DEMO - Documenten\General\4020 SCDEMO Team\4020 TechnicalData\WP3\smartcane\python_scripts"
# Run setup script
python setup_sar_environment.py
```
### 2. Get SentinelHub Credentials
- Go to https://apps.sentinel-hub.com/
- Create account (free tier available)
- Get your Client ID and Client Secret
- The script will prompt for these when you first run it
### 3. Prepare Field Boundaries
- Make sure you have your field boundaries in GeoJSON format
- The script will look for files like:
- `pivot.geojson` (current directory)
- `pivot_20210625.geojson` (current directory)
- `data/aura/field_boundaries/aura_fields.geojson`
### 4. Download SAR Data
```powershell
python download_s1_aura.py
```
## What the Script Does
1. **Downloads last 8 weeks** of Sentinel-1 data
2. **Downloads both VV and VH polarizations**
3. **Provides both linear and dB scales** for analysis
4. **Applies basic speckle filtering**
5. **Organizes by week** (week_XX_YYYY_BAND.tif format)
## Output Structure
```
data/aura/weekly_SAR_mosaic/
├── week_24_2025_VV.tif
├── week_24_2025_VH.tif
├── week_24_2025_VV_dB.tif
├── week_24_2025_VH_dB.tif
├── week_24_2025_VV_dB_filtered.tif
├── week_24_2025_VH_dB_filtered.tif
└── ... (for each week)
```
## Files Created
- **`download_s1_aura.py`** - Main download script
- **`requirements_sar.txt`** - Python dependencies
- **`setup_sar_environment.py`** - Environment setup helper
- **`sar_download.log`** - Download log file
## Troubleshooting
### Common Issues:
1. **Import errors**: Run `python setup_sar_environment.py` first
2. **Credential errors**: Make sure SentinelHub credentials are correct
3. **No data found**: Check if field boundaries are loaded correctly
4. **Large downloads**: SAR data can be large, ensure good internet connection
### Check Log File:
```powershell
Get-Content sar_download.log -Tail 20
```
## Next Steps
After successful download:
1. Check the output files in `data/aura/weekly_SAR_mosaic/`
2. Move to R for analysis and visualization
3. Create SAR analysis scripts in R
## Notes
- **Free Tier Limits**: SentinelHub free tier has processing unit limits
- **Data Size**: Each weekly mosaic can be 50-200MB depending on area
- **Processing Time**: Downloads can take 5-15 minutes per week
- **Format**: All outputs are GeoTIFF with proper CRS information