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 --connection DB-Shandong-12 --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
  • compact multi-panel time-series layout
  • blue observed scatter points and gray smoothed trends
  • default 16:9 output with a 15-day smoothed trend
  • automatic line breaks across missing time intervals
  • 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

Metadata

Release files for cself-tools 0.5.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cself-tools 0.5.11
File Size Uploaded
cself_tools-0.5.11.tar.gz 28.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cself-tools 0.5.11
File Interpreter ABI Platform
cself_tools-0.5.11-py3-none-any.whl Python 3 none any Details

Total release size: 61.8 kB

Release files / cself_tools-0.5.11.tar.gz

Download URL cself_tools-0.5.11.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
26b7ca4b70c7a5b19feecd9bfa0c18ecc3f18409ad187232b93649cecfc5d7c7
BLAKE2b-256 checksum
How to use checksums
3efbb85a420ec08c1b56cda098b51dffa5ffe4bff34d96240f714954d141bfb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.13

Release files / cself_tools-0.5.11-py3-none-any.whl

Download URL cself_tools-0.5.11-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a423fa2994248ea46dcf2eca14c2550f0c6e82b7a8e4dfa621e01047be2ecf8
BLAKE2b-256 checksum
How to use checksums
42ab42da7620c85e7fa467520f797d45abc7a32617c45a184202b3b46780b7df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.5.11 This release

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.3.0

1 release file

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page