Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,20 @@ import urllib.request
|
|
11 |
import uuid
|
12 |
main_directory = "https://services.swpc.noaa.gov/"
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
nasa_images=[
|
15 |
{"name":"EIT 171A", "source":"https://soho.nascom.nasa.gov/data/realtime/eit_171/512/latest.jpg"},
|
16 |
{"name":"EIT 195A", "source":"https://soho.nascom.nasa.gov/data/realtime/eit_195/512/latest.jpg"},
|
@@ -202,16 +216,19 @@ def make_nasa_soho_videos():
|
|
202 |
html_out+='</div>'
|
203 |
return html_out
|
204 |
|
205 |
-
def make_nasa_soho_images():
|
206 |
html_out=f"<style>{css}</style><div class='img_box_soho'>"
|
207 |
-
for ea in
|
208 |
file_name=ea['source']
|
209 |
html_out+=f'<div class="img_class_soho"><img src="file={file_name}"></div>'
|
210 |
html_out+='</div>'
|
211 |
-
html_in = make_nasa_soho_videos()
|
212 |
html_out+=html_in
|
213 |
return html_out
|
214 |
-
|
|
|
|
|
|
|
|
|
215 |
def run():
|
216 |
out=make_tree()
|
217 |
im_html=get_images()
|
@@ -240,7 +257,7 @@ with gr.Blocks() as app:
|
|
240 |
html_nasa=gr.HTML()
|
241 |
|
242 |
###### NASA Images ##########
|
243 |
-
soho_btn.click(
|
244 |
###### NOAA Images ##########
|
245 |
load_btn.click(load_json,[drop1,drop2,drop3,drop4],[html_raw,links])
|
246 |
anim_btn.click(make_animation,None,[file_out]).then(make_html,file_out,anim_out)
|
|
|
11 |
import uuid
|
12 |
main_directory = "https://services.swpc.noaa.gov/"
|
13 |
|
14 |
+
sdo_aia_latest=[
|
15 |
+
{"name":"Fe18 94A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_94.gif"},
|
16 |
+
{"name":"Fe20 131A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_131.gif"},
|
17 |
+
{"name":"Fe9/10 171A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_171.gif"},
|
18 |
+
{"name":"Fe12 193A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_193.gif"},
|
19 |
+
|
20 |
+
{"name":"Fe14 211A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_211.gif"},
|
21 |
+
{"name":"He2 304A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_304.gif"},
|
22 |
+
{"name":"Fe16 335A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_335.gif"},
|
23 |
+
{"name":"cont+C4 1600A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_1600.gif"},
|
24 |
+
{"name":"continuum 1700A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_1700.gif"},
|
25 |
+
{"name":"continuum 4500A", "source":"https://umbra.nascom.nasa.gov/images/latest_aia_4500.gif"},
|
26 |
+
]
|
27 |
+
|
28 |
nasa_images=[
|
29 |
{"name":"EIT 171A", "source":"https://soho.nascom.nasa.gov/data/realtime/eit_171/512/latest.jpg"},
|
30 |
{"name":"EIT 195A", "source":"https://soho.nascom.nasa.gov/data/realtime/eit_195/512/latest.jpg"},
|
|
|
216 |
html_out+='</div>'
|
217 |
return html_out
|
218 |
|
219 |
+
def make_nasa_soho_images(inp_src: list):
|
220 |
html_out=f"<style>{css}</style><div class='img_box_soho'>"
|
221 |
+
for ea in inp_src:
|
222 |
file_name=ea['source']
|
223 |
html_out+=f'<div class="img_class_soho"><img src="file={file_name}"></div>'
|
224 |
html_out+='</div>'
|
|
|
225 |
html_out+=html_in
|
226 |
return html_out
|
227 |
+
def make_nasa_soho_image_trigger():
|
228 |
+
html_in = make_nasa_soho_images(nasa_images)
|
229 |
+
html_in+= make_nasa_soho_images(sdo_aia_latest)
|
230 |
+
html_in+= make_nasa_soho_videos()
|
231 |
+
return html_in
|
232 |
def run():
|
233 |
out=make_tree()
|
234 |
im_html=get_images()
|
|
|
257 |
html_nasa=gr.HTML()
|
258 |
|
259 |
###### NASA Images ##########
|
260 |
+
soho_btn.click(make_nasa_soho_image_trigger,None,html_nasa)
|
261 |
###### NOAA Images ##########
|
262 |
load_btn.click(load_json,[drop1,drop2,drop3,drop4],[html_raw,links])
|
263 |
anim_btn.click(make_animation,None,[file_out]).then(make_html,file_out,anim_out)
|