python-dcm


Namepython-dcm JSON
Version 0.1.10 PyPI version JSON
download
home_pageNone
SummaryA high-performance Python package for handling ETAS DCM(Data Conversion Format) files used in engine calibration tools like INCA, MDA, EHANDBOOK, and CANape.
upload_time2024-12-20 05:18:05
maintainerNone
docs_urlNone
authorc0sogi
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-dcm

A high-performance Python package for handling ETAS DCM(Data Conversion Format) files used in engine calibration tools like INCA, MDA, EHANDBOOK, and CANape.

## Quick Start

```python
from dcm import DCM

# Read a DCM file
dcm = DCM.from_file('calibration.dcm')

# Access calibration data
parameter_value = dcm.parameters['ENGINE_SPEED'].value
map_data = dcm.maps['FUEL_MAP'].dataframe
curve_data = dcm.curves['BOOST_CURVE'].series

# Interpolate values
x_points = [1000, 1500, 2000]  # RPM
y_points = [50, 75, 100]       # Load %
interpolated = dcm.maps['FUEL_MAP'].as_function(x_points, y_points)

# Visualize data
dcm.maps['FUEL_MAP'].to_figure()
```

## Key Features

- **Easy Data Access**: Directly access parameters, curves, and maps with Pandas integration
- **Interpolation**: Built-in 1D/2D linear interpolation for real-time value calculation
- **Visualization**: One-line plotting of characteristic curves and maps
- **Excel Integration**: Import/export calibration data from Excel spreadsheets
- **Set Operations**: Compare and merge DCM files with `|`, `-`, `&`, and `%` operators
- **Type Support**: Handle all DCM data types including fixed/group characteristics

## Installation

Requires Python ≥ 3.10

```bash
pip install python-dcm
```

## Common Use Cases

### Data Access & Manipulation
```python
# Get parameter value
rpm_limit = dcm.parameters['MAX_RPM'].value

# Access map as DataFrame
fuel_map = dcm.maps['FUEL_MAP'].dataframe
fuel_map.iloc[0, 0] = 14.7  # Modify value

# Get curve data
boost_curve = dcm.curves['BOOST_CURVE'].series
max_boost = boost_curve.max()
```

### Excel Integration
```python
# Load calibration data from Excel
dcm.load_from_excel(
    maps_path='maps.xlsx',
    curves_path='curves.xlsx',
    parameters_path='params.xlsx'
)

# Each sheet name becomes the calibration object name
```

### Visualization
```python
import matplotlib.pyplot as plt

# Plot a map with custom settings
fig, ax = dcm.maps['FUEL_MAP'].to_figure(
    cmap='viridis',
    fontsize=12
)
plt.show()

# Plot multiple curves
fig, ax = plt.subplots()
dcm.curves['BOOST_LOW'].to_figure(ax=ax, label='Low')
dcm.curves['BOOST_HIGH'].to_figure(ax=ax, label='High')
plt.legend()
```

### Advanced Features

#### Parameter Type Conversion
```python
param = dcm.parameters['CONTROL_BITS']
binary = param.as_bin()    # [1, 3, 5] (bits set to 1)
hex_val = param.as_hex()   # [A, F, 1] (hexadecimal digits)
```

#### DCM File Comparison
```python
# Find differences between calibrations
modified = old_dcm % new_dcm
print(modified.parameters.keys())  # Changed parameters

# Merge calibrations
combined = dcm1 | dcm2
```

## Supported Data Types

- Parameters (FESTWERT)
- Parameter Blocks (FESTWERTEBLOCK)
- Characteristic Lines (KENNLINIE/FESTKENNLINIE/GRUPPENKENNLINIE)
- Characteristic Maps (KENNFELD/FESTKENNFELD/GRUPPENKENNFELD)
- Distributions (STUETZSTELLENVERTEILUNG)
- Text Strings (TEXTSTRING)

## Dependencies

- NumPy ≥ 1.20.0
- Pandas ≥ 1.5.0
- Matplotlib ≥ 3.0.0
- OpenPyXL ≥ 3.1.0

## License

MIT License

## Contributing

Contributions welcome! Please format code with [ruff](https://docs.astral.sh/ruff/) before submitting PRs.

## Contact

- Author: c0sogi
- Email: dcas@naver.com or cosogi1@gmail.com

Feel free to reach out for questions or suggestions.

---

For detailed documentation and examples, visit our [GitHub repository](https://github.com/c0sogi/python-dcm).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "python-dcm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "c0sogi",
    "author_email": "dcas@naver.com",
    "download_url": "https://files.pythonhosted.org/packages/f1/2e/8cce6268aa7afe6a407dfa328798a7b687bc0d075e4027e3d373c2a43b5f/python_dcm-0.1.10.tar.gz",
    "platform": null,
    "description": "# python-dcm\n\nA high-performance Python package for handling ETAS DCM(Data Conversion Format) files used in engine calibration tools like INCA, MDA, EHANDBOOK, and CANape.\n\n## Quick Start\n\n```python\nfrom dcm import DCM\n\n# Read a DCM file\ndcm = DCM.from_file('calibration.dcm')\n\n# Access calibration data\nparameter_value = dcm.parameters['ENGINE_SPEED'].value\nmap_data = dcm.maps['FUEL_MAP'].dataframe\ncurve_data = dcm.curves['BOOST_CURVE'].series\n\n# Interpolate values\nx_points = [1000, 1500, 2000]  # RPM\ny_points = [50, 75, 100]       # Load %\ninterpolated = dcm.maps['FUEL_MAP'].as_function(x_points, y_points)\n\n# Visualize data\ndcm.maps['FUEL_MAP'].to_figure()\n```\n\n## Key Features\n\n- **Easy Data Access**: Directly access parameters, curves, and maps with Pandas integration\n- **Interpolation**: Built-in 1D/2D linear interpolation for real-time value calculation\n- **Visualization**: One-line plotting of characteristic curves and maps\n- **Excel Integration**: Import/export calibration data from Excel spreadsheets\n- **Set Operations**: Compare and merge DCM files with `|`, `-`, `&`, and `%` operators\n- **Type Support**: Handle all DCM data types including fixed/group characteristics\n\n## Installation\n\nRequires Python \u2265 3.10\n\n```bash\npip install python-dcm\n```\n\n## Common Use Cases\n\n### Data Access & Manipulation\n```python\n# Get parameter value\nrpm_limit = dcm.parameters['MAX_RPM'].value\n\n# Access map as DataFrame\nfuel_map = dcm.maps['FUEL_MAP'].dataframe\nfuel_map.iloc[0, 0] = 14.7  # Modify value\n\n# Get curve data\nboost_curve = dcm.curves['BOOST_CURVE'].series\nmax_boost = boost_curve.max()\n```\n\n### Excel Integration\n```python\n# Load calibration data from Excel\ndcm.load_from_excel(\n    maps_path='maps.xlsx',\n    curves_path='curves.xlsx',\n    parameters_path='params.xlsx'\n)\n\n# Each sheet name becomes the calibration object name\n```\n\n### Visualization\n```python\nimport matplotlib.pyplot as plt\n\n# Plot a map with custom settings\nfig, ax = dcm.maps['FUEL_MAP'].to_figure(\n    cmap='viridis',\n    fontsize=12\n)\nplt.show()\n\n# Plot multiple curves\nfig, ax = plt.subplots()\ndcm.curves['BOOST_LOW'].to_figure(ax=ax, label='Low')\ndcm.curves['BOOST_HIGH'].to_figure(ax=ax, label='High')\nplt.legend()\n```\n\n### Advanced Features\n\n#### Parameter Type Conversion\n```python\nparam = dcm.parameters['CONTROL_BITS']\nbinary = param.as_bin()    # [1, 3, 5] (bits set to 1)\nhex_val = param.as_hex()   # [A, F, 1] (hexadecimal digits)\n```\n\n#### DCM File Comparison\n```python\n# Find differences between calibrations\nmodified = old_dcm % new_dcm\nprint(modified.parameters.keys())  # Changed parameters\n\n# Merge calibrations\ncombined = dcm1 | dcm2\n```\n\n## Supported Data Types\n\n- Parameters (FESTWERT)\n- Parameter Blocks (FESTWERTEBLOCK)\n- Characteristic Lines (KENNLINIE/FESTKENNLINIE/GRUPPENKENNLINIE)\n- Characteristic Maps (KENNFELD/FESTKENNFELD/GRUPPENKENNFELD)\n- Distributions (STUETZSTELLENVERTEILUNG)\n- Text Strings (TEXTSTRING)\n\n## Dependencies\n\n- NumPy \u2265 1.20.0\n- Pandas \u2265 1.5.0\n- Matplotlib \u2265 3.0.0\n- OpenPyXL \u2265 3.1.0\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions welcome! Please format code with [ruff](https://docs.astral.sh/ruff/) before submitting PRs.\n\n## Contact\n\n- Author: c0sogi\n- Email: dcas@naver.com or cosogi1@gmail.com\n\nFeel free to reach out for questions or suggestions.\n\n---\n\nFor detailed documentation and examples, visit our [GitHub repository](https://github.com/c0sogi/python-dcm).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A high-performance Python package for handling ETAS DCM(Data Conversion Format) files used in engine calibration tools like INCA, MDA, EHANDBOOK, and CANape.",
    "version": "0.1.10",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11b3a9a6a3b17cd580f1f8b1cdd4105bd4ebbe7da6a194294b425efe1c07ef25",
                "md5": "3d2bbee639e482c9bbcf846bc0bca4bd",
                "sha256": "d0a6406f279a0b5c27dc42cd8314ad8744030782467ca30f1fb7c53cf7c42903"
            },
            "downloads": -1,
            "filename": "python_dcm-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d2bbee639e482c9bbcf846bc0bca4bd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 15010,
            "upload_time": "2024-12-20T05:18:03",
            "upload_time_iso_8601": "2024-12-20T05:18:03.320143Z",
            "url": "https://files.pythonhosted.org/packages/11/b3/a9a6a3b17cd580f1f8b1cdd4105bd4ebbe7da6a194294b425efe1c07ef25/python_dcm-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f12e8cce6268aa7afe6a407dfa328798a7b687bc0d075e4027e3d373c2a43b5f",
                "md5": "42f4c5294db8cabeb69be680cf64fa3d",
                "sha256": "75616bccd9cdd7d46bd7050bdc4f5dd4653f4fb8dafbd3a884d4361e89939d30"
            },
            "downloads": -1,
            "filename": "python_dcm-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "42f4c5294db8cabeb69be680cf64fa3d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 14069,
            "upload_time": "2024-12-20T05:18:05",
            "upload_time_iso_8601": "2024-12-20T05:18:05.613650Z",
            "url": "https://files.pythonhosted.org/packages/f1/2e/8cce6268aa7afe6a407dfa328798a7b687bc0d075e4027e3d373c2a43b5f/python_dcm-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 05:18:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-dcm"
}
        
Elapsed time: 1.63408s