Skip to main content

RoadProfile

A Python module for generating road surface profiles based on ISO 8608, with support for time-domain filtering and dynamic class changes.

Installation

You can install roadprofile directly from PyPI:

pip install roadprofile

Classes

RoadProfile

Basic road profile generation using frequency domain method (ISO 8608).

FilteredRoadProfile

Road profile with time-domain Butterworth lowpass filtering. Supports dynamic parameters.

DynamicRoadProfile

Dynamic road profile generator that supports:

  • Batch generation with varying classes
  • Real-time generator with dynamic class/dx changes

Examples

Basic Usage

from roadprofile import RoadProfile

rp = RoadProfile()
rp.set_profile_class("A")
profile = rp.generate(L=100, dx=0.1)
print(profile.x, profile.profile)

# Using get_profile_by_class
profile = rp.get_profile_by_class("B", L=100, dx=0.1)

FilteredRoadProfile

from roadprofile import FilteredRoadProfile

frp = FilteredRoadProfile(fc=4.5, order=4)
frp.set_profile_class("A")
profile = frp.generate(L=100, dx=0.1)

# With ISO class (auto-sets filter params)
frp.set_profile_class("C")
profile = frp.generate(L=100, dx=0.1)

DynamicRoadProfile - Batch Generation

from roadprofile import DynamicRoadProfile

drp = DynamicRoadProfile()

# Generate with varying classes
classes = ["A"] * 50 + ["B"] * 50 + ["C"] * 50
profile = drp.generate(L=15, dx=0.1, profile_classes=classes)

DynamicRoadProfile - Real-time Generator

from roadprofile import DynamicRoadProfile

drp = DynamicRoadProfile()
drp.set_profile_class("A")  # Set class before creating generator
gen = drp.create_generator(dx=0.1)

# Get next point
p1 = next(gen)

# Change class
gen.send('B')
p2 = next(gen)

# Change sampling interval
gen.send(0.05)
p3 = next(gen)

Irregular Spacing

All classes support irregular spacing via generate_at_x(x):

import numpy as np
from roadprofile import RoadProfile

rp = RoadProfile()
rp.set_profile_class("A")

x_irregular = np.array([0, 0.05, 0.15, 0.3, 0.5, 0.8, 1.2, 1.5, 2.0])
profile = rp.generate_at_x(x_irregular)

Testing

Run regression tests with PSD validation:

cd example
python test_regression.py

This generates validation plots:

  • test_psd_validation.png - RoadProfile PSD validation
  • test_filtered_psd_validation.png - FilteredRoadProfile PSD validation
  • test_generate_at_x_psd.png - generate_at_x PSD validation
  • test_point_generator_psd.png - point_generator PSD validation

PSD Validation Results

RoadProfile (Frequency Domain)

PSD Validation

FilteredRoadProfile (Time Domain Filter)

Filtered PSD

generate_at_x (Irregular Spacing)

generate_at_x PSD

point_generator (Real-time)

point_generator PSD

ISO Classes

Class Gdn0 (m³)
A 32E-6
B 128E-6
C 512E-6
D 2048E-6
E 8192E-6
F 32768E-6

Algorithm

Based on the method described in:

Da Silva, J. G. S. "Dynamical performance of highway bridge decks with irregular pavement surface." Computers & structures 82.11 (2004): 871-881.

License

GPLv3 - see LICENSE file for details.

Metadata

Release files for roadprofile 1.0.4

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

Source distribution (sdist)

Source distribution for roadprofile 1.0.4
File Size Uploaded Provenance Actions
roadprofile-1.0.4.tar.gz 1.6 MB Without provenance Details for roadprofile-1.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / roadprofile-1.0.4.tar.gz

Download URL roadprofile-1.0.4.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
e5b58df9204c7e61968ade975fabb84093af5a2c3661dcfc8d746e525bd5eff9
BLAKE2b-256 checksum
How to use checksums
ce6ee24c0d6b518a02cc4763723fac1ac0e62635c7a2be5eb52e4f620b75b552
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / roadprofile-1.0.4-py3-none-any.whl

Download URL roadprofile-1.0.4-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c529a5a51c640900da2d3b6b48ebb7e13ac8fcccfc8edc36c2bf8b7866a90d44
BLAKE2b-256 checksum
How to use checksums
a3280aa016da19995cd170fdb31e9f4bc9b2f593d8172500e6085cc451c7cf68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for roadprofile 1.0.4

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

1.0.4 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