Skip to content

Commit

Permalink
all with sun of 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
ADI-ROXX committed Mar 7, 2023
1 parent 419ece0 commit bbee55e
Show file tree
Hide file tree
Showing 12 changed files with 1,427 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
110 changes: 110 additions & 0 deletions App_mag.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
,Number,Brightness
1,1.0,8.4
2,2.0,6.5
3,3.0,6.39
4,4.0,5.6
5,5.0,5.6
6,6.0,4.2
7,7.0,3.3
8,8.0,4.6
9,9.0,7.7
10,10.0,6.6
11,11.0,5.8
12,12.0,6.7
13,13.0,5.8
14,14.0,7.6
15,15.0,6.2
16,16.0,6.4
17,17.0,6.0
18,18.0,7.5
19,19.0,6.8
20,20.0,+6.3
21,21.0,6.5
22,22.0,5.1
23,23.0,5.5
24,24.0,2.5
25,25.0,4.6
26,26.0,8.0
27,27.0,7.4
28,28.0,6.8
29,29.0,7.1
30,30.0,7.2
31,31.0,3.44
32,32.0,8.08
33,33.0,5.72
34,34.0,5.5
35,35.0,5.3
36,36.0,6.3
37,37.0,6.2
38,38.0,7.4
39,39.0,4.6
40,40.0,5.6
41,41.0,4.5
42,42.0,4.0
43,43.0,9.0
44,44.0,3.7
45,45.0,1.6
46,46.0,6.0
47,47.0,4.4
48,48.0,5.8
49,49.0,8.4
50,50.0,5.9
51,51.0,8.4
52,52.0,7.3
53,53.0,7.6
54,54.0,7.6
55,55.0,6.3
56,56.0,8.3
57,57.0,8.8
58,58.0,9.7
59,59.0,9.6
60,60.0,8.8
61,61.0,9.7
62,62.0,6.5
63,63.0,9.3
64,64.0,8.52
65,65.0,9.3
66,66.0,8.9
67,67.0,6.1
68,68.0,7.8
69,69.0,7.6
70,70.0,7.9
71,71.0,8.2
72,72.0,9.3
73,73.0,9.0
74,74.0,9.4
75,75.0,8.5
76,76.0,+10.1
77,77.0,8.9
78,78.0,8.3
79,79.0,7.7
80,80.0,7.3
81,81.0,6.94
82,82.0,8.41
83,83.0,7.6
84,84.0,9.1
85,85.0,9.1
86,86.0,8.9
87,87.0,8.6
88,88.0,9.6
89,89.0,9.8
90,90.0,9.5
91,91.0,10.2
92,92.0,6.4
93,93.0,6.0
94,94.0,8.2
95,95.0,9.7
96,96.0,9.2
97,97.0,9.9
98,98.0,10.1
99,99.0,9.9
100,100.0,9.3
101,101.0,7.9
103,103.0,7.4
104,104.0,8.0
105,105.0,9.3
106,106.0,8.4
107,107.0,7.9
108,108.0,10.0
109,109.0,9.8
110,110.0,8.5
79 changes: 79 additions & 0 deletions Code_to_run#1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import requests
from bs4 import BeautifulSoup
import threading
import pandas as pd
dic={"Messier":[0],"RA_h":[0],"RA_m":[0],"RA_s":[0],"Dec_d":[0],"Dec_m":[0],"Dec_s":[0]}
df=pd.DataFrame(dic)
def threader(a,b):
for i in range(a,b):
if i==102:
continue
try:
url="https://en.wikipedia.org/wiki/Messier_"+str(i)
r = requests.get(url)
h=str(r.content)


a=str(h)







soup=BeautifulSoup(h,"html.parser")
a=str(soup)
a=a.replace(r"\xe2\x88\x92","-")
a=a.replace(r"\xc2\xb0","d")
a=a.replace(r"\xe2\x80\xb2","\'")
a=a.replace(r"\xe2\x80\xb3","\"")
# print(a.split("external text")[1].split("rel=\"nofollow\">")[1].split("<sup>h</sup>")[1].split("<sup>m</sup>")[1].split("<sup>s</sup>")[1])
ra_h=float(a.split("external text")[1].split("rel=\"nofollow\">")[1].split("<sup>h</sup>")[0])
ra_m=a.split("external text")[1].split("rel=\"nofollow\">")[1].split("<sup>h</sup>")[1].split("<sup>m</sup>")[0]
ra_s=a.split("external text")[1].split("rel=\"nofollow\">")[1].split("<sup>h</sup>")[1].split("<sup>m</sup>")[1].split("<sup>s</sup>")[0]
# val=h.split("Apparent magnitude")[2].split("infobox-data\">")[1].split("<")[0]
# print(ra_m)

dec=a.split("external text")[1].split("rel=\"nofollow\">")[1].split("<sup>h</sup>")[1].split("<sup>m</sup>")[1].split("<sup>s</sup>,")[1]
# print(dec)
dec_d=float(dec.split("d")[0])
dec_m=float(dec.split("d")[1].split("\'")[0])
dec_s=float(dec.split("d")[1].split("\'")[1].split("\"")[0])
df.loc[len(df.index)]=[i,ra_h,ra_m,ra_s,dec_d,dec_m,dec_s]
print(ra_h,ra_m,ra_s,dec_d,dec_m,dec_s,sep=" ")

except:
df.loc[len(df.index)]=[i,"Null","Null","Null","Null","Null","Null"]#,"Null","Null","Null","
# print(h.split("Apparent magnitude")[2])#.split("infobox-data\">")[1])#.split("<")[0])
# print(h.split("Apparent magnitude")[2].split("infobox-data\">")[1].split("<")[0])
if __name__ =="__main__":
# creating thread
# for i in range(1,111,10):
t1 = threading.Thread(target=threader, args=(1,41,))


t2 = threading.Thread(target=threader, args=(41,81,))
t3 = threading.Thread(target=threader, args=(81,111,))

# starting thread 1
t1.start()
# starting thread 2
t2.start()
t3.start()

# wait until thread 1 is completely executed
t1.join()
t2.join()
t3.join()
# wait until thread 2 is completely executed
df=df.sort_values(by=["Messier"])
# df.drop([df.columns[0]],axis=1,inplace=True)
colum=df['Messier']
# df.to_csv("coordadf_mess.csv")
for i in range(1,len(colum)):
colum[i]="M"+str(colum[i])
df['Messier']=colum
df.to_csv("coord_mess.csv")
print(df)
print("Program finished.")
20 changes: 20 additions & 0 deletions Code_to_run#2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import requests
from bs4 import BeautifulSoup
# import pandas as pd
url = "http://people.tamu.edu/~kevinkrisciunas/ra_dec_sun_2023.html"
ht=requests.get(url)
cont=ht.content
soup=BeautifulSoup(cont,'html.parser')
stri=soup.find('pre').get_text()
values=stri[105:]
values=values.replace(',','')
values="Date,RA(hms),Dec(dms)\n"+values
values=values.replace(" ",'')
values=values.replace(" ",",")

print(values)
file=open("Sun_values.csv","w")
file.write(values)
file.close()


Loading

0 comments on commit bbee55e

Please sign in to comment.