Fixed C->K conversion bug in T_analyze.py
authorW. Trevor King <wking@drexel.edu>
Thu, 8 Jan 2009 19:05:11 +0000 (14:05 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 8 Jan 2009 19:06:34 +0000 (14:06 -0500)
Closes 327f4db8-3119-4ec1-a762-a3115254608a

.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/body [new file with mode: 0644]
.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/values [new file with mode: 0644]
.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/body [new file with mode: 0644]
.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/values [new file with mode: 0644]
.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/values
calibcant/T_analyze.py

diff --git a/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/body b/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/body
new file mode 100644 (file)
index 0000000..15b0e7f
--- /dev/null
@@ -0,0 +1,3 @@
+Ah, it wasn't converting from Celsius to Kelvin.
+Bug fixed now.
+
diff --git a/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/values b/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/7773ff3c-70e4-47c8-92c6-e3df36ba3b28/values
new file mode 100644 (file)
index 0000000..5797d8a
--- /dev/null
@@ -0,0 +1,8 @@
+Content-type: text/plain
+
+
+Date: Thu, 08 Jan 2009 19:04:17 +0000
+
+
+From: W. Trevor King <wking@drexel.edu>
+
diff --git a/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/body b/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/body
new file mode 100644 (file)
index 0000000..46c0763
--- /dev/null
@@ -0,0 +1,8 @@
+And here is my analysis of data on the same cantilever that I took:
+
+Variable (units)              : mean +/- std. dev. (relative error)
+Cantilever k (N/m)            : 0.0686691 +/- 0.00134223 (0.0195464)
+photoSensitivity**2 (V/nm)**2 : 0.000333038 +/- 1.88694e-06 (0.00566586)
+T (K)                         : 295.15 +/- 5.68434e-14 (1.92592e-16)
+1/Vphoto**2 (1/V)**2          : 50598.9 +/- 946.564 (0.0187072)
+
diff --git a/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/values b/.be/bugs/327f4db8-3119-4ec1-a762-a3115254608a/comments/d6ee4411-37cb-4978-b025-919b63db533d/values
new file mode 100644 (file)
index 0000000..ba31e40
--- /dev/null
@@ -0,0 +1,11 @@
+Content-type: text/plain
+
+
+Date: Thu, 08 Jan 2009 18:33:08 +0000
+
+
+From: W. Trevor King <wking@drexel.edu>
+
+
+In-reply-to: 6616d9b2-29ee-4de8-9282-0f8082ba796b
+
index fa8e6eb1b7cf1aca5d7634aafc4e30e299ac3d27..ef2a1f437cf35c65b27dfacb99e48d092d173fe0 100644 (file)
@@ -7,7 +7,7 @@ reporter: W. Trevor King <wking@drexel.edu>
 severity: minor
 
 
-status: open
+status: fixed
 
 
 summary: 'analyze.py --verbose outputs "T (K) : <temp in C"'
index 00804cd969568f1d74a8450f2f24c9f8ca21213b..6f0a8a12795dac041b2ba2108e1b9b0383adc479 100755 (executable)
@@ -112,7 +112,7 @@ def T_load_analyze_tweaked(tweak_file, convert_to_K=C_to_K, textVerboseFile=None
         # read the data
         data = T_load(path)
         Ts.extend(data)
-    T_analyze(Ts, convert_to_K=K_to_K)
+    T_analyze(Ts, convert_to_K=convert_to_K)
     return numpy.array(Ts, dtype=numpy.float)
 
 # commandline interface functions
@@ -146,7 +146,7 @@ if __name__ == '__main__' :
                     )
     parser = OptionParser(usage=usage_string, version='%prog 0.1')
     parser.add_option('-C', '--celsius', dest='celsius',
-                      help='Use Celsius input temperatures instead of Kelvin (defaul %default)\n',
+                      help='Use Celsius input temperatures instead of Kelvin (default %default)\n',
                       action='store_true', default=False)
     parser.add_option('-o', '--output-file', dest='ofilename',
                       help='write output to FILE (default stdout)',
@@ -181,11 +181,11 @@ if __name__ == '__main__' :
     if options.celsius :
         convert_to_K = C_to_K
     else :
-        convert_to_K = lambda T : T # no-change function
-
+        convert_to_K = K_to_K
+    
     if options.tweakmode == False :
         data = read_data(ifilename)
-        Ts = T_analyze(T, convert_to_K)
+        Ts = T_analyze(data, convert_to_K)
     else : # tweak file mode
         Ts = T_load_analyze_tweaked(ifilename, convert_to_K, textVerboseFile=vfile)