csv_to_eng - Convert CSV thrust curves to RASP .eng engine files.
================================================================================
OVERVIEW
================================================================================
This module reads thrust curve data from CSV files and produces properly
formatted RASP/RockSim-style .eng engine files for use in rocket simulation
software.
================================================================================
EXPECTED CSV FORMAT
================================================================================
Minimal CSV (just time and thrust):
time,thrust
0.0,0.0
0.05,120.5
0.1,145.2
...
2.5,0.0
With metadata columns:
time,thrust,engine_name,diameter_mm,length_mm,prop_mass_kg,total_mass_kg,manufacturer,delays
0.0,0.0,K1000,54,326,0.85,1.45,Acme,6-10-14
0.05,980.5,,,,,,,
...
Alternative column names supported:
- Time: time, t, seconds, time_s, time_ms
- Thrust: thrust, F, force, thrust_N, thrust_lbf
================================================================================
EXAMPLE CLI USAGE
================================================================================
# Basic conversion (auto-detect columns and units):
python -m csv_to_eng --input curve.csv --output motor.eng
# With metadata overrides:
python -m csv_to_eng --input curve.csv --output motor.eng \\
--name "K1000" --diameter-mm 54 --length-mm 326 \\
--prop-mass-kg 0.85 --total-mass-kg 1.45 \\
--manufacturer "Acme Rocketry" --delays "6-10-14"
# Specify units explicitly:
python -m csv_to_eng --input curve.csv --output motor.eng \\
--thrust-units lbf --time-units ms
================================================================================
EXAMPLE OUTPUT .eng FILE
================================================================================
; Generated by csv_to_eng
K1000 54 326 6-10-14 0.85 1.45 Acme_Rocketry
0.000 0.0
0.050 980.5
0.100 1023.4
0.150 1015.2
...
2.500 0.0
================================================================================
LIBRARY API
================================================================================
from csv_to_eng import (
EngineMetadata,
read_csv_curve,
normalize_curve,
write_eng,
convert,
)
# Full conversion in one call:
convert("input.csv", "output.eng", name="K1000", manufacturer="Acme")
# Step-by-step:
metadata, points = read_csv_curve("input.csv")
points = normalize_curve(points)
metadata.name = "K1000"
write_eng("output.eng", metadata, points)