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

pip install -r requirements.txt

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.0.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.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: roadprofile-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 91f8c7e80e92513dbaa868f204c364b87e3bcf7cf7a7dfa592f1a3728d8c0c94
MD5 6b576e1ce271d856e757e46df3ba5595
BLAKE2b-256 440e70f0744edb9967c80de014595bf17ad3d29ea89512719fbba3a80cede34c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: roadprofile-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0468176ed76d8852fe2360f4a8add70ec76b820ee37d4f51cfd5d6ace973069
MD5 260380568f5a63ee587945e18e4490b5
BLAKE2b-256 8a6315a8f9606b767b46e92c4e5b35cc556d63035f0699d93058f9f9782cd709

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