# Untitled

Apr 11th, 2021
670
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import json
2. import requests
3. import csv
4. import numpy as np
5. import vectormath as vmath
6. import math
7. #-368.03125 / -321.6875 / -1047.625
8. v1 = vmath.Vector3(-368.03125, -321.6875, -1047.625)
9. v2 = vmath.Vector3(142.65625 , 56.46875 , 40.34375)
10. v3 = (v1-v2)
11. v3.normalize()
12. print(v3)
13. total=[]
14. for vinc in range(0, 180,1):
15.     print('iterating '+str(vinc+1)+ ' out of 180')
16.     vC=v1+(v3*float(vinc))
17.     #vC.x=math.floor(vC.x)
18.     #vC.y=math.floor(vC.y)
19.     #vC.z=math.floor(vC.z)
20.     print(vC)
21.     PARAMS={'x':vC.x, 'y':vC.y, 'z': vC.z, 'radius':50,
22.     'showCoordinates':1, 'showId':1, 'showInformation':1,
23.     'showPrimaryStar':1}
24.     v = requests.get('https://www.edsm.net/api-v1/cube-systems', params=PARAMS)
25.     cdat=v.json()
26.     #fakelambda
27.     #if not any(d['name'] == cell['name'] for d in total):
28.     for cell in cdat:
29.         hasDupe=0
30.         for tc in total:
31.             if tc['name']==cell['name']:
32.                 hasDupe=1
33.                 break
34.         if hasDupe==0:
35.             total.append(cell)
36.
37. csvw = open('extraTeresticles_Hesperus_WalkingSearch.csv', mode='w')
38. writer = csv.writer(csvw, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL, lineterminator = '\n')
39. writer.writerow(['system','Center Distance', 'x', 'y', 'z', 'id'])
40. for cell in v.json():
41.     #if cell['primaryStar']['type']=="K (Yellow-Orange) Star" and cell['bodyCount']>1:
42.     writer.writerow([cell['name'], cell['distance'], cell['coords']['x'], cell['coords']['y'], cell['coords']['z'], cell['id']])
43.
44. csvw.close()
RAW Paste Data

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!