ó
:˜êWc           @   s   d  Z  d „  Z d S(   s=   
Created on Fri Jan 15 10:08:12 2016

@author: Ivan Masmitja
c         C   s«  d d l  } d d l j } | j |  d d d d d d d t ƒ\ } } } } } | | j | ƒ } | d }	 | d }
 | |	 } | |
 } g  } d } d } x_ t d | j d ƒ D]G } | j | | | | ƒ | k rµ | j	 | ƒ | | 7} | } qµ qµ Wg  } d } d } x_ t d | j d ƒ D]G } | j | | | | ƒ | k r)| j	 | ƒ | | 7} | } q)q)Wt
 t | | ƒ ƒ } | | g } | | g } | | g } | j } | j | | g ƒ } | j | j d	 ƒ | j | j d	 ƒ g ƒ j f d d ƒ} | j d	 | j | j | j | ƒ g ƒ j d f d d ƒ} | j | j | j | ƒ | | g ƒ j } | | j | j | j | } | j | j | d	 ƒ ƒ j } | j | j | d | d	 ƒ ƒ j } | j | j | d | d	 ƒ ƒ j } | j | | | ƒ } | j | ƒ } | j | j | j | ƒ f d d ƒj } | d |	 | d <| d |
 | d <| |	 } | |
 } | |	 } | |
 } | | | | f S(   s…   LS-U target positioning algorithm
        Variables (filename,distancebp)
        Return (target(x,y,z),eastingpoints,northingpoints)iÿÿÿÿNt   skiprowsi   t	   delimitert   ,t   usecolsi    i   i   i   i   t   unpackt   axis(   i    i   i   i   i   (   t   numpyt   matplotlib.pyplott   pyplott   loadtxtt   Truet   amint   ranget   sizet   abst   appendt   listt   sett   matrixt   concatenatet   identityt   zerost   Tt   diagt   It   powert   sqrtt   mean(   t   filenamet
   distancebpt   npt   pltt   epochSect   eastingt   northingt   rangt   utmZonet   eastingoffsett   northingoffsett
   northindext   nt   at   it	   eastindext   indexpointst   eastingpointst   northingpointst   rangepointst	   numpointst   Pt   Nt   At   bt   Plsut   rt   depth(    (    s!   /home/bkieft/workspace/tmp/LSU.pyt   position_target_LSU   s`    



!
!
	<>-&&*



N(   t   __doc__R8   (    (    (    s!   /home/bkieft/workspace/tmp/LSU.pyt   <module>   s   