# Flat-Field Normalizer for precision calibration. AI Agent Connect

> Flat-Field Normalizer gives your AI agent the mathematical tools needed for high-precision sensor calibration. It processes raw frames using sigma clipping and overscan subtraction to produce high-signal-to-noise master flats. You can generate correction maps, flag bad pixels, and run flux conservation checks to ensure your science data remains mathematically sound.

## Overview
- **Category:** scientific-computing
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_ApQu6K5T2z9iZA4jPBM9sIJRMKF9GDcAPC3RIBfD/ai-agent-connect
- **Tags:** calibration, flat-field, astrophotography, signal-processing, data-science

## Description

You can use this MCP to automate the heavy lifting of sensor calibration. Instead of manual processing, your AI client handles the raw calibration frames to build high-precision master flats. It uses sigma clipping and overscan subtraction to keep the signal-to-noise ratio high. Once the master flat is ready, you can generate specific correction maps to scale your science data. The toolset also helps you maintain data integrity by locating unreliable pixels through statistical deviation and running diagnostic checks to confirm flux conservation. It is built for researchers who need to ensure their normalization is mathematically accurate before moving to final analysis.

## Tools

### create_master_flat
This tool builds the primary master flat frame by combining a set of raw calibration frames.

### generate_correction_map
This tool converts your master flat into a multiplier used for scaling science data.

### identify_bad_pixels
This tool finds unreliable pixels that need to be masked out of your dataset.

### validate_flux_conservation
This tool runs a diagnostic check to confirm your normalization is mathematically sound.

## Prompt Examples

**Prompt:** 
```
Generate a master flat from these calibration frames: [{"data": [[100, 101], [102, 100]], "overscan": [10, 10]}].
```

**Response:** 
```
The master flat has been generated with a mean response of 100.75 and an uncertainty map of 0.25.
```

**Prompt:** 
```
Find the bad pixels in this master flat and uncertainty map.
```

**Response:** 
```
Three pixels were flagged as bad pixels due to statistical deviation from their neighbors.
```

**Prompt:** 
```
Check if the flux is conserved using this master flat and correction map.
```

**Response:** 
```
Flux conservation check passed. The flux ratio is 1.0000.
```

## Capabilities

### Master Flat Generation
Your agent uses this to combine raw frames into a single high-signal master.

### Sensitivity Scaling
Your agent creates correction maps to prepare science data for normalization.

### Pixel Masking
Your client identifies statistical outliers to create reliable pixel masks.

### Mathematical Validation
Your agent runs flux conservation checks to verify the integrity of the normalization.

## Use Cases

### Sensor Calibration
Automate the creation of master flats from multiple raw frames.

### Data Cleaning
Identify and mask unreliable pixels before performing science analysis.

### Integrity Verification
Run diagnostic checks to ensure normalization doesn't break flux conservation.

### Sensitivity Mapping
Generate multipliers to correct for pixel-to-pixel sensitivity variations.

## Benefits

- Sigma clipping and overscan subtraction keep signal-to-noise ratios high.
- Statistical deviation checks automate the identification of bad pixels.
- Flux conservation tools provide mathematical verification of your data.

## How It Works

Connect your AI client to Vinkius to start processing calibration data immediately.

1. Connect your preferred MCP-compatible client to Vinkius.
2. Provide raw calibration frames to your agent.
3. Run the master flat generation tool.
4. Generate correction maps or identify bad pixels as needed.
5. Validate the results with a flux conservation check.

## Frequently Asked Questions

**What math does this MCP use for flat-fielding?**
It uses sigma clipping and overscan subtraction to process raw frames into master flats.

**How can I find bad pixels?**
You can use the identify_bad_pixels tool to find pixels that show statistical deviation from their neighbors.

**Can I use this with Claude or Cursor?**
Yes, you can connect this MCP to any MCP-compatible client like Claude, Cursor, or Windsurf.

**How do I know if my normalization is correct?**
You can use the validate_flux_conservation tool to perform a diagnostic check on the mathematical soundness of the normalization.

**What is a correction map?**
A correction map is a multiplier generated from the master flat that is used to scale science data.

**How do I create a master flat?**
Use the `create_master_flat` tool by providing a JSON array of calibration frames containing pixel data and overscan regions.

**Can I detect cosmic ray hits?**
Yes, the `create_master_flat` tool uses sigma clipping to identify and reject outlier pixels like cosmic ray hits during the combination process.

**How do I ensure my correction map is accurate?**
You can use `validate_flux_conservation` to verify that the normalization process maintains the global energy balance.
