ó
wxTc           @   s{   d  d l  m Z d  d l Z d e f d     YZ e d k rw e j d Z d Z e e  Z	 d GHe	 j
 e  d	 GHn  d S(
   i˙˙˙˙(   t   divisionNt   ImageWorkerc           B   s   e  Z d    Z d   Z RS(   c         C   sY   d d l  m } | j |  } | j   | j   |  _ |  j j d  |  j j   d  S(   Ni˙˙˙˙(   t   marg      đ?(   t   iotbx.detectorsR   t   MARImaget   readt   get_flex_imaget   fit	   setWindowt   adjust(   t   selft   relpathR   t   m(    (    sF   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/detectors/test_mar.pyt   __init__   s    
c         C   sĹ   d d  l  } | j d |  j j   |  j j   f  } | j   \ } } } | j |  j j d   | j |  j j d   | j |  j j d   | j d | | | f  } | j	 | d  d  S(   Ni˙˙˙˙t   RGBi    i   i   t   PNG(
   t   Imaget   newR   t   ex_size1t   ex_size2t   splitt   putdatat   channelt   merget   save(   R
   t
   outputfileR   t   imt   rt   gt   bt   imageout(    (    sF   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/detectors/test_mar.pyt   output   s    *(   t   __name__t
   __module__R   R   (    (    (    sF   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/detectors/test_mar.pyR      s   	t   __main__i   s%   /net/racer/scratch1/ttleese/test2.pngs   Finished reads   Finished write(   t
   __future__R    t   syst   objectR   R    t   argvt   infilet   outfilet   IR   (    (    (    sF   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/detectors/test_mar.pyt   <module>   s   