fit_uv_model
Fit parametric source models directly to uv visibilities from .npz/.csv files to estimate source parameters, covariance errors, and reduced chi-squared.
Instructions
Fit a parametric source model directly to visibilities (u, v, Re, Im, weight) from .npz or .csv.
Models: point, gaussian (circular, FWHM), elliptical_gaussian (FWHM major, axis ratio, PA), uniform_disk (diameter, inclination, PA), ring (radius, Gaussian FWHM width via the thin-ring x Gaussian approximation, valid for width << radius; inclination, PA). All carry flux_jy and offsets dra_arcsec (east), ddec_arcsec. chi^2 = sum w [(Re - Re_m)^2 + (Im - Im_m)^2] with CASA WEIGHT = 1 / sigma^2 per real and per imaginary part. rescale_weights: 'none', or 'residual_scatter' (refit after scaling weights so the residual scatter of sqrt(w) (Re, Im) has unit robust std; pipeline weights are often off by factors 2-4). fixed: parameters to hold, e.g. {"dra_arcsec": 0}. uv_range_klambda: [min, max] selection. Starting offsets come from the peak of a coarse dirty map within search_radius_arcsec of the phase centre (unless given in initial); sizes, PA and inclination are grid-searched before the least-squares fit. Returns least-squares values with covariance errors (statistical only), reduced chi^2 and the weight scale; mcmc=True adds an emcee posterior (uniform priors in bounds; needs the [fit] extra). Limits: flux errors exclude the absolute flux scale (about 5-10%, add in quadrature); sizes near the resolution limit need S/N >= 8-10; the model sign convention matters for offsets (see model_visibilities).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"vis_path": "<vis_path>"
},
"name": "fit_uv_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mcmc | No | ||
| seed | No | ||
| fixed | No | ||
| model | No | gaussian | |
| initial | No | ||
| uv_unit | No | lambda | |
| freq_ghz | No | ||
| vis_path | Yes | ||
| mcmc_steps | No | ||
| mcmc_walkers | No | ||
| rescale_weights | No | none | |
| uv_range_klambda | No | ||
| search_radius_arcsec | No |