Metadata-Version: 2.4
Name: seisvelan
Version: 0.1.1
Summary: Interactive seismic normal-moveout velocity analysis.
Author-email: Thomas Hertweck <geophysics@email.de>
Maintainer-email: Thomas Hertweck <geophysics@email.de>
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://gitlab.kit.edu/thomas.hertweck/seisvelan
Keywords: geophysics,seismic,SU,SEGY,SEG-Y,GUI,NMO,velocity,analysis,picking
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: seisio
Requires-Dist: tabulate
Requires-Dist: tkinter-tooltip
Requires-Dist: tkinter-icons[bootstrap]
Dynamic: license-file

# seisvelan

Interactive seismic normal-moveout velocity analysis.

## Description

The **seisvelan** package provides an interactive GUI for picking seismic normal-moveout velocities on CMP gathers. 

This little program is not meant to replace commercial seismic software optimized to run velocity analysis on large amounts of data. It's primarily meant for smaller projects in, for instance, academic environments to facilitate practical velocity picking in lectures, exercises or field practicals.

## Key features

* Pure Python code based on tkinter, i.e., minimal external dependencies.
* Uses the **seisio** module for flexible I/O of seismic data.
* GUI allows users to interactively change clips, axis labels, axis ticks, colormaps, and many more parameters.
* OS-independent, i.e., should work on Linux, Windows, etc.

## Getting Started

### Dependencies

Required: matplotlib, numpy, seisio, tabulate, tkinter-tooltip, tkinter-icons[bootstrap]

The **seisio** packages requires: numba, numpy, pandas, tabulate

### Installation

*Install from PyPI:*

```
$> pip install seisvelan
```

Afterwards, simply call

```
$> seisvelan
```

at the commandline. You can use option `-v` to obtain additional logging information or `-vv` to put all modules that use the standard logging facility into debug mode, including **seisvelan** itself.

*Install directly from gitlab:*

```
$> pip install git+https://gitlab.kit.edu/thomas.hertweck/seisvelan.git
```

*Editable install from source:*

This version is intended for experts who would like to test the latest version or make modifications. Normal users should prefer to install a stable version.

```
$> git clone https://gitlab.kit.edu/thomas.hertweck/seisvelan.git
```

Once you acquired the source, you can install an editable version of seisvelan with:

```
$> cd seisvelan
$> pip install -e .
```

An alternative location of the source is https://github.com/ThomasHertweck/seisvelan.

## Overview

Here is a screenshot of the GUI with some explanations:

<p align="center">

![seisvelan GUI](https://gitlab.kit.edu/thomas.hertweck/seisvelan/-/raw/main/img/seisvelan.jpg)

</p>

## JSON output file

The JSON file produced by the interactive GUI can easily be read into Python:

```
import ast
import json
from sortedcontainers import SortedDict

def _extract_picks(json_pickdata):
    pos = []
    times_per_pos = []
    velos_per_pos = []
    etas_per_pos = []
    for p, pks in json_pickdata.items():
        pos.append(ast.literal_eval(p)[0])
        times_per_pos.append([val["t"] for val in pks])
        velos_per_pos.append([val["v"] for val in pks])
        etas_per_pos.append([val["e"] for val in pks])
    return pos, times_per_pos, velos_per_pos, etas_per_pos

def get_pickvalues_as_list(pick_file):
    with open(pick_file, "r", encoding="utf-8") as f:
        json_data = json.load(f)
    pickdata = json_data["picks"]
    if not pickdata:
        raise RuntimeError(f"JSON file {pick_file} seems to contain no picks.")
    pos, t, v, e = _extract_picks(pickdata)
    return  pos, t, v, e

def get_pickvalues_as_dict(pick_file):
    pos, t, v, e = get_pickvalues_as_list(pick_file)
    pdict = SortedDict()
    for i, key in enumerate(pos):
        pdict[key] = {"t": t[i], "v": v[i], "e": e[i]}
    return pdict
```

## Testing

The current version of the **seisvelan** package has primarily been tested on Linux and Windows using Python 3.13 and 3.14.

## Main author

Dr. Thomas Hertweck, geophysics@email.de

## Citation

If you use the **seisvelan** package and you find it useful, getting some feedback would be very much appreciated. If you would like to cite this package, please use, for instance:
```
Hertweck, T. (2026). seisvelan: A Python GUI for interactive seismic velocity analysis. Version 0.1. url: https://gitlab.kit.edu/thomas.hertweck/seisvelan/ (visited on 08/25/2026).
```
Adjust year, version and last visited date as required. Here's a BibTeX entry:
```
@software{seisvelan,
  author  = {Hertweck, Thomas},
  year    = {2026},
  title   = {seisvelan: A Python GUI for interactive seismic velocity analysis},
  url     = {https://gitlab.kit.edu/thomas.hertweck/seisvelan/},
  urldate = {2026-08-25},
  version = {0.1.0}
}
```
## License

This project is licensed under the GPL v3.0 License - see the LICENSE.md file for details
