Skip to content

aplavin/InterFit.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InterFit.jl 🌌📡

An interactive tool for fitting interferometric models to Very Long Baseline Interferometry (VLBI) visibility data, with Bayesian parameter and uncertainty estimation. image

Features ✨

Think of it like difmap's modelfit, but more automatic, with robust uncertainty quantification, and rich real-time diagnostics.

Core Capabilities

  • Automatic Fitting 🎯: No manual component placement needed - finds globally optimal solutions using MCMC sampling
  • Flexible Multi-Component Models 🔧: Flexible circular and elliptical Gaussian components powered by InterferometricModels.jl
  • Bayesian Uncertainty Estimation 📊: Full parameter uncertainties via Pigeons.jl parallel tempering
  • Flexible Data Handling ⚡: Fit to either complex visibilities or visibility amplitudes
  • Real-Time Model Diagnostics 📈: Instantly see how well your model describes the data

Installation & Setup 🚀

  1. Clone the Repository 📥: Download InterFit.jl to any location on your computer

    git clone https://github.com/aplavin/InterFit.jl.git
    cd InterFit.jl

    Alternative: If you don't have git installed, download the ZIP archive from GitHub and extract it.

  2. Install Julia 💎: Ensure you have Julia 1.11 installed (installation guide)

  3. Initialize the Environment 🔧: Start Julia with the project environment

    julia --project
  4. Install Dependencies 📦: In the Julia REPL, run:

    julia> using Pkg; Pkg.instantiate()

Quick Start 🚀

Basic Usage

Load InterFit and start fitting models to your VLBI data:

# Load the package
julia> using InterFit

# Option 1: Direct file loading (recommended for most users)
julia> interfit("path/to/your/visibility_file.uvf")

# Option 2: Pre-processed data (for advanced users)
julia> uvtbl = load_average_uvtbl("path/to/your/file.uvf")
julia> # process/filter uvtbl as needed
julia> interfit(uvtbl)

# Option 3: Try with sample data (no file needed!)
julia> vis_fits = joinpath(pkgdir(VLBIFiles), "test", "data", "vis.fits")
julia> interfit(vis_fits)

Understanding the Interface 📊

InterFit opens an interactive window with three main areas:

Left Panel: Visibility Data vs Model Comparison

image
  • Visibility plots: Amplitude and phase vs UV distance
  • Residuals plot: Shows fit quality in units of measurement uncertainty (nσ)

Center Panel: Additional Diagnostics

image
  • UV coverage: UV plane sampling of your observations
  • Closure quantities: Phase and amplitude closures for visual model validation

Right Panel: Model Components

image
  • Component positions: Sky locations and shapes of fitted Gaussian components
  • Flux vs size: Component flux, angular size, brightness temperature
  • Shape parameters: Major/minor axis sizes for elliptical components

Fitting Your Model 🔧

image

1. Data Preparation

  • "Data σ adjustment": Fine-tune visibility weights
    • Multiplicative: Scale all uncertainties by a factor (default: 1.0)
    • Additive: Add systematic uncertainty floor (default: 0.0 Jy)

2. Choose Data Type

  • "Fit to" controls what quantities to fit:
    • Vis: Complex visibilities (full information, assumes proper calibration)
    • Ampl fast: Visibility amplitudes with Gaussian likelihood
    • Ampl slow: Visibility amplitudes with Rician noise (more accurate, but slower)

3. Model Configuration

  • "n Gaussians": Number of Gaussian components
  • "n elliptic": How many should be elliptical

4. MCMC Settings ⚙️

  • "n rounds": Number of tempering rounds. Rule of thumb: 3-6 for exploration, 10+ for final results.
    • Each increment doubles runtime
  • "n chains": Number of parallel chains, 8-20 typically good.
    • Scales runtime linearly
  • For more details, see the Pigeons.jl documentation

5. Fit & Save

  • "Fit" button: Run model fitting with current settings
  • "Save" button: Export fitted model to a file

Tips 💡

  • Start simple: Begin with 1-2 components, increase if needed
  • Check convergence: Run fit multiple times - if results vary significantly, increase n_rounds
  • Check residuals: Look for systematic patterns indicating model inadequacy

Requirements 📋

  • Julia 💎: Version 1.11 (recommended)
  • Operating System 💻: Cross-platform (Windows, macOS, Linux)
  • Dependencies 📦: Automatically managed via Project.toml

Built On 🏗️

InterFit.jl is heavily based on powerful and composable Julia packages:

Contributing 🤝

Code contributions, bug reports, and feature requests are welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages