Skip to main content

ISO 8608 road profile generator in Python

Project description

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.

Project details


Download files

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

Source Distribution

roadprofile-1.0.4.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

roadprofile-1.0.4-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file roadprofile-1.0.4.tar.gz.

File metadata

  • Download URL: roadprofile-1.0.4.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for roadprofile-1.0.4.tar.gz
Algorithm Hash digest
SHA256 e5b58df9204c7e61968ade975fabb84093af5a2c3661dcfc8d746e525bd5eff9
MD5 43244bda0a33cfee61b031ea85a751fc
BLAKE2b-256 ce6ee24c0d6b518a02cc4763723fac1ac0e62635c7a2be5eb52e4f620b75b552

See more details on using hashes here.

File details

Details for the file roadprofile-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: roadprofile-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for roadprofile-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c529a5a51c640900da2d3b6b48ebb7e13ac8fcccfc8edc36c2bf8b7866a90d44
MD5 6485644c0e9f8aca37e037ad29e48615
BLAKE2b-256 a3280aa016da19995cd170fdb31e9f4bc9b2f593d8172500e6085cc451c7cf68

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 Pingdom Monitoring Sentry Error logging StatusPage Status page