# Aperture Photometry Calculator AI Agent Connect

> Aperture Photometry Calculator MCP gives your AI agent the math required for professional astronomical photometry. It handles the heavy lifting of extracting flux, estimating local backgrounds, and validating pixel masks to ensure your source measurements are accurate and reliable.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_N7enXOQqfz1j5ycJcBhykQjHaP6Ndu1pmQR2Zu5G/ai-agent-connect
- **Tags:** photometry, astronomy, flux, pixel-analysis, scientific-computing

## Description

You can now give your AI client the ability to perform rigorous photometric analysis on astronomical datasets. Instead of manually calculating flux or background noise, you can instruct your agent to run complete photometric extractions using circular or elliptical apertures. This MCP handles the complex math behind net flux, signal-to-noise ratios, and centroid calculations. It also manages the cleanup phase by identifying which pixels to ignore based on noise or geometry. Whether you are measuring the brightness of a distant star or determining the exact center of a galaxy, this tool provides the deterministic results needed for scientific work. You get detailed pixel audits that include positional uncertainty and local sky levels, making it easy to verify the quality of your measurements.

## Tools

### calculate_aperture_photometry
This tool performs a complete photometric extraction for a single source. It calculates net flux and signal-to-noise ratios based on your chosen aperture.

### calculate_centroid_precision
Use this to determine how accurately a source position is defined. It returns the coordinates and the positional uncertainty.

### estimate_local_background
This tool isolates the background level of a specific region. It is useful for defining the local sky level in an annulus.

### validate_pixel_masks
This tool evaluates which pixels should be ignored during analysis. It checks for noise or geometric issues that might corrupt your data.

## Prompt Examples

**Prompt:** 
```
Calculate the photometry for these pixels: [{'x': 10, 'y': 10, 'value': 100}, {'x': 11, 'y': 11, 'value': 110}] using a circle at (10,10) with radius 2 and an annulus with inner radius 5 and outer radius 10. Read noise is 1.
```

**Response:** 
```
The net flux is 210.0 and the signal-to-noise ratio is 14.49.
```

**Prompt:** 
```
What is the background level for this pixel set in an annulus with inner radius 3 and outer radius 5?
```

**Response:** 
```
The estimated background level is 12.5.
```

**Prompt:** 
```
Check the centroid precision for these pixels with a read noise of 0.5.
```

**Response:** 
```
The centroid is located at (10.0, 10.0) with a positional uncertainty of 0.02.
```

## Capabilities

### Flux Extraction
Your agent calculates net flux and signal-to-noise ratios for specific sources.

### Background Estimation
The tool isolates local sky levels using defined regions like annuli.

### Position Accuracy
It determines the precise center of a source and its positional uncertainty.

### Data Cleaning
The MCP identifies and masks noisy or problematic pixels.

### Aperture Flexibility
It supports both circular and elliptical aperture shapes for different source profiles.

## Use Cases

### Star Brightness Measurement
Measure the net flux of a star to determine its magnitude.

### Galaxy Centroiding
Find the exact center of a galaxy and calculate the positional precision.

### Sky Background Subtraction
Estimate the local background level to ensure accurate source flux.

### Data Quality Audits
Use pixel masks to filter out noise before performing final calculations.

## Benefits

- Removes manual math errors by using deterministic photometric algorithms.
- Provides positional uncertainty to quantify measurement confidence.
- Automates the identification of bad pixels through geometric and noise validation.
- Supports complex aperture shapes for varied astronomical objects.

## How It Works

Connect your client to Vinkius and start sending pixel data for analysis.

1. Connect your MCP-compatible client to the Vinkius host.
2. Provide your agent with pixel coordinates, values, and noise parameters.
3. Your agent calls the specific photometry or background tools.
4. The MCP returns precise numerical results like flux or centroid coordinates.

## Frequently Asked Questions

**What kind of apertures does this MCP support?**
The MCP handles both circular and elliptical apertures for source extraction.

**How does the MCP handle noisy pixels?**
It uses the validate_pixel_masks tool to identify and ignore pixels based on noise or geometry.

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

**Does this provide signal-to-noise ratios?**
Yes, the calculate_aperture_photometry tool provides both net flux and the signal-to-noise ratio.

**How is background level determined?**
The estimate_local_background tool isolates the background level of a specific region, such as an annulus.

**What is the difference between gross and net flux?**
Gross flux is the raw sum of pixel values in the aperture, while net flux is the signal remaining after subtracting the estimated background level.

**How is the background level estimated?**
The `estimate_local_background` tool uses the median of pixels within a defined annulus to ensure robustness against outliers like cosmic rays.

**Can I use elliptical apertures?**
Yes, the `calculate_aperture_photometry` tool supports both circular and elliptical geometries for the aperture and the background annulus.
