The following code is an update of the previous version. It implements functions and loops to encapsulate different methods. The goal is to enable the transfer of data between the aerospace segment and the dwave segment. More on the details of this can be found here.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
def ranger(n_sats, satellite_alt): j=0 for z in range(n_sats): r_earth = 12756.14330 pi_pan = 3.141592653589793238462643383 r_vect = satellite_alt[j]+r_earth arc_sat = r_vect/r_earth arc_sat_deg = 180*arc_sat/pi_pan arc_sat_distance = arc_sat_deg * (pi_pan/180)*r_vect narc_sat_distance = n_sats*arc_sat_deg * (pi_pan/180)*r_vect angle_earth = narc_sat_distance / r_earth angle_earth_deg = 180*(angle_earth)/pi_pan angle_earth_deg dist_earth = n_sats*angle_earth*r_earth j = j+1 return dist_earth import numpy as np def siddartha3(alt): r_earth = 12756.14330 pi_pan = 3.141592653589793238462643383 r_vect = alt+r_earth arc_sat = r_vect/r_earth arc_sat_deg = 180*arc_sat/pi_pan arc_sat_distance = arc_sat_deg * (pi_pan/180)*r_vect angle_earth = arc_sat_distance / r_earth dist_earth = angle_earth*r_earth return dist_earth k=0 satellite_alt = [450,430,540,650,675,875,950,940,150,240,110,105] output1=[] output2=[0,1,2,3,4,5,6,7,8,9,10,11] for l in satellite_alt: output1.append(siddartha3(l)) input_data = satellite_alt[k] k=k+1 total=ranger(12,satellite_alt) dpt = [] for jk in output1: dpt.append(round(jk/total,4)) output2.append(round(jk/total,4)) print(dpt) jk=0 ex1={} for k in dpt: ex1[jk]=k jk = jk+1 |