Skip to main content

imlresi

Tools for dealing with IML-Resi PowerDrill data using python.

THIS PACKAGE IS UNOFFICAL AND HAS BEEN DEVELOPED INDEPENDENT OF IML

Current limitations:

  1. Focus is on actual measurements made by the tool rather than meta-info.
  2. Poor support for data generated in PD-Tools (e.g. "assessments").

Install

https://pypi.org/project/imlresi/

pip install imlresi

Optional extras:

extra for
imlresi[delta] Delta Lake export with the pure-Python delta-rs engine
imlresi[spark] Delta Lake export through PySpark (e.g. Microsoft Fabric notebooks)
imlresi[plot] Trace.plot()
imlresi[test] running the test suite

Use

Traces

Trace reads a single measurement in any of IML's formats: binary .rgp (firmware up to 1.32), JSON .rgp (later firmware), .pdc (IML's iPad app) and the two PD-Tools text exports.

from imlresi import Trace

tr = Trace()
tr.read('trace.rgp')
tr.drill, tr.feed            # drill and feed amplitude profiles
tr.get_drilltime()           # instrument clock time
tr.get_latlon()              # from a .pdc location stamp
tr.to_json()                 # as IML's JSON trace format
tr.hash()                    # md5 of to_json(), e.g. as a database key

Trace.process_using_resiapi(uri) sends the trace to a Resi API server and keeps the result, which is then available as e.g. tr.get_ubdia(). A server that wants a login gets it with auth=(name, key) (only over https://):

tr.process_using_resiapi("https://resiapi.aliente.ch/predict",
                         auth=(os.environ["RESI_API_USER"], os.environ["RESI_API_KEY"]))

.Resi files

A .Resi file is the project file of the FWPA web app: an R list saved with saveRDS(), holding a summary table (df) plus the traces and results for each measurement.

from imlresi import ResiResultSet, save_traces_to_dotresi, change_instrument_id

rs = ResiResultSet('project.Resi')
for r in rs:
    r.FileName, r.TreeID, r.DOB, r.drill
    r.recompute_den_trace()  # recompute the density profile

rs.to_dotresi('copy.Resi')

# build a .Resi file from raw traces, e.g. to upload to the web app
save_traces_to_dotresi([tr], 'new.Resi')

change_instrument_id('project.Resi', 'PD500-0755', output_filepath='fixed.Resi')

The same conversion from the command line:

traces2resi *.rgp -o new.Resi

Databases

rs.to_duckdb('resi.duckdb')                      # traces, results, rings, boards tables
rs = ResiResultSet.from_duckdb('resi.duckdb')

rs.to_deltalake('Tables/resi', mode='merge')     # needs imlresi[delta] or imlresi[spark]

to_deltalake uses PySpark when a Spark session is active and delta-rs otherwise; pass engine='deltalake' or engine='spark' to choose, and storage_options imply delta-rs. Merging never replaces an existing table; only mode='overwrite' does.

Units

FeedSpeed is stored in mm/min in .Resi files, DuckDB and Delta tables, as the web app does. Traces report it in cm/min (Trace.get_feedspeed()). See CHANGELOG.md about data written by 0.0.45 and earlier.

Development

pip install -e '.[test,spark]'
pytest

The Spark tests need a JDK and are skipped without PySpark.

Metadata

Release files for imlresi 0.0.48

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

Source distribution (sdist)

Source distribution for imlresi 0.0.48
File Size Uploaded Provenance Actions
imlresi-0.0.48.tar.gz 70.0 kB Without provenance Details for imlresi-0.0.48.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for imlresi 0.0.48
File Interpreter ABI Platform Actions
imlresi-0.0.48-py3-none-any.whl Python 3 none any Details for imlresi-0.0.48-py3-none-any.whl

Total release size: 112.5 kB

Release files / imlresi-0.0.48.tar.gz

Download URL imlresi-0.0.48.tar.gz
Size 70.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4735b79a5dab11ff867deccd9de6efd789be21098478cd88ae72708f350a9eee
BLAKE2b-256 checksum
How to use checksums
6a4ada7a34db1a549bf6cc8286be6cce4398d6c463fc5eac3c429af27af9c2cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / imlresi-0.0.48-py3-none-any.whl

Download URL imlresi-0.0.48-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b25ee5fbdad17c6ae9795e3c75ff59fc1357c811221a66ecfc1f6aa436839b8
BLAKE2b-256 checksum
How to use checksums
19752e2c7cb98c01242f5f3bea70b91b3151de32e7d90890dde960367851d598
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for imlresi 0.0.48

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.48 This release

2 release files No provenance

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