Skip to content

Commit 14c8442

Browse files
committed
Merge branch 'main' of https://github.com/c0sogi/python-dcm
2 parents 0ee5277 + 48f210a commit 14c8442

1 file changed

Lines changed: 2 additions & 196 deletions

File tree

README.md

Lines changed: 2 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -46,201 +46,7 @@ pip install .
4646
### Reading a DCM File
4747

4848
```python
49-
from dcm.dcm import DCM
50-
51-
# Read a DCM file
52-
dcm = DCM.from_file('path/to/your_file.dcm')
53-
```
54-
55-
### Writing a DCM File
56-
57-
```python
58-
# Write the DCM object to a file
59-
dcm.write('path/to/output_file.dcm')
60-
```
61-
62-
### Accessing Data
63-
64-
```python
65-
# Access a parameter
66-
parameter = dcm.parameters['PARAMETER_NAME']
67-
print(parameter.value)
68-
69-
# Access a characteristic line (curve)
70-
curve = dcm.curves['CURVE_NAME']
71-
print(curve.series)
72-
73-
# Access a characteristic map
74-
char_map = dcm.maps['MAP_NAME']
75-
print(char_map.dataframe)
76-
```
77-
78-
### Loading Data from Excel
79-
80-
You can load calibration data from Excel files into the DCM object.
81-
82-
```python
83-
# Load maps from an Excel file
84-
dcm.load_maps('maps.xlsx')
85-
86-
# Load curves from an Excel file
87-
dcm.load_lines('curves.xlsx')
88-
89-
# Load parameters from an Excel file
90-
dcm.load_parameters('parameters.xlsx')
91-
92-
# Load parameter blocks from an Excel file
93-
dcm.load_parameter_blocks('parameter_blocks.xlsx')
94-
```
95-
96-
### Interpolation Functions
97-
98-
Perform interpolation using the calibration data.
99-
100-
#### 1D Interpolation (Characteristic Line)
101-
102-
```python
103-
# Get the interpolation function for a curve
104-
curve_function = curve.as_function
105-
106-
# Interpolate at specific points
107-
import numpy as np
108-
x_values = np.array([1.0, 2.0, 3.0])
109-
interpolated_values = curve_function(x_values)
110-
```
111-
112-
#### 2D Interpolation (Characteristic Map)
113-
114-
```python
115-
# Get the interpolation function for a map
116-
map_function = char_map.as_function
117-
118-
# Interpolate at specific x and y points
119-
x_values = np.array([1.0, 2.0, 3.0])
120-
y_values = np.array([4.0, 5.0, 6.0])
121-
interpolated_values = map_function(x_values, y_values)
122-
```
123-
124-
## Examples
125-
126-
### Plotting a Characteristic Line
127-
128-
```python
129-
import matplotlib.pyplot as plt
130-
131-
# Plot the curve
132-
fig, ax = curve.to_figure()
133-
plt.show()
134-
```
135-
136-
### Plotting a Characteristic Map
137-
138-
```python
139-
import matplotlib.pyplot as plt
140-
141-
# Plot the map
142-
fig, ax = char_map.to_figure()
143-
plt.show()
144-
```
145-
146-
### Combining DCM Objects
147-
148-
You can combine DCM objects using set operations:
149-
150-
```python
151-
# Union of two DCM objects
152-
combined_dcm = dcm1 | dcm2
153-
154-
# Difference between two DCM objects
155-
difference_dcm = dcm1 - dcm2
156-
157-
# Intersection of two DCM objects
158-
intersection_dcm = dcm1 & dcm2
159-
160-
# Modifications between two DCM objects
161-
modifications_dcm = dcm1 % dcm2
162-
```
163-
164-
## Dependencies
165-
166-
- Python >= 3.11
167-
- [NumPy](https://numpy.org/) >= 1.20.0
168-
- [Pandas](https://pandas.pydata.org/) >= 1.5.0
169-
- [Matplotlib](https://matplotlib.org/) >= 3.0.0
170-
- [OpenPyXL](https://openpyxl.readthedocs.io/en/stable/) >= 3.1.0
171-
172-
## License
173-
174-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
175-
176-
## Contributing
177-
178-
Contributions are welcome! Please follow these steps:
179-
180-
1. Fork the repository.
181-
2. Create a new branch (`git checkout -b feature/YourFeature`).
182-
3. Commit your changes (`git commit -am 'Add new feature'`).
183-
4. Push to the branch (`git push origin feature/YourFeature`).
184-
5. Create a new Pull Request.
185-
186-
Please ensure that your code adheres to the existing style and that all tests pass.
187-
188-
## Contact
189-
190-
Author: c0sogi
191-
Email: [dcas@naver.com](mailto:dcas@naver.com) or [cosogi1@gmail.com] (mailto:cosogi1@gmail.com)
192-
193-
Feel free to reach out for questions or discussions.
194-
195-
# dcm
196-
197-
A Python package for reading and writing DCM (Data Conservation Format) files used in various ECU calibration tools such as INCA, MDA, EHANDBOOK, CANape, and more.
198-
199-
## Table of Contents
200-
201-
- [Features](#features)
202-
- [Installation](#installation)
203-
- [Usage](#usage)
204-
- [Reading a DCM File](#reading-a-dcm-file)
205-
- [Writing a DCM File](#writing-a-dcm-file)
206-
- [Accessing Data](#accessing-data)
207-
- [Loading Data from Excel](#loading-data-from-excel)
208-
- [Interpolation Functions](#interpolation-functions)
209-
- [Examples](#examples)
210-
- [Dependencies](#dependencies)
211-
- [License](#license)
212-
- [Contributing](#contributing)
213-
- [Contact](#contact)
214-
215-
## Features
216-
217-
- **Read and Write DCM Files**: Parse and generate DCM files used in ECU calibration.
218-
- **Data Manipulation**: Access and modify parameters, curves, maps, and other calibration data.
219-
- **Excel Integration**: Load calibration data from Excel files.
220-
- **Interpolation**: Perform 1D and 2D linear interpolation on calibration data.
221-
- **Visualization**: Plot characteristic lines and maps using Matplotlib.
222-
- **Support for Various Data Types**: Handle parameters, parameter blocks, characteristic lines, characteristic maps, distributions, and text strings.
223-
224-
## Installation
225-
226-
Ensure you have Python 3.11 or higher installed. Install the package using `pip`:
227-
228-
```bash
229-
pip install git+https://github.com/c0sogi/python-dcm.git
230-
```
231-
232-
Or if you have the package files locally:
233-
234-
```bash
235-
pip install .
236-
```
237-
238-
## Usage
239-
240-
### Reading a DCM File
241-
242-
```python
243-
from dcm.dcm import DCM
49+
from dcm import DCM
24450

24551
# Read a DCM file
24652
dcm = DCM.from_file('path/to/your_file.dcm')
@@ -384,4 +190,4 @@ Please ensure that your code adheres to the existing style and that all tests pa
384190
Author: c0sogi
385191
Email: [dcas@naver.com](mailto:dcas@naver.com) or [cosogi1@gmail.com](mailto:cosogi1@gmail.com)
386192

387-
Feel free to reach out for questions or discussions.
193+
Feel free to reach out for questions or discussions.

0 commit comments

Comments
 (0)