@@ -38,7 +38,7 @@ def compute_CdS_from_drop_test(
38
38
39
39
"""
40
40
41
- return 2 * rocket_mass * g / ((terminal_velocity ** 2 ) * air_density )
41
+ return 2 * rocket_mass * g / ((terminal_velocity ** 2 ) * air_density )
42
42
43
43
44
44
# TODO: Needs tests
@@ -199,9 +199,21 @@ def du(z, u):
199
199
200
200
return altitudeFunction , velocityFunction , final_sol
201
201
202
+
202
203
def create_dispersion_dictionary (dic ):
203
- dataframe = pd . read_csv ( dic , sep = ';' , skiprows = [ 0 , 1 ], header = None )
204
+ """creates a dictinary with the rocket data in a excel .csv file.
204
205
206
+ Parameters
207
+ ----------
208
+ dic : string
209
+ String with the path to the .csv file.
210
+
211
+ Returns
212
+ -------
213
+ dictionary
214
+ Dictionary with all rocket data used in dispersion analysis.
215
+ """
216
+ dataframe = pd .read_csv (dic , sep = ";" , skiprows = [0 , 1 ], header = None )
205
217
206
218
rocketKeys = list (dataframe [1 ].dropna ())
207
219
rocketValues = list (dataframe [2 ].dropna ())
@@ -214,48 +226,43 @@ def create_dispersion_dictionary(dic):
214
226
launchKeys = list (dataframe [13 ].dropna ())
215
227
launchValues = list (dataframe [14 ].dropna ())
216
228
launchSD = list (dataframe [15 ])
217
-
229
+
218
230
parachuteKeys = list (dataframe [19 ].dropna ())
219
231
parachuteValues = list (dataframe [20 ].dropna ())
220
232
parachuteSD = list (dataframe [21 ])
221
-
222
233
223
234
allValues = []
224
235
# crating the dictionary
225
236
226
- for i in range (0 ,len (rocketKeys )):
237
+ for i in range (0 , len (rocketKeys )):
227
238
228
239
if pd .isnull (rocketSD [i ]):
229
240
allValues .append (rocketValues [i ])
230
241
else :
231
- allValues .append (((rocketValues [i ]), (rocketSD [i ])))
242
+ allValues .append (((rocketValues [i ]), (rocketSD [i ])))
232
243
233
- for j in range (0 ,len (motorKeys )):
244
+ for j in range (0 , len (motorKeys )):
234
245
235
246
if pd .isnull (motorSD [j ]):
236
247
allValues .append (motorValues [j ])
237
248
else :
238
- allValues .append (((motorValues [j ]), (motorSD [j ])))
249
+ allValues .append (((motorValues [j ]), (motorSD [j ])))
239
250
240
- for k in range (0 ,len (parachuteKeys )):
251
+ for k in range (0 , len (parachuteKeys )):
241
252
242
253
if pd .isnull (parachuteSD [k ]):
243
254
allValues .append (parachuteValues [k ])
244
255
else :
245
- allValues .append (((parachuteValues [k ]), (parachuteSD [k ])))
256
+ allValues .append (((parachuteValues [k ]), (parachuteSD [k ])))
246
257
247
- for l in range (0 ,len (launchKeys )):
258
+ for l in range (0 , len (launchKeys )):
248
259
249
260
if pd .isnull (launchSD [l ]):
250
261
allValues .append (launchValues [l ])
251
262
else :
252
- allValues .append (((launchValues [l ]), (launchSD [l ])))
253
-
263
+ allValues .append (((launchValues [l ]), (launchSD [l ])))
254
264
255
265
allKeys = rocketKeys + motorKeys + parachuteKeys + launchKeys
256
266
257
- analysis_parameters = dict (zip (allKeys ,allValues ))
267
+ analysis_parameters = dict (zip (allKeys , allValues ))
258
268
return analysis_parameters
259
-
260
-
261
-
0 commit comments