[{"data":1,"prerenderedAt":519},["ShallowReactive",2],{"page-\u002Futils\u002Fapi\u002Ffunctions\u002FgetIonBalance":3,"navigation":132},{"collection":4,"page":5},"docs_en",{"id":6,"title":7,"body":8,"description":122,"extension":123,"meta":124,"navigation":126,"path":127,"rawbody":128,"seo":129,"stem":130,"__hash__":131},"docs_en\u002Futils\u002Fapi\u002Ffunctions\u002FgetIonBalance.md","getIonBalance",{"type":9,"value":10,"toc":113},"minimark",[11,37,44,79,88,93,96,101,105],[12,13,14],"blockquote",{},[15,16,17,20,21,25,26,33,34],"p",{},[18,19,7],"strong",{},"(",[22,23,24],"code",{},"sample","): ",[27,28,30],"a",{"href":29},"\u002Futils\u002Fapi\u002Ftype-aliases\u002FIonBalance",[22,31,32],{},"IonBalance"," | ",[22,35,36],{},"undefined",[15,38,39,40,43],{},"Charge balance of a sample. Concentrations (mg\u002FL) are converted to meq\u002FL\nwith the vocabulary molar mass and charge (",[22,41,42],{},"mg\u002FL ÷ (M \u002F |z|)",").",[15,45,46,47,50,51,54,55,58,59,62,63,66,67,70,71,74,75,78],{},"Cations: Ca, Mg, Na, K, Li, Fe (as Fe²⁺), Mn, NH₄⁺ (",[22,48,49],{},"ammonia_as_n",").\nAnions: HCO₃⁻ + CO₃²⁻ (falling back to ",[22,52,53],{},"alkalinity_total_as_caco3","), Cl⁻,\nSO₄²⁻, F⁻, PO₄³⁻, NO₃⁻ and NO₂⁻ (the ",[22,56,57],{},"_as_no3","\u002F",[22,60,61],{},"_as_no2"," code preferred\nover ",[22,64,65],{},"_as_n",", never both). Rejected and censored (",[22,68,69],{},"\u003C",", ",[22,72,73],{},">",",\n",[22,76,77],{},"not_detected",") results are left out.",[15,80,81,84,85,87],{},[22,82,83],{},"error_pct = (Σcat − Σan) \u002F (Σcat + Σan) × 100",". Returns ",[22,86,36],{},"\nwithout at least one measured cation and one measured anion.",[89,90,92],"h2",{"id":91},"parameters","Parameters",[94,95,24],"h3",{"id":24},[15,97,98],{},[22,99,100],{},"WaterSample",[89,102,104],{"id":103},"returns","Returns",[15,106,107,33,111],{},[27,108,109],{"href":29},[22,110,32],{},[22,112,36],{},{"title":114,"searchDepth":115,"depth":115,"links":116},"",2,[117,121],{"id":91,"depth":115,"text":92,"children":118},[119],{"id":24,"depth":120,"text":24},3,{"id":103,"depth":115,"text":104},"Charge balance of a sample. Concentrations (mg\u002FL) are converted to meq\u002FL with the vocabulary molar mass and charge (mg\u002FL ÷ (M \u002F |z|)).","md",{"generated":125},true,false,"\u002Futils\u002Fapi\u002Ffunctions\u002FgetIonBalance","---\npath: \"\u002Futils\u002Fapi\u002Ffunctions\u002FgetIonBalance\"\ntitle: getIonBalance\ndescription: \"Charge balance of a sample. Concentrations (mg\u002FL) are converted to meq\u002FL with the vocabulary molar mass and charge (mg\u002FL ÷ (M \u002F |z|)).\"\ngenerated: true\nnavigation: false\n---\n\n> **getIonBalance**(`sample`): [`IonBalance`](\u002Futils\u002Fapi\u002Ftype-aliases\u002FIonBalance) \\| `undefined`\n\nCharge balance of a sample. Concentrations (mg\u002FL) are converted to meq\u002FL\nwith the vocabulary molar mass and charge (`mg\u002FL ÷ (M \u002F |z|)`).\n\nCations: Ca, Mg, Na, K, Li, Fe (as Fe²⁺), Mn, NH₄⁺ (`ammonia_as_n`).\nAnions: HCO₃⁻ + CO₃²⁻ (falling back to `alkalinity_total_as_caco3`), Cl⁻,\nSO₄²⁻, F⁻, PO₄³⁻, NO₃⁻ and NO₂⁻ (the `_as_no3`\u002F`_as_no2` code preferred\nover `_as_n`, never both). Rejected and censored (`\u003C`, `>`,\n`not_detected`) results are left out.\n\n`error_pct = (Σcat − Σan) \u002F (Σcat + Σan) × 100`. Returns `undefined`\nwithout at least one measured cation and one measured anion.\n\n## Parameters\n\n### sample\n\n`WaterSample`\n\n## Returns\n\n[`IonBalance`](\u002Futils\u002Fapi\u002Ftype-aliases\u002FIonBalance) \\| `undefined`\n",{"title":7,"description":122},"utils\u002Fapi\u002Ffunctions\u002FgetIonBalance","Aa9PiD3MqFIV8MHabgOkUOJeemoQDFOtmdOti_1ROQo",{"docs_en":133,"spec":450,"changelogs":500},[134,154,173,228,338,392],{"title":135,"path":136,"stem":137,"children":138},"Ai","\u002Fai","ai",[139,142,146,150],{"title":140,"path":136,"stem":141},"Introduction","ai\u002Findex",{"title":143,"path":144,"stem":145},"Converting reports with an assistant","\u002Fai\u002Fconversion-skill","ai\u002Fconversion-skill",{"title":147,"path":148,"stem":149},"llms.txt and Markdown pages","\u002Fai\u002Fllms","ai\u002Fllms",{"title":151,"path":152,"stem":153},"MCP server","\u002Fai\u002Fmcp","ai\u002Fmcp",{"title":155,"path":156,"stem":157,"children":158},"Contributing","\u002Fcontributing","contributing",[159,161,165,169],{"title":140,"path":156,"stem":160},"contributing\u002Findex",{"title":162,"path":163,"stem":164},"Writing docs","\u002Fcontributing\u002Fwriting-docs","contributing\u002F1.writing-docs",{"title":166,"path":167,"stem":168},"Update rules","\u002Fcontributing\u002Fupdate-rules","contributing\u002F2.update-rules",{"title":170,"path":171,"stem":172},"Content components","\u002Fcontributing\u002Fcomponents","contributing\u002Fcomponents",{"title":174,"path":175,"stem":176,"children":177},"Core","\u002Fcore","core",[178,180,193,222],{"title":140,"path":175,"stem":179},"core\u002Findex",{"title":181,"path":182,"stem":183,"children":184,"page":126},"Getting Started","\u002Fcore\u002Fgetting-started","core\u002F1.getting-started",[185,189],{"title":186,"path":187,"stem":188},"Installation","\u002Fcore\u002Fgetting-started\u002Finstallation","core\u002F1.getting-started\u002F1.installation",{"title":190,"path":191,"stem":192},"First use","\u002Fcore\u002Fgetting-started\u002Ffirst-use","core\u002F1.getting-started\u002F2.first-use",{"title":194,"path":195,"stem":196,"children":197,"page":126},"Guides","\u002Fcore\u002Fguides","core\u002F2.guides",[198,202,206,210,214,218],{"title":199,"path":200,"stem":201},"Parsing and validating","\u002Fcore\u002Fguides\u002Fparsing-and-validating","core\u002F2.guides\u002F1.parsing-and-validating",{"title":203,"path":204,"stem":205},"Serializing and sharing","\u002Fcore\u002Fguides\u002Fserializing-and-sharing","core\u002F2.guides\u002F2.serializing-and-sharing",{"title":207,"path":208,"stem":209},"Unit conversion","\u002Fcore\u002Fguides\u002Funit-conversion","core\u002F2.guides\u002F3.unit-conversion",{"title":211,"path":212,"stem":213},"Vocabularies and textures","\u002Fcore\u002Fguides\u002Fvocabularies-and-textures","core\u002F2.guides\u002F4.vocabularies-and-textures",{"title":215,"path":216,"stem":217},"Water quality vocabulary","\u002Fcore\u002Fguides\u002Fwater-quality-vocabulary","core\u002F2.guides\u002F5.water-quality-vocabulary",{"title":219,"path":220,"stem":221},"Versions and time zones","\u002Fcore\u002Fguides\u002Fversions-and-time-zones","core\u002F2.guides\u002F6.versions-and-time-zones",{"title":223,"path":224,"stem":225,"children":226},"API reference","\u002Fcore\u002Fapi","core\u002Fapi\u002Findex",[227],{"title":223,"path":224,"stem":225},{"title":229,"path":230,"stem":231,"children":232},"Format","\u002Fformat","format",[233,235,255,284,308,328,334],{"title":140,"path":230,"stem":234},"format\u002Findex",{"title":181,"path":236,"stem":237,"children":238,"page":126},"\u002Fformat\u002Fgetting-started","format\u002F1.getting-started",[239,243,247,251],{"title":240,"path":241,"stem":242},"What is .well?","\u002Fformat\u002Fgetting-started\u002Fwhat-is-well","format\u002F1.getting-started\u002F1.what-is-well",{"title":244,"path":245,"stem":246},"For geologists","\u002Fformat\u002Fgetting-started\u002Ffor-geologists","format\u002F1.getting-started\u002F2.for-geologists",{"title":248,"path":249,"stem":250},"For developers","\u002Fformat\u002Fgetting-started\u002Ffor-developers","format\u002F1.getting-started\u002F3.for-developers",{"title":252,"path":253,"stem":254},"Your first .well file","\u002Fformat\u002Fgetting-started\u002Ffirst-well-file","format\u002F1.getting-started\u002F4.first-well-file",{"title":256,"path":257,"stem":258,"children":259,"page":126},"Concepts","\u002Fformat\u002Fconcepts","format\u002F2.concepts",[260,264,268,272,276,280],{"title":261,"path":262,"stem":263},"Depths and intervals","\u002Fformat\u002Fconcepts\u002Fdepths-and-intervals","format\u002F2.concepts\u002F1.depths-and-intervals",{"title":265,"path":266,"stem":267},"Units and precision","\u002Fformat\u002Fconcepts\u002Funits-and-precision","format\u002F2.concepts\u002F2.units-and-precision",{"title":269,"path":270,"stem":271},"Vocabularies","\u002Fformat\u002Fconcepts\u002Fvocabularies","format\u002F2.concepts\u002F3.vocabularies",{"title":273,"path":274,"stem":275},"Profiles","\u002Fformat\u002Fconcepts\u002Fprofiles","format\u002F2.concepts\u002F4.profiles",{"title":277,"path":278,"stem":279},"Versions and deprecation","\u002Fformat\u002Fconcepts\u002Fversions-and-deprecation","format\u002F2.concepts\u002F5.versions-and-deprecation",{"title":281,"path":282,"stem":283},"Extensibility","\u002Fformat\u002Fconcepts\u002Fextensibility","format\u002F2.concepts\u002F6.extensibility",{"title":194,"path":285,"stem":286,"children":287,"page":126},"\u002Fformat\u002Fguides","format\u002F3.guides",[288,292,296,300,304],{"title":289,"path":290,"stem":291},"Writing a .well by hand","\u002Fformat\u002Fguides\u002Fwriting-by-hand","format\u002F3.guides\u002F1.writing-by-hand",{"title":293,"path":294,"stem":295},"Converting a report","\u002Fformat\u002Fguides\u002Fconverting-a-report","format\u002F3.guides\u002F2.converting-a-report",{"title":297,"path":298,"stem":299},"Validating","\u002Fformat\u002Fguides\u002Fvalidating","format\u002F3.guides\u002F3.validating",{"title":301,"path":302,"stem":303},"Extending for your own needs","\u002Fformat\u002Fguides\u002Fextending","format\u002F3.guides\u002F4.extending",{"title":305,"path":306,"stem":307},"Building an editor or database on .well","\u002Fformat\u002Fguides\u002Fbuilding-on-well","format\u002F3.guides\u002F5.building-on-well",{"title":309,"path":310,"stem":311,"children":312},"Overview","\u002Fformat\u002Freference","format\u002F4.reference\u002Findex",[313,314,318,322],{"title":309,"path":310,"stem":311},{"title":315,"path":316,"stem":317},"JSON Schema","\u002Fformat\u002Freference\u002Fjson-schema","format\u002F4.reference\u002F1.json-schema",{"title":319,"path":320,"stem":321},"Example wells","\u002Fformat\u002Freference\u002Fexamples","format\u002F4.reference\u002F2.examples",{"title":323,"path":324,"stem":325,"children":326},"Object reference","\u002Fformat\u002Freference\u002Fobjects","format\u002Freference\u002Fobjects\u002Findex",[327],{"title":323,"path":324,"stem":325},{"title":329,"path":330,"stem":331,"children":332},"About the spec","\u002Fformat\u002Fspec","format\u002F5.spec\u002Findex",[333],{"title":329,"path":330,"stem":331},{"title":335,"path":336,"stem":337},"Changelog","\u002Fformat\u002Fchangelog","format\u002F6.changelog",{"title":339,"path":340,"stem":341,"children":342},"Render","\u002Frender","render",[343,345,355,387],{"title":140,"path":340,"stem":344},"render\u002Findex",{"title":181,"path":346,"stem":347,"children":348,"page":126},"\u002Frender\u002Fgetting-started","render\u002F1.getting-started",[349,352],{"title":186,"path":350,"stem":351},"\u002Frender\u002Fgetting-started\u002Finstallation","render\u002F1.getting-started\u002F1.installation",{"title":190,"path":353,"stem":354},"\u002Frender\u002Fgetting-started\u002Ffirst-use","render\u002F1.getting-started\u002F2.first-use",{"title":194,"path":356,"stem":357,"children":358,"page":126},"\u002Frender\u002Fguides","render\u002F2.guides",[359,363,367,371,375,379,383],{"title":360,"path":361,"stem":362},"Panels and layout","\u002Frender\u002Fguides\u002Fpanels-and-layout","render\u002F2.guides\u002F1.panels-and-layout",{"title":364,"path":365,"stem":366},"Layers and labels","\u002Frender\u002Fguides\u002Flayers-and-labels","render\u002F2.guides\u002F2.layers-and-labels",{"title":368,"path":369,"stem":370},"Theming","\u002Frender\u002Fguides\u002Ftheming","render\u002F2.guides\u002F3.theming",{"title":372,"path":373,"stem":374},"Locale and units","\u002Frender\u002Fguides\u002Flocale-and-units","render\u002F2.guides\u002F4.locale-and-units",{"title":376,"path":377,"stem":378},"Legends","\u002Frender\u002Fguides\u002Flegends","render\u002F2.guides\u002F5.legends",{"title":380,"path":381,"stem":382},"Zoom, pan and highlights","\u002Frender\u002Fguides\u002Finteraction","render\u002F2.guides\u002F6.interaction",{"title":384,"path":385,"stem":386},"Using it in a framework","\u002Frender\u002Fguides\u002Fframeworks","render\u002F2.guides\u002F7.frameworks",{"title":223,"path":388,"stem":389,"children":390},"\u002Frender\u002Fapi","render\u002Fapi\u002Findex",[391],{"title":223,"path":388,"stem":389},{"title":393,"path":394,"stem":395,"children":396},"Utils","\u002Futils","utils",[397,399,409,445],{"title":140,"path":394,"stem":398},"utils\u002Findex",{"title":181,"path":400,"stem":401,"children":402,"page":126},"\u002Futils\u002Fgetting-started","utils\u002F1.getting-started",[403,406],{"title":186,"path":404,"stem":405},"\u002Futils\u002Fgetting-started\u002Finstallation","utils\u002F1.getting-started\u002F1.installation",{"title":190,"path":407,"stem":408},"\u002Futils\u002Fgetting-started\u002Ffirst-use","utils\u002F1.getting-started\u002F2.first-use",{"title":194,"path":410,"stem":411,"children":412,"page":126},"\u002Futils\u002Fguides","utils\u002F2.guides",[413,417,421,425,429,433,437,441],{"title":414,"path":415,"stem":416},"Geometry and volumes","\u002Futils\u002Fguides\u002Fgeometry-and-volumes","utils\u002F2.guides\u002F1.geometry-and-volumes",{"title":418,"path":419,"stem":420},"Water levels and pumping tests","\u002Futils\u002Fguides\u002Fpumping-tests","utils\u002F2.guides\u002F2.pumping-tests",{"title":422,"path":423,"stem":424},"Permits","\u002Futils\u002Fguides\u002Fpermits","utils\u002F2.guides\u002F3.permits",{"title":426,"path":427,"stem":428},"Operation and production","\u002Futils\u002Fguides\u002Foperation","utils\u002F2.guides\u002F4.operation",{"title":430,"path":431,"stem":432},"Water quality","\u002Futils\u002Fguides\u002Fwater-quality","utils\u002F2.guides\u002F5.water-quality",{"title":434,"path":435,"stem":436},"Logger import","\u002Futils\u002Fguides\u002Flogger-import","utils\u002F2.guides\u002F6.logger-import",{"title":438,"path":439,"stem":440},"SIAGAS import","\u002Futils\u002Fguides\u002Fsiagas-import","utils\u002F2.guides\u002F7.siagas-import",{"title":442,"path":443,"stem":444},"Formatting","\u002Futils\u002Fguides\u002Fformatting","utils\u002F2.guides\u002F8.formatting",{"title":223,"path":446,"stem":447,"children":448},"\u002Futils\u002Fapi","utils\u002Fapi\u002Findex",[449],{"title":223,"path":446,"stem":447},[451],{"title":229,"path":230,"stem":231,"children":452,"page":126},[453],{"title":454,"path":330,"stem":455,"children":456,"page":126},"Spec","format\u002Fspec",[457,466,475],{"title":458,"path":459,"stem":460,"children":461,"page":126},"Reference","\u002Fformat\u002Fspec\u002Freference","format\u002Fspec\u002Freference",[462],{"title":463,"path":464,"stem":465},"FGDC Texture Patterns Reference","\u002Fformat\u002Fspec\u002Freference\u002Ffgdc-textures","format\u002Fspec\u002Freference\u002Ffgdc-textures",{"title":467,"path":468,"stem":469,"children":470,"page":126},"V1","\u002Fformat\u002Fspec\u002Fv1","format\u002Fspec\u002Fv1",[471],{"title":472,"path":473,"stem":474},".well File Format Specification","\u002Fformat\u002Fspec\u002Fv1\u002Fwell-format","format\u002Fspec\u002Fv1\u002Fwell-format",{"title":476,"path":477,"stem":478,"children":479,"page":126},"V2","\u002Fformat\u002Fspec\u002Fv2","format\u002Fspec\u002Fv2",[480,484,488,492,496],{"title":481,"path":482,"stem":483},".well File Format Specification — Version 2.4: Format Reference","\u002Fformat\u002Fspec\u002Fv2\u002Fformat-reference","format\u002Fspec\u002Fv2\u002Fformat-reference",{"title":485,"path":486,"stem":487},".well File Format Specification — Version 2.4: Interoperability","\u002Fformat\u002Fspec\u002Fv2\u002Finteroperability","format\u002Fspec\u002Fv2\u002Finteroperability",{"title":489,"path":490,"stem":491},".well File Format Specification — Version 2.4: Object Schemas","\u002Fformat\u002Fspec\u002Fv2\u002Fobject-schemas","format\u002Fspec\u002Fv2\u002Fobject-schemas",{"title":493,"path":494,"stem":495},".well File Format Specification — Version 2.4: Overview","\u002Fformat\u002Fspec\u002Fv2\u002Foverview","format\u002Fspec\u002Fv2\u002Foverview",{"title":497,"path":498,"stem":499},".well File Format Specification — Version 2.4: Water Quality","\u002Fformat\u002Fspec\u002Fv2\u002Fwater-quality","format\u002Fspec\u002Fv2\u002Fwater-quality",[501,507,513],{"title":174,"path":175,"stem":176,"children":502,"page":126},[503],{"title":504,"path":505,"stem":506},"@welldot\u002Fcore","\u002Fcore\u002Fchangelog","core\u002FCHANGELOG",{"title":339,"path":340,"stem":341,"children":508,"page":126},[509],{"title":510,"path":511,"stem":512},"@welldot\u002Frender","\u002Frender\u002Fchangelog","render\u002FCHANGELOG",{"title":393,"path":394,"stem":395,"children":514,"page":126},[515],{"title":516,"path":517,"stem":518},"@welldot\u002Futils","\u002Futils\u002Fchangelog","utils\u002FCHANGELOG",1793050500310]