{"id":29782007,"url":"https://github.com/geopytool/na-k-mg","last_synced_at":"2025-07-27T14:11:11.672Z","repository":{"id":305798445,"uuid":"1023987271","full_name":"GeoPyTool/Na-K-Mg","owner":"GeoPyTool","description":"A tool to use Na-K-Mg triangle plot chemistrical status of geothermal waters","archived":false,"fork":false,"pushed_at":"2025-07-22T03:34:35.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T04:34:59.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeoPyTool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T02:51:39.000Z","updated_at":"2025-07-22T03:34:39.000Z","dependencies_parsed_at":"2025-07-22T04:35:00.774Z","dependency_job_id":"9f046162-aa7f-4436-aeef-4aa162e398c1","html_url":"https://github.com/GeoPyTool/Na-K-Mg","commit_stats":null,"previous_names":["geopytool/na-k-mg"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/GeoPyTool/Na-K-Mg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoPyTool%2FNa-K-Mg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoPyTool%2FNa-K-Mg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoPyTool%2FNa-K-Mg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoPyTool%2FNa-K-Mg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeoPyTool","download_url":"https://codeload.github.com/GeoPyTool/Na-K-Mg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoPyTool%2FNa-K-Mg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267368932,"owners_count":24076093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-27T14:11:06.372Z","updated_at":"2025-07-27T14:11:11.664Z","avatar_url":"https://github.com/GeoPyTool.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Na-K-Mg Hydrochemical Analysis Software\n\nVersion: 1.0\n\n## Introduction\nThis professional tool specializes in groundwater hydrochemical type determination. Developed in Python, it implements triangular diagram visualization for Na-K-Mg ion concentration analysis, featuring intelligent water type classification based on industry standards.\n\n## Key Features\n1. CSV data parsing \u0026 standardization\n2. Automatic ion equivalent conversion\n3. Dynamic ternary diagram plotting\n4. Smart hydrochemical classification\n5. PDF report export\n\n## Technical Specifications\n- Scientific visualization with matplotlib\n- Data processing using pandas\n- Cross-platform GUI built with PySide6\n- Windows/Linux/macOS compatibility\n\n## System Requirements\n- Python 3.11+\n- Dependencies: PySide6, matplotlib, pandas, numpy\n\n## Function Overview\n- Load water sample data files in CSV or Excel format\n- Automatically plot Na-K-Mg ternary diagrams with geothermometers (Giggenbach, Arnorsson, Tonani, Fournier, Truesdell) and equilibrium lines\n- Export images in multiple formats (PNG, JPG, SVG, PDF)\n- Export classification results as CSV files\n- User-friendly graphical interface\n\n## Dependencies\n- Python 3.11+\n- PySide6\n- matplotlib\n- pandas\n- numpy\n\nInstall dependencies with:\n\n```bash\npip install PySide6 matplotlib pandas numpy\n```\n\n## Usage\n1. Run main program:\n\n```bash\ngit clone https://github.com/GeoPyTool/Na-K-Mg-plotter.git\ncd Na-K-Mg-plotter\npython triangle_gui.py\n```\n\n2. Select \"Load File and Plot\" from menu to load water sample data (supports CSV, Excel files)\n3. The ternary diagram will be automatically plotted after loading\n4. Select image format from menu and click \"Save Plot\" to export\n5. Click \"Export Classification CSV\" to export sample classification results\n\n## Data Format Requirements\nData files must contain these columns:\n- `Na`: Sodium ion concentration\n- `K`: Potassium ion concentration\n- `Mg`: Magnesium ion concentration\n- (Optional) `Station ID`: Sample ID or name\n\n## File Description\n- `triangle_gui.py`: Main program and interface logic\n- `water_sample.csv`: Sample data file\n- `result.png`, `result.svg`: Sample output images\n- `result.csv`: Sample classification results\n\n## Screenshots\n\n![](./images/1_import.png)\n\n\n![](./images/2_plot.png)\n\n\n![](./images/3_save.png)\n\n\n![](./images/4_export.png)\n\n\n## Sample Output\n\n![](./images/result.png)\n\n## References\n\n- Liu Yang, Zhang Huamei, Li Dongya. Matlab Implementation of Na-K-Mg Ternary Diagram - Case Study of Hainan Island Hot Spring Data[J]. Seismological and Geomagnetic Observation and Research, 2022, 43(5):111-119.\n- Giggenbach, W.F. (1988). Geothermal solute equilibria. Derivation of Na-K-Mg-Ca geoindicators. Geochimica et Cosmochimica Acta, 52(12), 2749-2765.\n- Arnórsson, S., et al. (1983). The chemistry of geothermal waters in Iceland. III. Chemical geothermometry in geothermal investigations. Geochimica et Cosmochimica Acta, 47(3), 567-577.\n\n## License\nThis software is licensed under GPLv3. Academic research and commercial use permitted. Open-source compliance required for derivative works. See LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeopytool%2Fna-k-mg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeopytool%2Fna-k-mg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeopytool%2Fna-k-mg/lists"}