# psf-photometry-deblender for stellar photometry. AI Agent Connect

> psf-photometry-deblender gives your AI agent the ability to handle complex photometry in crowded stellar fields. It uses simultaneous Point-Spread-Function (PSF) modeling to separate overlapping sources and extract precise measurements from pixel data. You can use it to calculate detection limits, evaluate fit quality, and get specific source uncertainties directly within your AI client.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_5R3Ap3AhEOO97XaAL06BWF07G8oAyfneTbldhzp6/ai-agent-connect
- **Tags:** astronomy, photometry, psf, deblending, stellar-physics

## Description

When you're working with crowded stellar fields, standard photometry often fails because sources overlap. This MCP solves that by allowing your AI agent to perform simultaneous PSF modeling. Instead of treating each star as an isolated point, the tool fits models to pixel data and source positions at the same time. This approach lets your agent deblend overlapping objects to get much cleaner data. You can hand off raw pixel data or source positions to your AI client and have it run complex fits, check how well your agent matches the actual observations, and determine exactly how sensitive your data is to faint objects. It turns a heavy computational task into a direct command for your agent.

## Tools

### analyze_fit_quality
This tool evaluates how well the deblending process actually worked. It checks the success of the fit against your observed data.

### calculate_detection_limits
Use this to find the minimum detectable flux level. It determines the sensitivity thresholds for your specific dataset.

### fit_crowded_field
This tool performs simultaneous PSF fitting. It handles overlapping sources in crowded fields by fitting models to the pixel data.

### get_source_uncertainties
This tool extracts precision measurements for individual sources. It provides the specific error values for your fitted flux or position.

## Prompt Examples

**Prompt:** 
```
Perform a simultaneous PSF fit for these pixel values and source positions.
```

**Response:** 
```
The simultaneous fit is complete. The source fluxes are [120.5, 45.2, 8.9] with a fit quality score of 0.98.
```

**Prompt:** 
```
What are the measurement uncertainties for the fitted sources?
```

**Response:** 
```
The flux errors for the sources are ±0.5, ±0.2, and ±0.1 respectively.
```

**Prompt:** 
```
Calculate the detection limit for this residual image with a noise level of 0.05.
```

**Response:** 
```
The detection limit for a 5-sigma threshold is 0.25 flux units.
```

## Capabilities

### Simultaneous PSF Fitting
Your agent uses this to model multiple overlapping sources at once.

### Source Deblending
The tool separates individual stellar signals in dense clusters.

### Sensitivity Thresholding
Your agent calculates the minimum flux levels detectable in a given image.

### Precision Error Analysis
It extracts specific uncertainty values for each fitted source.

### Fit Validation
Your agent checks the quality of the deblending results to ensure accuracy.

## Use Cases

### Cluster Photometry
Separate individual stars in a crowded globular cluster to get accurate flux values.

### Sensitivity Mapping
Determine the detection limits of an observation to understand what sources are missing.

### Error Estimation
Quickly pull uncertainty values for a large list of fitted sources.

### Model Validation
Check if a deblending attempt actually matches the pixel data accurately.

## Benefits

- Handles overlapping sources through simultaneous modeling.
- Provides direct access to precision uncertainty measurements.
- Automates the calculation of detection limits and sensitivity.
- Validates deblending success through fit quality analysis.

## How It Works

Connect your AI client to Vinkius to start running astronomical models immediately.

1. Connect your preferred MCP client to Vinkius.
2. Provide pixel data or source positions to your agent.
3. Your agent calls the fitting tools to process the data.
4. The MCP returns flux, uncertainties, or quality scores.
5. Your agent interprets the results for your research.

## Frequently Asked Questions

**What is the main purpose of this MCP?**
It provides tools for simultaneous PSF modeling and deblending in crowded stellar fields.

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

**How does it handle overlapping stars?**
It uses simultaneous PSF fitting to model multiple sources at once, allowing for effective deblending.

**Can I get error measurements for my sources?**
Yes, the get_source_uncertainties tool extracts precision measurements for individual sources.

**Do I need to host the MCP myself?**
No, Vinkius hosts and manages the MCP for you. You connect your client and start working.

**What is the primary use of this tool?**
It is used to separate overlapping light profiles from stars in crowded astronomical images using `fit_crowded_field`.

**How can I check if my fit was successful?**
You can use the `analyze_fit_quality` tool to evaluate the residual image and determine the goodness of fit.

**Can I determine the sensitivity of my observations?**
Yes, the `calculate_detection_limits` tool calculates the minimum detectable flux based on the noise level.
