Lydia's notes

Tips about Python and Linux.

Lydia's notes

Jupyter Notebook Example Data User Module (source / doc)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import division, print_function

# Reload user modules automatically
# %load_ext autoreload
# %autoreload 2

# notebook, inline, ...
%matplotlib notebook

from astropy.coordinates import SkyCoord
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import sunpy.map
from copy import deepcopy

# To use user modules
import sys
sys.path.append('../modules')

# print('Python version: %s' % sys.version.split('(')[0]) # Python version: 3.6.6 |Anaconda, Inc.|
# print('SunPy version: %s' % sunpy.__version__) # SunPy version: 0.9.3
Read more »

Jupyter Notebook Example Data User Module (source / doc)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import division, print_function

# Reload user modules automatically
# %load_ext autoreload
# %autoreload 2

# notebook, inline, ...
%matplotlib notebook

from astropy.coordinates import SkyCoord
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import sunpy.map
from copy import deepcopy

# To use user modules
import sys
sys.path.append('../modules')

# print('Python version: %s' % sys.version.split('(')[0]) # Python version: 3.6.6 |Anaconda, Inc.|
# print('SunPy version: %s' % sunpy.__version__) # SunPy version: 0.9.3
Read more »

Update:

Jupyter Notebook Example Data User Module (source / doc)

[ Tested ]

Ubuntu 16.04 LTS

Date Python Sunpy NumPy SciPy Matplotlib Astropy Pandas
2018-10-13 3.6.6 0.9.3 1.15.2 1.1.0 3.0.0 3.0.4 0.23.4
  • Add aiaprep_usr().
  • Change parameter list of plot_map(), plot_vmap(), proj_matrix().
  • Change return value of _get_image_params() from a tuple to a dict.
  • Adjust positions of colorbar & title.
  • Fix docs.

Jupyter Notebook

1
2
3
4
5
6
7
8
import astropy.units as u
from sunpy.net import attrs, jsoc

# Suppress some warnings
import warnings
from astropy.utils.exceptions import AstropyDeprecationWarning
warnings.simplefilter("ignore", category=FutureWarning)
warnings.simplefilter("ignore", category=AstropyDeprecationWarning)
1
2
3
4
5
6
7
8
9
10
11
12
# JSOC string: "aia.lev1_euv_12s[2014-10-26T10:00:00Z-2014-10-26T11:00:00Z@1m][193,304]{image}"
client = jsoc.JSOCClient()
response = client.search(
attrs.jsoc.Time('2014-10-26T10:00:00', '2014-10-26T10:30:00'),
attrs.jsoc.Notify('xxx@xxx'), # email
attrs.jsoc.Series('aia.lev1_euv_12s'),
attrs.jsoc.Segment('image'),
attrs.Sample(10. * u.min), # interval
attrs.jsoc.Wavelength(193 * u.AA) | attrs.jsoc.Wavelength(304 * u.AA)
)

response
Read more »
0%