# Demo of looking at Rheology (science of how materials deform and flow) data produced by Sarah, 
# Jeremy's wife and perspective Autoplot user.  The machine (Malvern Gemini Control-Stress 
# Rhemometer) produces these ".raw" files  which can be parsed and analyzed easily with Autoplot.

# This must be run in the "Data Source Context", meaning it only loads data.

raw= getDataSet( 'vap+dat:http://sarahandjeremy.net/~jbf/data.backup/examples/dat/sarah/2490lintest90005.raw?skip=31&column=field1' )
freq= 15.47436
nperiod= 1
time= dindgen(512) * nperiod / freq / 512
time.putProperty( QDataSet.UNITS, Units.seconds )
raw.putProperty( QDataSet.DEPEND_0, time )

disp= getDataSet( 'vap+dat:http://sarahandjeremy.net/~jbf/data.backup/examples/dat/sarah/2490lintest90005.raw?skip=31&column=field3' )
disp.putProperty( QDataSet.DEPEND_0, time )

fftraw= magnitude(fft(raw))

fftraw= 2 * fftraw[ 0:fftraw.length()/2 ]  # keep only the positive frequencies