-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathduvalls_law.py
More file actions
27 lines (22 loc) · 803 Bytes
/
duvalls_law.py
File metadata and controls
27 lines (22 loc) · 803 Bytes
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
#!/usr/bin/env python
import numpy as np
from matplotlib import pyplot as pl
# data from SDO/HMI webpage
# http://jsoc.stanford.edu/HMI/Global_products.html
try:
data = np.load('data/hmi_modes.npy')
except IOError:
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
response = urlopen('http://jsoc.stanford.edu/SUM99/D951224643/S00000/m10qr.8488')
data = np.loadtxt(response.readlines())
response.close()
np.save('data/hmi_modes.npy', data)
l, n, obs, err = data[:,[0,1,2,7]].T
pl.semilogx(obs/(0.5+l), (n+1.5)/2./obs/1e-6, 'o')
# pl.scatter(obs/(0.5+l), (n+1.46)/2./obs/1e-6, s=10, c=n)
pl.xlabel(r'$\nu_{n\ell}/(\ell+1/2)\,(\mu\mathrm{Hz})$')
pl.ylabel(r'$(n+\alpha)/2\nu_{n\ell}\,(\mathrm{s})$')
pl.show()