--- /dev/null
+$ cc_vib_analyze.py -m 300 -M 7000 ~/rsrch/data/z_piezo_calib/20080919/20080919121041_zp_time_50000Hz
+Traceback (most recent call last):
+ File "/home/wking/script/lab/cc_vib_analyze.py", line 442, in <module>
+ data = read_data(ifilename)
+ File "/home/wking/script/lab/cc_vib_analyze.py", line 374, in read_data
+ unlabeled_data=scipy.io.read_array(ifile)
+ File "/usr/lib/python2.5/site-packages/scipy/io/array_import.py", line 385, in read_array
+ outarr[k][row] = vals[k]
+ValueError: shape mismatch: objects cannot be broadcast to a single shape
+
--- /dev/null
+Ahh, I didn't read my own help command, and it was wrong anyway :p.
+Now that it's corrected, you can fit a single vibration timeseries with
+
+$ int16_to_ascii ~/rsrch/data/z_piezo_calib/20080919/20080919121041_zp_time_50000Hz > di
+$ cc_vib_analyze.py -m 300 -M 7000 -f 50000 -p -G di
+
+or
+
+$ cc_vib_analyze.py -m 300 -M 7000 -f 50000 -p -G -d ~/rsrch/data/z_piezo_calib/20080919/20080919121041_zp_time_50000Hz
+
+Perhaps someone will add support for the
+"<frequency_Hz>\t<deflection_psd X^2/Hz>\n"
+format later...
+
'2008, W. Trevor King.\n'
'\n'
'Deflection power spectral density (PSD) data (X^2/Hz)\n'
- 'and returns the variance in X units (X^2)'
- '<input-file> should be whitespace-delimited, 2 column ASCII\n'
- 'without a header line.\n'
- 'e.g: "<frequency_Hz>\\t<deflection_psd X^2/Hz>\\n"\n')
+ 'and returns the variance in X units (X^2)\n'
+ '<input-file> should be 1 column ASCII without a header line.\n'
+ 'e.g: "<deflection bits>\\n..."\n')
parser = OptionParser(usage=usage_string, version='%prog 0.1')
parser.add_option('-f', '--sample-freq', dest='freq', default=100e3,
help='sample frequency in Hz (default %default)',
parser.add_option('-t', '--tweak-mode', dest='tweakmode', action='store_true',
help='Run in tweak-file mode',
default=False)
+ parser.add_option('-d', '--datalogger-mode', dest='datalogger_mode', action='store_true',
+ help='Read input files with datalogger.read_dict_of_arrays(). This is useful, for example, to test a single line from a tweakfile.',
+ default=False)
parser.add_option('-v', '--verbose', dest='verbose', action='store_true',
help='Print lots of debugging information',
default=False)
PLOT_GUESSED_LORENTZIAN = options.plot_guess
if options.tweakmode == False :
- data = read_data(ifilename)
- deflection_bits = data['Deflection input']
+ if options.datalogger_mode:
+ data = vib_load(ifilename)
+ deflection_bits = data['Deflection input']
+ else:
+ deflection_bits = read_data(ifilename)
Vphoto_var = vib_analyze(deflection_bits, freq=options.freq,
minFreq=options.min_freq,
maxFreq=options.max_freq)