Tuesday, October 06, 2009
Sunday, May 31, 2009
Need to compute sunspot frequencies ? Here's some code for you !
#! /usr/bin/python
# $Id: sunspots.py,v 1.1 2009/05/31 12:08:08 george Exp george $
#
# Plot sunspot data.
#
# Adapted from
#
# http://linuxgazette.net/115/andreasen.html
#
# this was the original program. Dataset from
#
# http://linuxgazette.net/115/misc/andreasen/sunspots.dat
#
# Nice examples of using the newer plotting libraries can be found here:
#
# http://www.daniweb.com/code/snippet691.html
#
# History:
# Created: George Jones, 5/30/09
#
# $Log: sunspots.py,v $
# Revision 1.1 2009/05/31 12:08:08 george
# Initial revision
#
#
import math
import pylab # matplotlib
from scipy import *
import scipy.io.array_import
# Generate x,y datasets (year,wolfer)
tempdata = scipy.io.array_import.read_array('sunspots.dat')
year=tempdata[:,0]
wolfer=tempdata[:,1]
#
# Plot year vs number of sunspots
#
pylab.xlabel("Year")
pylab.ylabel("Wolfer number")
pylab.plot(year, wolfer, 'b')
# save the plot as a PNG image file (optional)
pylab.savefig('sunspots_time.png')
# show the pylab plot window
# you can zoom the graph, drag the graph, change the margins, save the graph
pylab.show()
#
# Take FFT of #s of sunspots, generating real and imaginary
#
Y=fft(wolfer)
pylab.xlabel("real(FFT)")
pylab.ylabel("img(FFT)")
pylab.title("Meas")
pylab.plot(Y.real, Y.imag, 'ro')
pylab.xlim(-4000,2000)
pylab.savefig('sunspots_FFT.png')
pylab.xlim(-4000,2000)
pylab.show()
#
# Compute the frequency of sunspots
#
n=len(Y)
power = abs(Y[1:(n/2)])**2
nyquist=1./2
freq=array(range(n/2))/(n/2.0)*nyquist
pylab.xlabel("Frequency [1/year]")
pylab.ylabel("|FFT|**2")
pylab.title("Meas")
pylab.plot(freq[1:len(freq)], power, 'b')
pylab.xlim(0,0.20)
pylab.savefig('sunspots_freq.png')
pylab.xlim(0,0.20)
pylab.show()
#
# Given the frequency, compute the period
#
period=1./freq
pylab.xlabel("Period [year]")
pylab.ylabel("|FFT|**2")
pylab.title("Meas")
pylab.plot(period[1:len(period)], power, 'b')
pylab.xlim(0,40)
pylab.savefig('sunspots_period.png')
pylab.xlim(0,40)
pylab.show()
Friday, August 15, 2008
Saturday, August 09, 2008
Saturday, July 19, 2008
Monday, July 14, 2008
Friday, December 22, 2006
Saturday, December 09, 2006
Thursday, December 07, 2006
Slashdot | Tiny Particle With No Charge Discovered: "Re:What did the bartender say to the axion?
(Score:5, Funny)
by proxy318 (944196) on Wednesday December 06, @06:31PM (#17138838)
An atom walks into a police station and says 'One of my electrons has been stolen!'
The police say 'Are you sure?'
And the atom replies...
'Yes! I'm positive!'"
(Score:5, Funny)
by proxy318 (944196) on Wednesday December 06, @06:31PM (#17138838)
An atom walks into a police station and says 'One of my electrons has been stolen!'
The police say 'Are you sure?'
And the atom replies...
'Yes! I'm positive!'"
Monday, November 27, 2006
Saturday, October 28, 2006
Sunday, October 01, 2006
Captin Crunch @ Toorcon 8
Saturday Night at Toorcon 8 there was a "Nostalgia" panel.
"Captain Crunch" was one of the panelists. The panel
was a mix of Crunch talking about phone phreaking and
the others (half is age at best) talking about Apple II
hacking using simulators. There was an ASCII art theme.
Crunch was a presence that could not be equaled.
He is to the hacking community what Richard Stallman
is to free software.
Stories included how he got into phone phreaking...
he was testing a low power FM transmitter he
had designed and asked anyone who heard him to call.
"Some blind kids" who later identified themselves
as "phreakers" called and eventually got Crunch
started on the path to free dial-tone and mapping
the AT&T phone system.
He discovered special testing phone numbers (developers
never put in back doors...), reverse engineered
the touch tones (new in those days) and frequencies
needed to make free calls and built his own tone generator
boxes.
He talked about mapping the 800 number system,
discovering the CIA's special number to reach the
president (Nixon), being able to listen in to part
of the calls, and then trading that number (warez
anyone ?) to another phreakers for a number he wanted.
Oh, he also had some things to say about Apple II
hacking. He related a story about a disagreement
he had with Woz over hardware design (6 vs 8 bit DACs)
when he was working for Apple designing the hardware.
Been there. Done that. Listen up kiddies.
Saturday Night at Toorcon 8 there was a "Nostalgia" panel.
"Captain Crunch" was one of the panelists. The panel
was a mix of Crunch talking about phone phreaking and
the others (half is age at best) talking about Apple II
hacking using simulators. There was an ASCII art theme.
Crunch was a presence that could not be equaled.
He is to the hacking community what Richard Stallman
is to free software.
Stories included how he got into phone phreaking...
he was testing a low power FM transmitter he
had designed and asked anyone who heard him to call.
"Some blind kids" who later identified themselves
as "phreakers" called and eventually got Crunch
started on the path to free dial-tone and mapping
the AT&T phone system.
He discovered special testing phone numbers (developers
never put in back doors...), reverse engineered
the touch tones (new in those days) and frequencies
needed to make free calls and built his own tone generator
boxes.
He talked about mapping the 800 number system,
discovering the CIA's special number to reach the
president (Nixon), being able to listen in to part
of the calls, and then trading that number (warez
anyone ?) to another phreakers for a number he wanted.
Oh, he also had some things to say about Apple II
hacking. He related a story about a disagreement
he had with Woz over hardware design (6 vs 8 bit DACs)
when he was working for Apple designing the hardware.
Been there. Done that. Listen up kiddies.
Wednesday, August 09, 2006
Wednesday, July 12, 2006
The Alice and Bob After Dinner Speech: "There comes a time when people at a technical conference like this need
something more relaxing. A change of pace. A shift of style. To put aside
all that work stuff and think of something refreshingly different."
something more relaxing. A change of pace. A shift of style. To put aside
all that work stuff and think of something refreshingly different."
Friday, June 16, 2006
Monday, June 12, 2006
Subscribe to:
Posts (Atom)







