/
part3.py
executable file
·33 lines (22 loc) · 900 Bytes
/
part3.py
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
#!/usr/bin/env python3
#129L Final Project Part 3 -- user customizable program to plot locations of CMEs and sunspots on corresponding images
#import sunpy.map
from sunpy.net.helioviewer import HelioviewerClient
from matplotlib.image import imread
import matplotlib.pyplot as plt
from matplotlib import patches
hv = HelioviewerClient()
DAT = input('Date yyyy/m/d: ')
#IMRES = input('Image Resolution in arcseconds/pixel: ')
SRCID = input('Data Source ID: ')
#VIS = input('Visibility: ')
#OP = input('Opacity: ')
XFOC = input('Specify x-coord: ')
YFOC = input('Specify y-coord: ')
##include image size in a function, make dict for source ids, make optional args for composite images
IN = [SRCID, XFOC, YFOC]
FLIN = list(map(float, IN))
imgfile = hv.download_png(DAT, 6.0, [FLIN[0], 1.0, 100.0], x0=FLIN[1], y0=FLIN[2], width=512, height=512)
im = imread(imgfile)
plt.imshow(im)
plt.show()