³ò
VærHc           @   sƒ   d  Z  d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k	 Z	 d e	 i
 f d „  ƒ  YZ d S(   s÷  
Manipulating the Melting Curve Thermometry logs.

Log format:
[:,0] (1) Time (sec, since 1 January 1970 UTC)
[:,1] (2) Ratio transformer bridge ratio, set point
[:,2] (3) Off-balance voltage (V)
[:,3] (4) Bridge ratio (corrected for off-balance voltage)
[:,4] (5) Absolute pressure (bar, without A-transition correction)
[:,5] (6) Temperature (mK, Greywall scale)
[:,6] (7) Temperature (mK, PLTS2000 high temperature scale)
[:,7] (8) Temperature (mK, PLTS2000 low temperature scale)

07 June 2008, Lev
iÿÿÿÿNt   MCTLogc           B   s¡   e  Z d  Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z h  d
 d <d d <Z e d „  ƒ Z e d d d „ ƒ Z RS(   sÃ  
    Represents a Melting Curve Thermometry log over a certain time.
    Two logs can be concatenated with a '&' sign

    'self.device' is the thermometer name, two logs must have the same gauge names in order to concatenate them.

    log format:

    [:,0] (1) Time (sec, since 1 January 1970 UTC)
    [:,1] (2) Ratio transformer bridge ratio, set point
    [:,2] (3) Off-balance voltage (V)
    [:,3] (4) Bridge ratio (corrected for off-balance voltage)
    [:,4] (5) Absolute pressure (bar, without A-transition correction)
    [:,5] (6) Temperature (mK, Greywall scale)
    [:,6] (7) Temperature (mK, PLTS2000 high temperature scale)
    [:,7] (8) Temperature (mK, PLTS2000 low temperature scale)
    c           C   s   d S(   s)   return number of columns in the self.datai   (    (    (    (    s   c:\py\lib\mct.pyt
   fieldcount-   s    c         C   s   |  i  d d … d f S(   s   Ratio Transformer Set PointNi   (   t   data(   t   self(    (    s   c:\py\lib\mct.pyt   r_set0   s    c         C   s   |  i  d d … d f S(   s   Off-balance voltage (V)Ni   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   V_off1   s    c         C   s   |  i  d d … d f S(   s   Bridge ratioNi   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   r2   s    c         C   s   |  i  d d … d f S(   s*   Pressure[bar], no A-transition correction Ni   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   P3   s    c         C   s   |  i  d d … d f S(   s   Greywall scale temperature [mK]Ni   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   T_grwl4   s    c         C   s   |  i  d d … d f S(   s$   PLTS2000 high scale temperature [mK]Ni   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   T_pltsH5   s    c         C   s   |  i  d d … d f S(   s#   PLTS2000 low scale temperature [mK]Ni   (   R   (   R   (    (    s   c:\py\lib\mct.pyt   T_pltsL6   s    c         C   s   d |  i  |  i ƒ  f S(   Ns	   %s Log %s(   t   devicet   datespan(   R   (    (    s   c:\py\lib\mct.pyt   __repr__8   s    t   MCTNSs   _MCT_NuclearStage.datt   MCTMCs   _MCT_MixingChamber.datc         C   s  t  i i |  ƒ } | d } t i i | ƒ p d Sn t i |  d t	 t i
 ƒ  ƒ ƒ} t i | d d … d f ƒ | d d … d f <t i | | d d … d f d j d f <t i | | d d … d f d j d f <t i | | d d … d f d j d f <t | t i | ƒ S(	   sp   
        Load an MCT log from a given file
        The thermometer is infered from the filename suffix.
        i   t   usecolsNi    i   iÿÿÿÿi   i   (   t   ost   patht   basenameR    t   devNamest   has_keyt   Nonet   flibt	   loadasciit   rangeR   t
   labview2tmt   numpyt   NaN(   t   filenameR   t   suffixR   (    (    s   c:\py\lib\mct.pyt   load=   s    
!/)))c         C   s)   t  i d |  d | d | ƒi | | ƒ S(   sƒ   
        Return highP paroscientific log for a given run, withing [start, end]
        period if boundaries are specified.
        s    \\phpc338\Run%d\MCT_NuclearStaget   startt   end(   R    t   loaddirt   period(   t   runR    R!   (    (    s   c:\py\lib\mct.pyt	   loadMCTNSV   s    N(   t   __name__t
   __module__t   __doc__t   staticmethodR   R   R   R   R   R   R	   R
   R   R   R   R   R%   (    (    (    s   c:\py\lib\mct.pyR       s   								(   R(   R   t   os.patht   timet   datetimeR   t   matplotlib.datest
   matplotlibR   t   timelogt   TimeLogR    (    (    (    s   c:\py\lib\mct.pys   <module>   s   