Skip to content

vysf/geolistrik-cli

Repository files navigation

English | Bahasa Indonesia


📑 Table of Contents


Introduction

Geolistrik CLI is a command-line utility to generate stacking charts and electrode configuration tables for five common resistivity methods in geophysical survey:

  • Wenner-Schlumberger (ws)
  • Wenner (wn)
  • Pole-Pole (pp)
  • Pole-Dipole (pd)
  • Dipole-Dipole (dd)

It saves outputs in .png (chart) and .xlsx (data) formats.


Features

✅ Support 5 geoelectrical array configurations (Wenner, Wenner–Schlumberger, Pole–Pole, Pole–Dipole, Dipole–Dipole)
✅ Explicit and self-documented CLI commands (generate and update)
✅ Flexible input via options (safe and scalable for future versions)
✅ Optional chart generation (--no-plot)
✅ Custom output directory support (--outdir)
✅ Output formats:

  1. .png stacking chart
  2. .xlsx measurement table

✅ Automatic update checking after command execution
✅ Designed for students, researchers, surveyors, and geophysics practitioners \ ✅ Cross-platform support (Windows & Linux)


Installation Guide

Windows

📦 Download Installer

Run the installer and follow the instructions.

Restart the CMD, and the Geolistrik CLI is ready to use. But if you accidentally uncheck the Add Geolistrik to PATH environment variable (Recommended) box, then you can add the PATH manually by following the instruction below:

  1. After the installation is complete, add the following folder (this where you install the cli):

    C:\Program Files (x86)\Geolistrik
    

    to your system PATH. This the tutorial:

    • Click Start, type "env", and select Edit the system environment variables system environment variables
    • In the System Properties window, click the Environment Variables… button system properties
    • Under the System Variables section, find Path and click Edit system variable section
    • In the Edit Environment Variable window, click New to add a new path modify environtment variable
    • Close all dialogue boxes by clicking OK to save your changes
    • Restart terminal to ensure the PATH changes take effect
  2. Open CMD and type:

    geolistrik

    You'll see the welcome banner: welcome

  3. Uninstall:

    • Uninstall via Control Panel → Uninstall a Program
    • Remove the path entry from the system PATH

Linux

📦 Download Linux binary

  1. Make the file executable
    For example, if the file is in the ~/Downloads folder:

    chmod +x ~/Downloads/geolistrik-linux-1.0.0.bin
  2. Move the file to a directory in your PATH Typically this would be ~/.local/bin (for local install) or /usr/local/bin (for global install).

    • Global installation (for all users):
      sudo mv ~/Downloads/geolistrik-linux-1.0.0.bin /usr/local/bin/geolistrik
    • Local installation (for current user only): First, ensure ~/.local/bin is included in your $PATH. Check with:
      echo $PATH
      If it’s not included, add it to your .bashrc or .zshrc:
      echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
      source ~/.bashrc
      If it is already included, simply run:
      mkdir -p ~/.local/bin
      mv ~/Downloads/geolistrik-linux-1.0.0.bin ~/.local/bin/geolistrik
      Now you can use the CLI from anywhere:
      geolistrik
      Just like on Windows, you should see a welcome banner.
  3. Uninstall
    Simply delete the binary from your system:

    sudo rm /usr/local/bin/geolistrik

Usage Example

Geolistrik CLI uses a command-based structure. The main command for data generation is generate.

Basic Syntax

geolistrik generate \
  --configuration <code> \
  --start-position <start> \
  --end-position <end> \
  --spacing <spacing> \
  [--outdir <directory>] \
  [--no-plot] \
  [--verbose]

or for simple command

geolistrik generate \
  -c <code> \
  -s <start> \
  -e <end> \
  -a <spacing> \
  [-o <directory>] \
  [--no-plot] \
  [--verbose]

Configuration Codes

Code Configuration
wn Wenner
ws Wenner–Schlumberger
pp Pole–Pole
pd Pole–Dipole
dd Dipole–Dipole

Generate Stacking Chart and Measurement Table

By default, this command generates:

  1. A stacking chart image (.png)
  2. A measurement table (.xlsx)
geolistrik generate \
  --configuration ws \
  --start-position 0 \
  --end-position 100 \
  --spacing 10

or

geolistrik generate -c ws -s 0 -e 100 -a 10

The output files will be saved in the current directory with naming format:

  • ws_0_100_a10.png
  • ws_0_100_a10.xlsx

This table represents the actual electrode configuration and data acquisition sequence used in the field:

stacking_chart_animation

Generate Only Measurement Tables (No Plot)

Use the --no-plot option to skip chart generation:

geolistrik generate \
  --configuration ws \
  --start-position 0 \
  --end-position 100 \
  --spacing 10 \
  --no-plot

or

geolistrik generate -c ws -s 0 -e 100 -a 10 --no-plot

This will generate only the .xlsx measurement table.

Custom Output Directory

Specify a custom output directory using --outdir:

geolistrik generate \
  --configuration ws \
  --start-position 0 \
  --end-position 100 \
  --spacing 10 \
  --outdir "./results"

or

geolistrik generate -c ws -s 0 -e 100 -a 10 --outdir "./results"

All generated files will be saved inside the specified directory.

Update CLI Version

To update Geolistrik CLI to the latest version:

geolistrik update

To install a specific version (upgrade or downgrade):

geolistrik update --version 1.0.1

Notes for Users Migrating from v1

⚠️ Geolistrik CLI v1.x is now End-of-Life No further updates or bug fixes will be provided.

You can uninstall version 1 and download version 2 on Installation Guide.

In version v1, parameters were provided as positional arguments:

geolistrik 0 100 10

Starting from v2, Geolistrik CLI adopts an explicit command-based and option-based interface for better clarity, safety, and long-term maintainability.


Local Development

  1. Clone this repository:

    git clone https://github.com/vysf/geolistrik-cli
    cd geolistrik-cli
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run locally:

    python -m geolistrik --help
  4. Build with Nuitka: See build.bat or use:

    nuitka --standalone --onefile --include-package=geolistrik --output-dir=build geolistrik/__main__.py
  5. Compile Windows Installer:

    • Requires Inno Setup
    • Run:
      ISCC geolistrik_setup.iss

Contributing

PRs are welcome!

How to contribute:

  • Fork this repository
  • Commit changes to a branch
  • Submit a pull request
  • Or open an issue to report bugs/suggestions

📫 Contact: Yusuf Umar Al Hakim
✉️ yusufumaralhakim@fmipa.untan.ac.id
🌐 GitHub Project

About

Geolistrik CLI is a command-line utility to generate stacking charts and electrode configuration tables for five common resistivity methods in geophysical survey.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors