# Astronomical Image Stacker AI Agent Connect

> Astronomical Image Stacker MCP gives your AI client the specialized math needed for deep-sky image processing. It handles everything from statistical stacking using sigma-clipping to verifying flux integrity and calculating depth metrics. Instead of manual processing, you can direct your agent to align, stack, and validate your data sets directly within your existing workflow.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_sxQFiDkDwwzuz42SUMZN6X84JVOJZYirdZXgwCk9/ai-agent-connect
- **Tags:** astronomy, stacking, photometry, image-processing, science

## Description

You can now give your AI agent the ability to process deep-sky data with scientific precision. This MCP provides the specific statistical tools required to turn a series of noisy astronomical exposures into a single, clean, high-signal image. Rather than manually running scripts, you tell your AI client what you need, and it executes the stacking math for you.

Your agent can use various statistical methods like mean, median, or sigma-clipping to reject outliers and cosmic rays. It doesn't blindly combine pixels; it can check if your images are properly aligned before it starts and verify that the total light from your targets remains accurate after the stack is complete. Once the processing is done, your agent can derive the sensitivity and noise floor of the resulting image, giving you immediate feedback on the quality of your observation run. It's a direct way to move from raw frames to analyzed data without leaving your coding or research environment.

## Tools

### calculate_stacking_metrics
This tool derives sensitivity and depth metrics from a finished stack. It helps you understand the noise floor and effective depth of your processed data.

### stack_images
This tool performs the actual astronomical image stacking. You can choose between mean, median, weighted mean, or sigma-clipped methods to combine your frames.

### validate_alignment
This tool checks if your image set is ready for stacking. It identifies if the frames need geometric transformations to match a reference image.

### verify_flux_integrity
This tool ensures your stacking process is scientifically sound. It checks that the total light from your original sources is preserved in the final stack.

## Prompt Examples

**Prompt:** 
```
Stack these three astronomical images using the sigma-clip method with a threshold of 3.0.
```

**Response:** 
```
The images have been stacked using sigma-clipping. The resulting stacked image includes the propagated variance, exposure map, and rejection counts for the outliers removed.
```

**Prompt:** 
```
Check if these images are ready for stacking against the reference image.
```

**Response:** 
```
The images are not perfectly aligned. They require geometric transformations to match the reference image's coordinate system.
```

**Prompt:** 
```
Calculate the effective depth and noise floor for the completed stack.
```

**Response:** 
```
The effective depth has been calculated based on the relationship between the noise floor and the exposure map.
```

## Capabilities

### Statistical Stacking
Your agent uses sigma-clipping or median methods to remove noise and outliers from frames.

### Geometric Validation
Your agent checks if frames are spatially aligned before attempting to combine them.

### Photometric Verification
Your agent confirms that the total flux of your targets remains consistent after processing.

### Depth Analysis
Your agent calculates the sensitivity and noise floor of the final stacked product.

## Use Cases

### Deep-Sky Image Reduction
Combine multiple long-exposure frames of a nebula using sigma-clipping to remove cosmic rays.

### Alignment Verification
Check if a set of wide-field images is properly aligned before running a stacking job.

### Photometric Quality Control
Verify that the stacking process hasn't altered the total light of the stars you are measuring.

### Observational Analysis
Calculate the effective depth of a stack to determine if you've captured enough signal.

## Benefits

- Reduces manual image processing by letting your agent handle the math.
- Ensures scientific accuracy through flux integrity and alignment checks.
- Provides immediate depth and sensitivity metrics after stacking.
- Supports multiple statistical methods like sigma-clipping for better outlier rejection.

## How It Works

Connect your client to Vinkius and start sending image processing commands to your agent.

1. Connect your MCP-compatible client to the Vinkius hosted connector.
2. Provide your raw astronomical image files to your AI agent.
3. Instruct your agent to validate alignment or stack the images using a specific method.
4. Your agent executes the math and returns the processed data or metrics.

## Frequently Asked Questions

**What stacking methods does this MCP support?**
The MCP supports mean, median, weighted mean, and sigma-clipped stacking methods.

**How does the MCP handle image alignment?**
The validate_alignment tool checks if images are ready for stacking or if they need geometric transformations to match a reference.

**Can I check if my data is still accurate after stacking?**
Yes, you can use the verify_flux_integrity tool to ensure the total light of your sources is preserved.

**What kind of metrics can my agent calculate?**
Your agent can use calculate_stacking_metrics to find the effective depth and noise floor of a stack.

**Which AI clients can use this MCP?**
You can use this MCP with any compatible client like Claude, Cursor, Windsurf, or VS Code.

**What is the difference between mean and sigma-clipped stacking?**
Mean stacking is a simple average, while sigma-clipped stacking iteratively rejects pixels that deviate significantly from the mean to remove artifacts like cosmic rays.

**How can I check if my images are aligned?**
You can use the `validate_alignment` tool to check if your images are spatially synchronized or require geometric transformations.

**Does this tool ensure flux conservation?**
Yes, the `verify_flux_integrity` tool provides a diagnostic report to ensure the stacking process has preserved the total light of the original sources.
