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.50

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.50
File Size Uploaded Provenance Actions
imlresi-0.0.50.tar.gz 76.5 kB Without provenance Details for imlresi-0.0.50.tar.gz

Built distribution (wheel)

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

Total release size: 122.1 kB

Release files / imlresi-0.0.50.tar.gz

Download URL imlresi-0.0.50.tar.gz
Size 76.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ca118dafcd9fbde2fec480c76cb71bd5cbf4016b53007a97737e456e206a452a
BLAKE2b-256 checksum
How to use checksums
9efec8be2ff4385fdcf79f080a0465eb2ed1816669f9b336367458699c7c1e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL imlresi-0.0.50-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1093eb32e150a9b899c41f6f47b390c97ca483c30937f30e860504e66396981a
BLAKE2b-256 checksum
How to use checksums
9ee8ea607a542e0a5eedc1fb45c910ecee424e5779e7ac412b5d936ad085f59c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for imlresi 0.0.50

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.50 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