This is just a helper script for taking a readout from openrocket of drag coefficients vs mach and trimming it down to be used by our python simulation.


In [4]:
delta = 0.1 # difference between interpolation steps
lastone = 0.0
flag = True
with open('lv4drag.csv', 'w') as newfile:
    with open('lv4raw.csv') as oldfile:
        for line in oldfile:
            if line[0] != '#':
                nextone = float(line[:4])
                if (nextone - lastone >= delta) or (flag and nextone <= delta):
                    lastone = nextone
                    newfile.write(line)
                    flag = False
            elif 'BURNOUT' in line:
                break

In [ ]:


In [ ]: