Repository avatar
AI Tools
v1.0.0
active

indieml-ves

io.github.ezchx/indieml-ves

1D Vertical Electrical Sounding (VES) Occam inversion and forward modeling powered by pyGIMLi.

Documentation

IndieML VES - 1D Vertical Electrical Sounding Inversion

IndieML VES Inversion Profile

A free online 1D Vertical Electrical Sounding (VES) Occam inversion and synthetic forward-modeling engine built with pyGIMLi and FastAPI, exposed via both a public REST API and a remote Streamable HTTP MCP (Model Context Protocol) server.


Key Features

  • Smooth 1D Occam Inversion (/invert): Log-transformed pyGIMLi VESRhoModelling with second-order smoothness regularization (cType=2), optional Morozov discrepancy auto-lambda sweep (auto_lam=True), and regularization sensitivity envelopes (0.3x–3.0x $\lambda$).
  • Synthetic Forward Modeling (/forward): Generates noise-free (rhoa_true) and reproducible Gaussian-noisy (rhoa_noisy) apparent resistivity curves for pre-survey spread design and closed-loop benchmarking.
  • Array & Unit Agnostic: Supports both Schlumberger (spacing / ab2 + mn2) and Wenner (spacing / a, automatically scaled to $AB/2 = 1.5a$, $MN/2 = 0.5a$) in any consistent unit system (m & Ohm-m, or ft & Ohm-ft).
  • Non-Destructive Quality Control: Preserves user input order and flags non-monotonic spacings, low current ($< 300\text{ mA}$), low potential ($< 10\text{ mV}$), high stacking standard deviation ($> 5%$), and post-inversion residual outliers ($> 3\sigma$) in qc_flags.
  • LLM-Ready Interpretation Guardrails: The MCP tool embeds explicit Depth of Investigation (DOI = 0.4 * max(AB/2)) boundaries, non-uniqueness caveats, and conditional geological interpretation rules.

REST API Quickstart

VES Inversion - cURL

curl -X POST https://indieml.app/ves/api/invert \
  -H "Content-Type: application/json" \
  -d '{
    "array_type": "schlumberger",
    "ab2": [1.5, 2.5, 4.0, 6.0, 10.0, 15.0, 25.0, 40.0, 60.0, 100.0],
    "mn2": [0.5, 0.5, 0.5, 1.0, 1.0, 2.0, 2.0, 5.0, 5.0, 10.0],
    "rhoa": [45.2, 42.8, 38.1, 31.5, 24.0, 19.8, 18.2, 22.5, 29.4, 38.0],
    "v_mV": [320.5, 185.0, 94.2, 112.0, 58.4, 76.1, 34.8, 49.2, 21.5, 14.2],
    "i_mA": [500.0, 500.0, 500.0, 450.0, 450.0, 400.0, 400.0, 350.0, 350.0, 300.0],
    "sd_pct": [0.5, 0.5, 0.8, 1.0, 1.2, 1.5, 1.8, 2.1, 2.5, 3.2],
    "lam": 20.0,
    "auto_lam": false,
    "include_envelope": true,
    "max_iter": 20
  }'

VES Inversion - Python

import requests

url = "https://indieml.app/ves/api/invert"
headers = {
    "Content-Type": "application/json"
}
payload = {
    "array_type": "schlumberger",
    "ab2": [1.5, 2.5, 4.0, 6.0, 10.0, 15.0, 25.0, 40.0, 60.0, 100.0],
    "mn2": [0.5, 0.5, 0.5, 1.0, 1.0, 2.0, 2.0, 5.0, 5.0, 10.0],
    "rhoa": [45.2, 42.8, 38.1, 31.5, 24.0, 19.8, 18.2, 22.5, 29.4, 38.0],
    "v_mV": [320.5, 185.0, 94.2, 112.0, 58.4, 76.1, 34.8, 49.2, 21.5, 14.2],
    "i_mA": [500.0, 500.0, 500.0, 450.0, 450.0, 400.0, 400.0, 350.0, 350.0, 300.0],
    "sd_pct": [0.5, 0.5, 0.8, 1.0, 1.2, 1.5, 1.8, 2.1, 2.5, 3.2],
    "lam": 20.0,
    "auto_lam": False,
    "include_envelope": True,
    "max_iter": 20
}
response = requests.post(url, json=payload, headers=headers)

if response.status_code != 200:
    error_data = response.json()
    print(f"HTTP {response.status_code}: {error_data.get('detail')}")
else:
    print(response.json())

Forward Modeling - cURL

curl -X POST https://indieml.app/ves/api/forward \
  -H "Content-Type: application/json" \
  -d '{
    "array_type": "schlumberger",
    "ab2": [1.5, 2.5, 4.0, 6.0, 10.0, 15.0, 25.0, 40.0, 60.0, 100.0],
    "mn2": [0.5, 0.5, 0.5, 1.0, 1.0, 2.0, 2.0, 5.0, 5.0, 10.0],
    "thicknesses": [5.0, 20.0],
    "resistivities": [50.0, 10.0, 100.0],
    "noise_pct": 3.0,
    "seed": 42
  }'

Forward Modeling - Python

import requests

url = "https://indieml.app/ves/api/forward"
headers = {
    "Content-Type": "application/json"
}
payload = {
    "array_type": "schlumberger",
    "ab2": [1.5, 2.5, 4.0, 6.0, 10.0, 15.0, 25.0, 40.0, 60.0, 100.0],
    "mn2": [0.5, 0.5, 0.5, 1.0, 1.0, 2.0, 2.0, 5.0, 5.0, 10.0],
    "thicknesses": [5.0, 20.0],
    "resistivities": [50.0, 10.0, 100.0],
    "noise_pct": 3.0,
    "seed": 42
}
response = requests.post(url, json=payload, headers=headers)

if response.status_code != 200:
    error_data = response.json()
    print(f"HTTP {response.status_code}: {error_data.get('detail')}")
else:
    print(response.json())

AI Agent Integration (MCP)

Web Apps

ChatGPT, Claude, & Gemini, go to Plugins / Connectors and paste the remote Streamable HTTP URL:

https://indieml.app/ves/api/mcp

Cursor, Claude Desktop & Windsurf CLI

{
  "mcpServers": {
    "indieml-ves": {
      "url": "https://indieml.app/ves/api/mcp"
    }
  }
}

Gemini CLI

{
  "mcpServers": {
    "indieml-ves": {
      "httpUrl": "https://indieml.app/ves/api/mcp"
    }
  }
}

Self-Hosting Locally

conda env create -f environment.yml
conda activate indieml-ves
uvicorn main:app --host 0.0.0.0 --port 8000

License

MIT

No installation packages available.

Remote