python ../scripts/acquire_environmental_data.py --statusShows progress for all services including:
- Total clusters processed
- Success/no_data/failed counts
- Total observations collected
python ../scripts/acquire_environmental_data.py --clear SRTMThis will:
- Delete ALL cluster processing records for SRTM
- Delete ALL observations from SRTM
- Require "yes" confirmation
- Allow complete re-processing from scratch
# Clear only "no_data" records (retry clusters that returned no data)
python ../scripts/acquire_environmental_data.py --clear SRTM --clear-status no_data
# Clear only "failed" records (retry errors but keep successes)
python ../scripts/acquire_environmental_data.py --clear SRTM --clear-status failedThis will:
- Delete only records with specified status
- Keep other status records intact
- Keep ALL observations (doesn't delete data)
- Useful for retrying after fixing adapter issues
# Clear all SRTM data
python ../scripts/acquire_environmental_data.py --clear SRTM
# Type "yes" when prompted
# Start fresh
python ../scripts/acquire_environmental_data.py --service SRTM \
--clusters clusters_optimized.csv \
--samples df_gtdb_tagged_cleaneed.tsv# Clear only no_data records
python ../scripts/acquire_environmental_data.py --clear SRTM --clear-status no_data
# Type "yes" when prompted
# Resume (will retry no_data clusters, skip successes)
python ../scripts/acquire_environmental_data.py --service SRTM \
--clusters clusters_optimized.csv \
--samples df_gtdb_tagged_cleaneed.tsv# Clear only failed records
python ../scripts/acquire_environmental_data.py --clear SRTM --clear-status failed
# Resume (will retry failures, skip successes and no_data)
python ../scripts/acquire_environmental_data.py --service SRTM \
--clusters clusters_optimized.csv \
--samples df_gtdb_tagged_cleaneed.tsvpython ../scripts/acquire_environmental_data.py --statusExample output:
Service: SRTM
Total clusters: 4789
Processed: 450 (success: 374, no_data: 76)
Remaining: 4339
Observations: 374
cd notebooks
sqlite3 pangenome_env_data/pangenome_env.db-- Count by status
SELECT status, COUNT(*)
FROM cluster_processing
WHERE service_name = 'SRTM'
GROUP BY status;
-- Find failed clusters
SELECT cluster_id, error_message
FROM cluster_processing
WHERE service_name = 'SRTM' AND status = 'failed';
-- Check processing time stats
SELECT
service_name,
COUNT(*) as count,
AVG(processing_time) as avg_time,
MIN(processing_time) as min_time,
MAX(processing_time) as max_time
FROM cluster_processing
WHERE status = 'success'
GROUP BY service_name;
-- Find clusters outside SRTM coverage (-56 to 60 degrees)
SELECT cluster_id, center_lat, center_lon
FROM spatial_clusters
WHERE center_lat NOT BETWEEN -56 AND 60;-- Delete all SRTM records
DELETE FROM cluster_processing WHERE service_name = 'SRTM';
DELETE FROM environmental_observations WHERE dataset = 'SRTM';
-- Delete only no_data SRTM records
DELETE FROM cluster_processing WHERE service_name = 'SRTM' AND status = 'no_data';
-- Commit changes
.quitThe script automatically resumes by:
- Loading all cluster IDs from
spatial_clusterstable - Excluding clusters with
status IN ('success', 'no_data')for the service - Processing remaining clusters
Important: "no_data" results are considered "done" and won't be retried unless you explicitly clear them with --clear-status no_data.
Some clusters legitimately have no data:
- Ocean locations (no SRTM elevation data)
- Polar regions (outside SRTM coverage: -56°S to 60°N)
- No species observations (for GBIF in that area)
- No air quality sensors (for OpenAQ in remote areas)
Retrying these endlessly wastes time. The script marks them as "no_data" and moves on.
When to retry "no_data":
- Adapter was broken (returned no_data incorrectly)
- Wrong geometry/parameters (fixed the query)
- Service was down (temporary outage)
- Location:
notebooks/pangenome_env_data/pangenome_env.db - Format: SQLite3 with WAL mode (concurrent writes supported)
- Current size: ~31 MB
- Expected final: 5-7 GB (all services completed)
Before major operations:
cd notebooks/pangenome_env_data
cp pangenome_env.db pangenome_env.db.backupSQLite WAL mode supports concurrent reads and one writer. If you see this:
- Only one write operation allowed at a time
- Check for stuck processes:
ps aux | grep acquire_environmental - Kill stuck process:
kill <PID>
Check if clusters are outside service coverage:
-- For SRTM, check latitudes
SELECT COUNT(*) FROM spatial_clusters
WHERE center_lat NOT BETWEEN -56 AND 60;# Terminal 1: Run acquisition
python ../scripts/acquire_environmental_data.py --service SRTM ...
# Terminal 2: Watch progress
watch -n 5 "python ../scripts/acquire_environmental_data.py --status"