{
  "schemaVersion": 1,
  "slug": "barometric-pressure-converter-calculator",
  "category": "weather",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "58302b3e1fba9bca601e304927b7e3a01624cc248c0e50002c1506d9a4480f6c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/barometric-pressure-converter-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "p = v × k ÷ 100; p₀ = p + 0.12 a",
    "vars": [
      [
        "v",
        "Input value"
      ],
      [
        "k",
        "Factor to pascals"
      ],
      [
        "p",
        "Pressure in hPa"
      ],
      [
        "a",
        "Altitude, m"
      ],
      [
        "p₀",
        "Sea-level pressure, hPa"
      ]
    ],
    "note": "k per unit: hPa/mb 100, kPa 1000, inHg 3386.389, atm 101325; the sea-level value adds 0.12 hPa per metre of altitude."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const toPa = { pa: 1, hpa: 100, mb: 100, kpa: 1000, bar: 100000, atm: 101325, psi: 6894.757, inhg: 3386.389, mmhg: 133.3224 }; const pa = value*(toPa[unit] || 100); const hpa = pa/100; const correction = altitude*0.12; return { hpa: hpa, mb: hpa, inhg: pa/3386.389, mmhg: pa/133.3224, kpa: pa/1000, atm: pa/101325, psi: pa/6894.757, seaLevelHpa: hpa + correction, category: (hpa + correction) > 1020 ? 'High pressure — settled' : (hpa + correction) < 1000 ? 'Low pressure — unsettled' : 'Near average' };",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1013.25,
        "min": 0,
        "max": 1000000,
        "step": 0.01
      },
      {
        "name": "unit",
        "type": "select",
        "default": "hpa",
        "options": [
          {
            "value": "hpa"
          },
          {
            "value": "mb"
          },
          {
            "value": "kpa"
          },
          {
            "value": "inhg"
          },
          {
            "value": "mmhg"
          },
          {
            "value": "atm"
          },
          {
            "value": "psi"
          },
          {
            "value": "bar"
          },
          {
            "value": "pa"
          }
        ]
      },
      {
        "name": "altitude",
        "type": "number",
        "default": 0,
        "min": -2000,
        "max": 30000,
        "step": 100,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "hpa",
        "precision": 2,
        "unit": "hPa"
      },
      {
        "name": "mb",
        "precision": 2,
        "unit": "mb"
      },
      {
        "name": "inhg",
        "precision": 3,
        "unit": "inHg"
      },
      {
        "name": "mmhg",
        "precision": 2,
        "unit": "mmHg"
      },
      {
        "name": "kpa",
        "precision": 3,
        "unit": "kPa"
      },
      {
        "name": "atm",
        "precision": 5,
        "unit": "atm"
      },
      {
        "name": "psi",
        "precision": 3,
        "unit": "psi"
      },
      {
        "name": "seaLevelHpa",
        "precision": 2,
        "unit": "hPa"
      },
      {
        "name": "category",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
