- Home
- Skills
- Workflow Automation
- envi-automation-skill
Envi Automation Skill
by Shihao Yu
Automate ENVI/IDL remote-sensing workflows with tested, step-by-step guidance, IDL pipeline templates, and Windows GUI screenshot automation.
Free
envi-automation-skill
Example session with this skill installed
I need an IDL script to run FXSegmentation on 'E:\data\input.hdr' and save to 'E:\data\output.dat' using the Edge algorithm with scale 50. Provide the Python runner too.
- Read your context and instructions
- Compiled the envi-automation-
I have generated the IDL procedure and the Python runner. I have ensured the IDL code includes the mandatory ENVI initialization and uses CRLF line endings to prevent syntax errors.
ENVI FXSegmentation Automation
; segment_task.pro
pro segment_task
compile_opt idl2
; Setup paths
src = 'E:\data\input.hdr'
seg = 'E:\data\output.dat'
; Delete existing output to prevent ENVI overwrite error
if file_search(seg) ne '' then file_delete, seg
; Initialize ENVI 6.2/5.6 environment
e = ENVI()
raster = e.OpenRaster(src)
; Configure Segmentation Task
task = ENVITask('FXSegmentation')
task.INPUT_RASTER = raster
task.SEGMENT_ALGORITHM = 'Edge'
task.SEGMENT_VALUE = 50.0
task.MERGE_ALGORITHM = 'Full Lambda Schedule'
task.MERGE_VALUE = 60.0
task.OUTPUT_RASTER_URI = seg
task.Execute
e.Close
end
import subprocess
import os
def run_segmentation(idl_path, script_dir):
# Use stdin pipe as -e / -rt flags are unreliable
p = subprocess.Popen(
[idl_path],
cwd=script_dir,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
# Send commands to the IDL kernel
commands = ".compile segment_task\nsegment_task\nexit\n"
out, _ = p.communicate(input=commands.encode())
print(out.decode('gbk', errors='ignore'))
# Example usage
# run_segmentation(r'C:\Program Files\NV5\ENVI62\IDL92\bin\bin.x86_64\idl.exe', 'E:\\data')
Next steps
- Verify that
E:\data\input.hdrexists and the path contains no non-ASCII characters. - Run the Python script to trigger the IDL kernel via the stdin pipeline.
- Check the
output.datfile in the data directory after the process exits.
Connects securely to your tools. The creator never sees your data.
About this skill
Managing remote sensing imagery in ENVI and IDL often leads to frustration with broken command-line arguments, blurry programmatic screenshots, and deprecated API calls. This skill provides a verified automation framework for remote sensing engineers to execute reliable batch processing and GUI-driven workflows.
What it does
- Headless Execution executes IDL scripts via stable stdin piping, bypassing broken CLI flags like
-eor-rt. - Object Segmentation automates
FXSegmentationfor high-resolution imagery using optimized Edge and Quadtree algorithms. - Reliable Screenshots captures native-resolution GUI outputs using the Windows compositor (Win+Shift+S) to avoid DPI scaling blur.
- API Version Bridging resolves common
ENVITaskinitialization errors between ENVI 5.6 and 6.2 versions. - Vector Export automates the conversion of classification results into ready-to-use shapefiles.
- Environment Management auto-detects ENVI installations and ensures correct license paths and file encoding (CRLF) for IDL.
How it works
- Environment Probe detects the local ENVI/IDL installation path and verifies the license server configuration.
- Script Preparation converts processing scripts to CRLF line endings and ensures all file paths use ASCII characters.
- Pipeline Execution initiates a subprocess to pipe
.compileand execution commands directly into the IDL kernel. - GUI Capture triggers the Windows screen snip overlay, automates a drag-and-drop selection, and exports the clipboard to PNG.
Frameworks & tools
This tool targets ENVI (5.6 and 6.2) and IDL (8.5 to 9.2). It utilizes Python for orchestration, leveraging subprocess for kernel communication, ctypes for Windows API interaction, and numpy for direct raster manipulation.
Why this beats prompting it yourself
Generic AI prompts often suggest outdated IDL flags or fail to account for the mandatory e = ENVI() initialization required in newer versions. This skill includes pre-tested logic for handling Windows-specific UI quirks and DPI scaling issues that typically break basic automation scripts.
Use cases
- Running large-scale satellite imagery classification in headless batch mode.
- Automated extraction of urban land-use objects using FXSegmentation and rule-based filtering.
- Generating high-quality, high-resolution visual reports from ENVI GUI dialogs.
- Debugging IDL syntax errors caused by encoding mismatches or licensing issues.
Known limitations
Does not support non-ASCII characters in file paths due to IDL kernel restrictions. Headless execution of specific tasks like BinaryLTThresholdRaster may hang and requires Python-side calculation instead.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 14 days ago
- Free with an Agensi account
- Software
Python
Git
Permissions
What's inside
Creator
Shihao Yu
Frequently Asked Questions
New in Workflow Automation
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.