From ae4932cdcd0e4647d46a8737e10fa8e852ba2344 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Nov 2008 20:27:58 -0500 Subject: [PATCH] Fixed non-interactive pylab plotting setup in common.py Also fixed spacing in analyze.py from last change and removed some .pyc files from versioning. --- calibcant/T_analyze.py | 1 - calibcant/T_analyze.pyc | Bin 6127 -> 0 bytes calibcant/analyze.py | 2 +- calibcant/common.py | 5 +++-- calibcant/common.pyc | Bin 1618 -> 0 bytes calibcant/config.py | 12 ++++++------ calibcant/config.pyc | Bin 866 -> 0 bytes calibcant/vib_analyze.py | 25 +++++++++++++++++-------- 8 files changed, 27 insertions(+), 18 deletions(-) delete mode 100644 calibcant/T_analyze.pyc delete mode 100644 calibcant/common.pyc delete mode 100644 calibcant/config.pyc diff --git a/calibcant/T_analyze.py b/calibcant/T_analyze.py index 4b94002..7d46993 100755 --- a/calibcant/T_analyze.py +++ b/calibcant/T_analyze.py @@ -36,7 +36,6 @@ import numpy import common # common module for the calibcant package import config # config module for the calibcant package import data_logger -import z_piezo_utils import linfit def C_to_K(celsius) : diff --git a/calibcant/T_analyze.pyc b/calibcant/T_analyze.pyc deleted file mode 100644 index 83a378148a6c25f45179dff96cecc732f20e0d7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6127 zcmcIoOLH5?5$;`*APJKa^`f4RMzUprG6_<&U6nYpY+9ydS_-8CAlpGX*;-(R;EIb~ zXlFngD(VvX59FBqg&h6Qa>+6Ix(6Uo_9X|I5(e|=>6z)r*WLK}-;3qr7ytRXO~b$Q z`2GSPdv%IP6E)EWq(eFgsELm6htv#5{V8frjr!BnoF4UOs5vw0m#A4HJw-o(;VhY1 z($n-47|tO0a5@;$T_$}+=&lOgHPY{r{vGM-q}3$d4bnG-?!6HwaDD&R{BDu{KTxB3gZ%Xkz00C`=Z=2dywHJ%B~yJW7?8wh2MUd&LhOo79ltMs=J zi+IU8U2a|{bA=Mc+ITTV`7%~+jHWj5G-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bq-Cgs!coOYh} zyP4XmKiJtBDitZx7;I7AWV%|dqPl`ItxylTePm*H0{RB^H^*vLukS1PNu2Qs;~Hmv15Fd6G=AoXy$Z_=J+P(VF%QXGnZ>3r zdQjr1TO)%h3l_#wbc^F!hk`wFMc?0ZNat^sTaLYJYcPzFS4h^9v%DBi>@BQIKFh`f z8aA7UJ5RPp2Ri_c#?p$sO7d`qmSMijf zKJ_Ph5^KZ{VYr8J+J|Vif&!x(9o`}RHTeI^+WQUuF-(5BVzbl60a42Ij49}E!cAp_2=ciGhd(q5T-l7v%0 zJ>)7efqVR6^-ID5z^{*EmLQs>KI6H!@*BV$&byb!-Ik8;|BKJYhiV_9k;|?6h%dha zi3p-d=j|wxusuwGyWKpiUFB_(@3Jkuih7B8l}CO20%3&=Zn}pQfS*|7Gkr3^zlPLq zaKjc>yNgDE+;ZHhCVA~+p5El<52Lk6O1LNzLO_)S{MsLRnGs)nF&bJP8=92i+IA3MSd+1%aSO_&QfC))^0N? zM@MlY5rKD+8dp%_1`T#b?Hy|A!w zdSPLH_VlSs;e2T^TnbA|7lI2x2^FVrucAL2Otj(Ipd7p#mcylBIh+rcf<+`&3#d}( VF<%bnF~1O;3onE`DxtR&{0|*3#25eo diff --git a/calibcant/analyze.py b/calibcant/analyze.py index f61f930..797a78a 100755 --- a/calibcant/analyze.py +++ b/calibcant/analyze.py @@ -118,7 +118,7 @@ def string_errors(k_m, k_s, T_r = T_s / T_m one_o_Vphoto2_r = one_o_Vphoto2_s / one_o_Vphoto2_m string = "Variable (units) : mean +/- std. dev. (relative error)\n" - string += "Cantilever k (N/m) : %g +/- %g (%g)\n" \ + string += "Cantilever k (N/m) : %g +/- %g (%g)\n" \ % (k_m, k_s, k_r) string += "photoSensitivity**2 (V/nm)**2 : %g +/- %g (%g)\n" \ % (photoSensitivity2_m, photoSensitivity2_s, photoSensitivity2_r) diff --git a/calibcant/common.py b/calibcant/common.py index 24e5f1d..2db32e1 100644 --- a/calibcant/common.py +++ b/calibcant/common.py @@ -29,6 +29,7 @@ VERSION="0.2" _flush_plot = None _final_flush_plot = None _pylab = None +def _dummy_fn(): pass def _import_pylab() : """Import pylab plotting functions for when we need to plot. This @@ -46,12 +47,12 @@ def _import_pylab() : if config.PYLAB_INTERACTIVE : _flush_plot = _pylab.draw else : - def _flush_plot () : pass + _flush_plot = _pylab.show #_dummy_fn if _final_flush_plot == None : if config.PYLAB_INTERACTIVE : _final_flush_plot = _pylab.draw else : - _final_flush_plot = _pylab.show + _final_flush_plot = _dummy_fn # _pylab.show def write_array(ofile, array, seperator): """Erite an iterable array seperated by seperator. diff --git a/calibcant/common.pyc b/calibcant/common.pyc deleted file mode 100644 index cfa016f1961f062b3065abdbd101c014ef9ec178..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1618 zcmb_cQI8Wh5T4ylauA3Fr2>g3SE|&lgp!uW3RR`YNsUwmv^gO`g`&;In>Dv<@7Ye% zNI7_*|ET|=KZut;!Z+UIuBGZzapLjJ*faBuXS{#B9S#3ffBjU@`G~Rpfa$&iS>Yei z3DI*fF+Go1%#%QSf%a*Y(C;`fpj9t02dtl`eVD6v7&DiE{bqdsA_U8anC=aT51wDf zWNuIdON2RzDJRkqMINDI;>|B1^hou|jKIP5fN`A8U=!j)2nLA$-v$SC`nt2eLis^3 z!0CC~V=%8HqG{6_>qWb(^QCBOrQEqhMmC;U=#)@qvwb)9brCbSb!m+Us$CYwJ zf$`zAC~_^95=&jmeNWj!7eW{7L8eL zYB}!ur9d^pKtX7Z>9{^<#d*q_SqefQ5%&PPNo5*2*`6T!#MxqkB2EBGEp6`Q0_E_k zmcL5dDOsKrrfG~Gw>y6g4*r()U5E~o(yJhT0I~>KpbLS)Xz97bgDL~l9Vv`1)!N^L z{N&ls4}V-tXU9j`!^7k0)1zRxviUY_|LdB=wyVtclV>&pnnl+^T?#`e+~*)P97Q*x zQ8bK3@#uUl66iTyPVW%Y%|O;fy|aY&5j}cwi_UtqPx$5Td-Nuv&rYw=tAx(_w8z7Y zXdjb`Y2W8P{G(2bx6ML$a2&%u139wFOZ1SyV)G@QM{aGt6Hc~}Jvx4QAs9Oj{d6pC zgC2z)H;~!*cH_lX`HKCZD{H)qvEx=5&QgvPuGY%dhLUYLWKg{{N~fG^(3=w75x4-s zbKTEj;G4izU;Ogz3(tOk^9Q`?EjrCz*6Y(WVZgTt7{1^r43LtqqT5k=1zg5RLj0#k z*?jtVmhl%mv|z@lG6tA2`0N(QCAz@(l0k%DeD%(I=?jxb diff --git a/calibcant/config.py b/calibcant/config.py index 2374ba6..14af67b 100644 --- a/calibcant/config.py +++ b/calibcant/config.py @@ -1,7 +1,7 @@ """Define some variables to configure the package for a particular lab and workflow.""" -import z_piezo_utils +import z_piezo DEFAULT_TEMP = 22 # assume 22 deg C LOG_DATA = True # quietly grab all real-world data and log to LOG_DIR @@ -14,12 +14,12 @@ PYLAB_INTERACTIVE = True # select between draw() and show() for flushing plots BASE_FIGNUM = 20 # to avoid writing to already existing figures # zpGain zpiezo applied voltage per output Volt -zpGain = z_piezo_utils._usual_zpGain +zpGain = z_piezo.DEFAULT_GAIN # zpSensitivity nm zpiezo response per applied Volt -zpSensitivity = z_piezo_utils._usual_zpSensitivity +zpSensitivity = z_piezo.DEFAULT_SENSITIVITY # Vzp_out2V function that converts output DAC bits to Volts -Vzp_out2V = z_piezo_utils._usual_Vzp_out2V +Vzp_out2V = z_piezo.DEFAULT_VZP_OUT_2_VOLTS # Vphoto_in2V function that converts input ADC bits to Volts -Vphoto_in2V = z_piezo_utils._usual_Vphoto_in2V +Vphoto_in2V = z_piezo.DEFAULT_VPHOTO_IN_2_VOLTS # zeroVphoto_bits ADC bit output for a 0V input -zeroVphoto_bits = z_piezo_utils._usual_zeroVphoto_bits +zeroVphoto_bits = z_piezo.DEFAULT_ZERO_PHOTODIODE_BITS diff --git a/calibcant/config.pyc b/calibcant/config.pyc deleted file mode 100644 index f8711bbc7523b982f8afe9f0d8fec10f83b76032..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 866 zcmZuw-EP`26gDZPh0^tB-7cqGB26OFuB&Qc1cpR`L5eotSSB%Gk;akjfZ%2J5PP$} zz;}LFc>EYJBR@m zQCvj$6vd|qmn?H;@!VqBVg)AYMiI(i(3NzOu$O!Z+5qMfj~X?ht-wYK>}V zriE_+O*Z8zbCq~z?vhGQCka!o7H%ZcDWBz%xq8mrj7AGOWA0Q)mx3oXkMe{{H=&aX zO=EW@?m)jVNKCe;Vf z*Ix~hDc9ybeg~48Nv_Qn2#G~Rh`t1SLo&`bg5;1*=_)YIpyfYxLlOp$16>3nlsVJq zV08O!()2^$Cb3RusIMW=?me|Sp^cG-KMHJ~F!&ylaWHK3fwxaLc)*W1lz z$BgNGCmnAxB69s{tjj