Skip to main content

cself_tools

cself_tools is a Python package for downloading, processing, and plotting geomagnetic and very-low-frequency apparent resistivity data from irregular Oracle tables.

The package focuses on two workflows:

  • Magnetic data: download F/H/D/I/X/Y/Z components, split by station, point, and FINSTR, and export CSV/TXT/PNG outputs.
  • Apparent resistivity: query RXY/RYX/RXX/RYY components, filter outliers, compute moving averages, save raw CSV data, and generate report-ready plots.

Installation

pip install cself-tools

For development:

pip install -e .[dev,qzad]

Oracle access requires cx_Oracle and an Oracle Instant Client compatible with the target database.

Database configuration

Named connections are loaded directly from .adder-style configuration files, so addereq is no longer required.

By default, the package searches:

~/.adder/conf
~/.adder/config
~/.adder/connections.ini
~/.adder/connections.json

Example INI-style config:

[China]
username = qzdata
password = pass#word
dsn = 127.0.0.1:1521/orcl

Passwords are read as plain values, so special characters such as # are preserved.

Command line usage

After installation, use the cself-tools command.

Download magnetic data:

cself-tools magnetic download --connection China --start 2000-01-01 --components F H D I X Y Z

Plot apparent resistivity:

cself-tools resistivity plot --station-id 37022 --point-id E --components RXY --frequencies 22 74

Common database options:

--connection China
--oracle-client-lib C:\oracle\instantclient_19_22
--config-dir C:\Users\you\.adder

Outputs

Default outputs are written below outputs/:

outputs/
  magnetic/
    csv/
    txt/
    plots/
    manifest.csv
  resistivity/
    csv/
    plots/

The magnetic manifest records station, point, FINSTR, row count, date range, file path, and same-day duplicate counts.

Python API

Legacy APIs are still available:

from cself_tools import query_data, process_and_plot_mt_data

New workflow modules are preferred:

from cself_tools.resistivity import ResistivityRequest, load_resistivity, plot_resistivity
from cself_tools.magnetic import MagneticDownloadRequest, download_magnetic

Plot style

Plots use a consistent report-ready style:

  • 300 dpi PNG output
  • large Word-friendly labels and tick text
  • straight legend boxes
  • raw values as semi-transparent blue-gray points
  • moving averages as red lines
  • apparent resistivity labels such as rho_xy and units Ohm m

Release checklist

python -m build
twine check dist/*
pip install dist/*.whl
cself-tools --help

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cself_tools-0.5.1.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cself_tools-0.5.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file cself_tools-0.5.1.tar.gz.

File metadata

  • Download URL: cself_tools-0.5.1.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.13

File hashes

Hashes for cself_tools-0.5.1.tar.gz
Algorithm Hash digest
SHA256 3fc04604b29577c7bf1b439e4d9eae1543ee815d16c997bd79dba9da056d2d43
MD5 55ebd6c199f54084556cf8de73130e65
BLAKE2b-256 a34d2cf4d64f0cf2238047665ea0df8b907ac6c8cb3503c5523650eeac45c958

See more details on using hashes here.

File details

Details for the file cself_tools-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: cself_tools-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.13

File hashes

Hashes for cself_tools-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 927fb660cd43110532c4d2f27aa2af757afe54574abf013137745ec8fc893c25
MD5 ee3b30a221d6ab65536b8d3c212b0e1b
BLAKE2b-256 145aaca71cd4ba4db415cee1d589f6501a214e50c72f8aeec167d32a277c7bc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page