示例#1
0
damoon = ephem.Moon()
obs = ephem.Observer()
obs.lat = np.deg2rad(37.8732)
obs.long = np.deg2rad(-122.2573)
obs.date = ephem.date("2014-04-06 20:12:45")
damoon.compute(obs)
for i, lst in enumerate(moon["lst"]):
    moon["ra"][i] = 24. * damoon.ra / (2. * np.pi)
    moon["dec"][i] = np.rad2deg(damoon.dec)
    obs.date += 1. / 86164.
    damoon.compute(obs)

moon.data["ha"] = moon.data["lst"] - moon.data["ra"]
moon.data["ha"] -= (24.0 * (moon.data["ha"] > 12.0))

moon.slice(0, len(moon["volts"])-5000)

# Next we set invalid points (from telescope homing) to the avg_dc
moon.flatten_invalid_points()

plt.subplot(211)
plt.plot(moon["ha"], moon["volts"])
plt.xlabel(r"Hour angle [h]", fontsize=18)
plt.ylabel(r"Power", fontsize=18)
plt.subplot(212)
trans = np.fft.fft(moon["volts"])
freqs = np.fft.fftfreq(len(trans), 2. * np.pi * 1.0 / 86164.)
plt.plot(np.fft.fftshift(freqs), np.fft.fftshift(abs(trans)**2))
plt.xlabel(r"Frequency [rad$^{-1}$]", fontsize=18)
plt.ylabel(r"Power", fontsize=18)
示例#2
0
font = dict(
    size = 14
)
matplotlib.rc('font', **font)

B = 10.06
wl = 3e8 / 10.67e9

datafile = "../data/sun-4_3_2014-22.npz"
logfile = "../data/logs/sun-4_3_2014-22-log"

sun = Analyzer(datafile, logfile, dt=1.0)

# First we will remove that raised section at the end (starts at index 26000)
sun.slice(0, 26000)

# Next we set invalid points (from telescope homing) to the avg_dc
sun.flatten_invalid_points()


plt.subplot(211)
plt.plot(sun["ha"], sun["volts"])
plt.xlabel(r"Hour angle [h]", fontsize=18)
plt.ylabel(r"Power", fontsize=18)
plt.subplot(212)
trans = np.fft.fft(sun["volts"])
freqs = np.fft.fftfreq(len(trans), 2. * np.pi * 1.0 / 86164.)
plt.plot(np.fft.fftshift(freqs), np.fft.fftshift(abs(trans)**2))
plt.xlabel(r"Frequency [rad$^{-1}$]", fontsize=18)
plt.ylabel(r"Power", fontsize=18)