Example #1
0
def posicionsol(JD):  #Algoritmo de www.psa.es/sdg/sunpos.htm
    dJD = JD - 2451545.
    dOmega = 2.1429 - 0.0010394594 * dJD
    dMeanLongitude = 4.8950630 + 0.017202791698 * dJD
    dMeanAnomaly = 6.2400600 + 0.0172019699 * dJD
    dEclipticLongitude = dMeanLongitude + 0.03341607 * np.sin(
        dMeanAnomaly) + 0.00034894 * np.sin(
            2. * dMeanAnomaly) - 0.0001134 - 0.0000203 * np.sin(dOmega)
    dEclipticObliquity = 0.4090928 - 6.2140e-9 * dJD + 0.0000396 * np.cos(
        dOmega)

    R = (1.00014 - 0.01671 * np.cos(dMeanAnomaly) -
         0.00014 * np.cos(2. * dMeanAnomaly)) * 149597870700.

    dY = np.cos(dEclipticObliquity) * np.sin(dEclipticLongitude)
    dX = np.cos(dEclipticLongitude)
    ascensionrecta = np.arctan(dY / dX)
    while ascensionrecta < 0.:
        ascensionrecta = ascensionrecta + 2 * np.pi
    declinacion = np.arcsin(
        np.sin(dEclipticObliquity) * np.sin(dEclipticLongitude))

    ascensionrecta = ascensionrecta * 180. / np.pi
    declinacion = declinacion * 180 / np.pi
    u = np.array([R, 0., 0.])
    u1 = np.array([0., -1., 0.])
    u3 = np.array([0., 0., 1.])

    u = cua.giro(u, u1, declinacion)
    u = cua.giro(u, u3, ascensionrecta)

    return u
Example #2
0
    def par2xv(self):    #Transformacion de parametros a posicion/velocidad

        p = self.parametros[0]*(1-self.parametros[1]**2)
        theta = self.parametros[5]*np.pi/180.
        r = p/(1.+self.parametros[1]*np.cos(theta))
                
        x= r*np.array([1.,0.,0.])
        z1 = np.array([0.,0.,1.])
        x1 = np.array([1.,0.,0.])
        giro1 = cua.ang2cua(z1,self.parametros[3])
        x1 = cua.giro(x1,z1,self.parametros[3])
        giro2 = cua.ang2cua(x1,self.parametros[2])
        z1 = cua.giro(z1,x1,self.parametros[2])
        giro3 = cua.ang2cua(z1,self.parametros[4])
        giro4 = cua.ang2cua(z1,self.parametros[5])

        giro = cua.pro(giro2,giro1)
        giro = cua.pro(giro3,giro)
        giro = cua.pro(giro4,giro)

        h = np.sqrt(p*self.constantes[0])
        v = np.array([self.constantes[0]*np.sin(theta)*self.parametros[1]/h, self.constantes[0]*(1.+self.parametros[1]*np.cos(theta))/h, 0.])

        x = cua.conv(x,giro)
        v = cua.conv(v,giro)        
        return x,v
Example #3
0
def posicionsol(JD):  #Algoritmo de www.psa.es/sdg/sunpos.htm
    dJD = JD - 2451545.
    dOmega = 2.1429 - 0.0010394594*dJD
    dMeanLongitude = 4.8950630 + 0.017202791698*dJD
    dMeanAnomaly =  6.2400600 + 0.0172019699*dJD
    dEclipticLongitude = dMeanLongitude + 0.03341607*np.sin(dMeanAnomaly) + 0.00034894*np.sin(2.*dMeanAnomaly) - 0.0001134 - 0.0000203*np.sin(dOmega)
    dEclipticObliquity = 0.4090928 - 6.2140e-9*dJD + 0.0000396*np.cos(dOmega)

    
    R = (1.00014 - 0.01671*np.cos(dMeanAnomaly) - 0.00014*np.cos(2.*dMeanAnomaly))* 149597870700. 

    dY=np.cos(dEclipticObliquity)*np.sin(dEclipticLongitude)
    dX=np.cos(dEclipticLongitude)
    ascensionrecta= np.arctan(dY/dX)
    while ascensionrecta<0.:
        ascensionrecta=ascensionrecta+2*np.pi    
    declinacion= np.arcsin(np.sin(dEclipticObliquity)*np.sin(dEclipticLongitude))

    ascensionrecta=ascensionrecta*180./np.pi
    declinacion=declinacion*180/np.pi
    u=np.array([R,0.,0.])
    u1=np.array([0.,-1.,0.])
    u3=np.array([0.,0.,1.])

    u=cua.giro(u,u1,declinacion)
    u=cua.giro(u,u3,ascensionrecta)

    
    return u
Example #4
0
    def par2xv(self):  #Transformacion de parametros a posicion/velocidad

        p = self.parametros[0] * (1 - self.parametros[1]**2)
        theta = self.parametros[5] * np.pi / 180.
        r = p / (1. + self.parametros[1] * np.cos(theta))

        x = r * np.array([1., 0., 0.])
        z1 = np.array([0., 0., 1.])
        x1 = np.array([1., 0., 0.])
        giro1 = cua.ang2cua(z1, self.parametros[3])
        x1 = cua.giro(x1, z1, self.parametros[3])
        giro2 = cua.ang2cua(x1, self.parametros[2])
        z1 = cua.giro(z1, x1, self.parametros[2])
        giro3 = cua.ang2cua(z1, self.parametros[4])
        giro4 = cua.ang2cua(z1, self.parametros[5])

        giro = cua.pro(giro2, giro1)
        giro = cua.pro(giro3, giro)
        giro = cua.pro(giro4, giro)

        h = np.sqrt(p * self.constantes[0])
        v = np.array([
            self.constantes[0] * np.sin(theta) * self.parametros[1] / h,
            self.constantes[0] * (1. + self.parametros[1] * np.cos(theta)) / h,
            0.
        ])

        x = cua.conv(x, giro)
        v = cua.conv(v, giro)
        return x, v
Example #5
0
def geotox(lat,lon, t=0):#Transforma coordenadas geograficas en absolutas,sobre la tierra
    
    u=np.array([1.,0.,0.])
    lon = lon + girotierra(t)
    radio, lat = radiotierra(lat,geodes=1,geocen=1)
    u1 = np.array([0.,0.,1.])
    u2 = cua.giro(u,u1,lon-90.)
    u = cua.giro(u,u1,lon)
    u = cua.giro(u,u2,lat)
    u = radio*np.array(u)
    
    
    return u
Example #6
0
 def cono(self):
     lista = np.array([[]])
     vector2 = np.array([-self.pos[0,1],self.pos[0,0],0])
     vector2 = vector2/np.sqrt(vector2[0]**2+vector2[1]**2+vector2[2]**2)
     
     vector = cua.giro(self.vector,vector2, self.semiangulo)        
     punto = self.rayo(vector)
     punto = np.array([punto])
     lista = punto
     for i in range(0,int(360./self.resolucion)):
         
         vector = cua.giro(vector,self.vector,self.resolucion)
         
         punto = self.rayo(vector)
         punto = np.array([punto])
         
         lista= np.append(lista,punto,0)
     return lista
Example #7
0
    def cono(self):
        lista = np.array([[]])
        vector2 = np.array([-self.pos[0, 1], self.pos[0, 0], 0])
        vector2 = vector2 / np.sqrt(vector2[0]**2 + vector2[1]**2 +
                                    vector2[2]**2)

        vector = cua.giro(self.vector, vector2, self.semiangulo)
        punto = self.rayo(vector)
        punto = np.array([punto])
        lista = punto
        for i in range(0, int(360. / self.resolucion)):

            vector = cua.giro(vector, self.vector, self.resolucion)

            punto = self.rayo(vector)
            punto = np.array([punto])

            lista = np.append(lista, punto, 0)
        return lista
Example #8
0
    def orbita(self):
        import cuaternios as cua

        npuntos = self.propiedades.resolucion
        Atheta = 400./npuntos
        p = self.parametros[0]*(1-self.parametros[1]**2)
        theta = Atheta

        r = p/(1+self.parametros[1])
        x = r * np.array([1.,0.,0.])

        z1 = np.array([0.,0.,1.])
        x1 = np.array([1.,0.,0.])
        giro1 = cua.ang2cua(z1,self.parametros[3])
        x1 = cua.giro(x1,z1,self.parametros[3])
        giro2 = cua.ang2cua(x1,self.parametros[2])
        z1 = cua.giro(z1,x1,self.parametros[2])
        giro3 = cua.ang2cua(z1,self.parametros[4])

        giro = cua.pro(giro3,giro2)
        giro = cua.pro(giro,giro1)

        x = cua.conv(x,giro)
        self.pos = np.array([x])



        while theta <=360.:
            
            r = p/(1+self.parametros[1]*np.cos(np.pi*theta/180))
            x = r * np.array([1.,0.,0.])
            z1 = np.array([0.,0.,1.])
            x = cua.giro(x,z1,theta)
            x = cua.conv(x,giro)
            x = np.array([x])
            
            self.pos = np.append(self.pos,x,0)
            theta = theta+ Atheta
Example #9
0
    def orbita(self):
        import cuaternios as cua

        npuntos = self.propiedades.resolucion
        Atheta = 400. / npuntos
        p = self.parametros[0] * (1 - self.parametros[1]**2)
        theta = Atheta

        r = p / (1 + self.parametros[1])
        x = r * np.array([1., 0., 0.])

        z1 = np.array([0., 0., 1.])
        x1 = np.array([1., 0., 0.])
        giro1 = cua.ang2cua(z1, self.parametros[3])
        x1 = cua.giro(x1, z1, self.parametros[3])
        giro2 = cua.ang2cua(x1, self.parametros[2])
        z1 = cua.giro(z1, x1, self.parametros[2])
        giro3 = cua.ang2cua(z1, self.parametros[4])

        giro = cua.pro(giro3, giro2)
        giro = cua.pro(giro, giro1)

        x = cua.conv(x, giro)
        self.pos = np.array([x])

        while theta <= 360.:

            r = p / (1 + self.parametros[1] * np.cos(np.pi * theta / 180))
            x = r * np.array([1., 0., 0.])
            z1 = np.array([0., 0., 1.])
            x = cua.giro(x, z1, theta)
            x = cua.conv(x, giro)
            x = np.array([x])

            self.pos = np.append(self.pos, x, 0)
            theta = theta + Atheta
Example #10
0
 def plano(self):
     z1 = np.array([0.,0.,1.])
     x1 = np.array([1.,0.,0.])
     x1 = cua.giro(x1,z1,self.parametros[3])
     z1 = cua.giro(z1,x1,self.parametros[2])
     return z1
Example #11
0
def interseccionorbitas(orbita1, orbita2):
    u1 = orbita1.plano()
    u2 = orbita2.plano()
    vector = cross(u1,u2)
    if np.sqrt(vector[0]**2+vector[1]**2+vector[2]**2)< 1e-8: #orbitas coplanarias
        listaang  = []
        listaang2 = []
        
        p1 = orbita1.parametros[0]*(1.-orbita1.parametros[1]**2)
        p2 = orbita2.parametros[0]*(1.-orbita2.parametros[1]**2)
        apo1 = orbita1.parametros[0]*(1.+orbita1.parametros[1])
        apo2 = orbita2.parametros[0]*(1.+orbita2.parametros[1])
        peri1 = orbita1.parametros[0]*(1.-orbita1.parametros[1])
        peri2 = orbita2.parametros[0]*(1.-orbita2.parametros[1])
        r = max(peri1,peri2)
        if apo1<peri2 or apo2 <peri1:
            return [],[]

        theta = 0.
        Atheta = 360./10000
        theta1 = theta-orbita1.parametros[4]
        theta2 = theta-orbita2.parametros[4]
        signo = p1/(1.+orbita1.parametros[1]*np.cos(np.pi*theta1/180.))-p2/(1.+orbita2.parametros[1]*np.cos(np.pi*theta2/180.))

        if orbita1.parametros[1]<1e-8 and orbita2.parametros[1]<1e-8:
            return [],[]

        elif orbita2.parametros[1]<1e-8:
            theta1 = np.arccos(((p1/r)-1.)/orbita1.parametros[1])*180./np.pi
            listaang.append(theta1)
            theta2 = theta1+orbita1.parametros[4]
            listaang2.append(theta2)

        elif orbita1.parametros[1]<1e-8:
            theta2 = np.arccos(((p2/r)-1.)/orbita2.parametros[1])*180./np.pi
            thetasum2 = theta2 + orbita2.parametros[4]
            theta1 = thetasum2 - orbita1.parametros[4]
            listaang.append(theta1)
            listaang2.append(theta2)
            
        while theta<=360.:
            
            theta1 = theta-orbita1.parametros[4]
            theta2 = theta-orbita2.parametros[4]
            r1 = p1/(1.+orbita1.parametros[1]*np.cos(np.pi*theta1/180.))
            r2 = p2/(1.+orbita2.parametros[1]*np.cos(np.pi*theta2/180.))
            if signo*(r1-r2)<=0.:
                listaang.append(theta1)
                listaang2.append(theta2)
            signo = r1-r2
            theta = theta+Atheta

        return listaang, listaang2
    x1 = np.array([1.,0.,0.])
    z1 = np.array([0.,0.,1.])
    x1 = cua.giro(x1,z1,orbita1.parametros[3])

    ang = np.dot(vector,x1)/(modulo(vector)*modulo(x1))
    if ang>= 1.:
        ang=1.
    if ang<=-1:
        ang=-1.
    ang = np.arccos(ang)
    sector = np.arcsin(np.dot(vector,x1))
    ang = ang*180./np.pi
    if sector <0.:
        ang = -ang
    ang = ang-orbita1.parametros[4]
    while ang<0.:
        ang = 360. + ang
    orbitatest = orbita()
    orbitatest.setorbita(orbita1.parametros[0],orbita1.parametros[1],orbita1.parametros[2],orbita1.parametros[3],orbita1.parametros[4],ang)
    posicion1,_ = orbitatest.par2xv()
    en1, ang1 = orbita2.xenorbita(posicion1)
    angcomp = ang+180.
    if ang>360.:
        angcomp = angcomp-360.
    orbitatest.setorbita(orbita1.parametros[0],orbita1.parametros[1],orbita1.parametros[2],orbita1.parametros[3],orbita1.parametros[4],angcomp)
    posicion2,_ = orbitatest.par2xv()
    en2, ang2 = orbita2.xenorbita(posicion2)
    if en1 and en2:
        return [ang,angcomp],[ang1,ang2]
    elif en1:
        return [ang],[ang1]
    elif en2:
        return [angcomp],[ang2]
    else:
        return [],[]
Example #12
0
    def traza(self):
        lat,lon=xtogeo(self.pos[0,:],self.t[0,0])
        lonsub = lon
        latsub = lat
        tiempo=self.t[0,0]
        posicion=self.pos[0,:]
        subsat = geotox(lat,lon,tiempo)        
        z=np.array([0.,0.,1.])
        puntoant=np.array([subsat[0],subsat[1],subsat[2]])
        listapuntos = np.array([puntoant])
        maxlat=0
        maxlon=0

        #Calculo del maximo semiangulo visible en horizontal, para la representacion
        maximolon=0.
        i=0
        while i==0:
                punto=np.array(cua.giro(puntoant,z,0.5))
                maximolon=maximolon+0.5
                vector= posicion-punto
                puntoant=punto
##                if maxlon>=180.:
##                    temp= geotox(lat,180.,tiempo)
##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector,-punto)>0.:
                    i=1
                    
        
        #Se divide el circulo en tres arcos, sentido contrario a las aguajs del reloj
        # De la horizontal hacia el este, hacia arriba
        # De la vertical norte hasta la sur
        # De la vertical sur hasta la norte

        #Primer arco
        while maxlat==0:
            while (maxlon+lonsub)<180.+maximolon:
                punto=np.array(cua.giro(puntoant,z,0.5))
                maxlon=maxlon+0.5
                vector= posicion-punto
                puntoant=punto
##                if maxlon>=180.:
##                    temp= geotox(lat,180.,tiempo)
##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector,-punto)>0.:
                    maxlon=400.
                
                
            
            listapuntos = np.append(listapuntos,np.array([puntoant]),0)
            lat=lat+0.5
            maxlon=0.
            punto=geotox(lat,lonsub,tiempo)            
            vector= posicion-punto
            if cua.productoescalar(vector,-punto)>0.:
                listapuntos=np.append(listapuntos,np.array([puntoant]),0)               
                maxlat=1
            elif lat>90:
                maxlat=1
            puntoant=punto


        maxlat=0
        maxlon=0

        #Segundo arco
        while maxlat==0:
            while maxlon+lonsub>-180.-maximolon:
                punto=np.array(cua.giro(puntoant,z,-0.5))
                maxlon=maxlon-0.5
                vector= posicion-punto
                puntoant=punto
##                if maxlon<=-180.:
##                    temp= geotox(lat,180.,tiempo)
##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector,-punto)>0.:
                    maxlon=-400.
                
                
            
            listapuntos = np.append(listapuntos,np.array([puntoant]),0)
            lat=lat-0.5
            maxlon=0.
            punto=geotox(lat,lon,tiempo)
            
            vector= posicion-punto
            if cua.productoescalar(vector,-punto)>0.:
                listapuntos=np.append(listapuntos,np.array([puntoant]),0)               
                maxlat=1
            elif lat<-90:
                maxlat=1
            puntoant=punto

        
        maxlat=0
        maxlon=0
        listapuntos[0,:]=listapuntos[1,:]

        #Tercer arco
        while maxlat==0:
            while maxlon+lonsub<180.+maximolon:
                punto=np.array(cua.giro(puntoant,z,0.5))
                
                vector= posicion-punto
                maxlon=maxlon+0.5
                puntoant=punto
##                if maxlon>=180.:
##                    temp= geotox(lat,180.,tiempo)
##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector,-punto)>0.:
                    maxlon=400.
                
            
            listapuntos = np.append(listapuntos,np.array([puntoant]),0)
            lat=lat+0.5
            maxlon=0
            punto=geotox(lat,lon,tiempo)
            puntoant=punto
            vector= posicion-punto
            if cua.productoescalar(vector,-punto)>0.:
                listapuntos=np.append(listapuntos,np.array([puntoant]),0)               
                maxlat=1
            elif lat>90:
                maxlat=1
            elif lat-latsub>=0.:
                maxlat=1
            puntoant=punto
            
            
            
        return listapuntos
Example #13
0
 def plano(self):
     z1 = np.array([0., 0., 1.])
     x1 = np.array([1., 0., 0.])
     x1 = cua.giro(x1, z1, self.parametros[3])
     z1 = cua.giro(z1, x1, self.parametros[2])
     return z1
Example #14
0
def interseccionorbitas(orbita1, orbita2):
    u1 = orbita1.plano()
    u2 = orbita2.plano()
    vector = cross(u1, u2)
    if np.sqrt(vector[0]**2 + vector[1]**2 +
               vector[2]**2) < 1e-8:  #orbitas coplanarias
        listaang = []
        listaang2 = []

        p1 = orbita1.parametros[0] * (1. - orbita1.parametros[1]**2)
        p2 = orbita2.parametros[0] * (1. - orbita2.parametros[1]**2)
        apo1 = orbita1.parametros[0] * (1. + orbita1.parametros[1])
        apo2 = orbita2.parametros[0] * (1. + orbita2.parametros[1])
        peri1 = orbita1.parametros[0] * (1. - orbita1.parametros[1])
        peri2 = orbita2.parametros[0] * (1. - orbita2.parametros[1])
        r = max(peri1, peri2)
        if apo1 < peri2 or apo2 < peri1:
            return [], []

        theta = 0.
        Atheta = 360. / 10000
        theta1 = theta - orbita1.parametros[4]
        theta2 = theta - orbita2.parametros[4]
        signo = p1 / (
            1. + orbita1.parametros[1] * np.cos(np.pi * theta1 / 180.)
        ) - p2 / (1. + orbita2.parametros[1] * np.cos(np.pi * theta2 / 180.))

        if orbita1.parametros[1] < 1e-8 and orbita2.parametros[1] < 1e-8:
            return [], []

        elif orbita2.parametros[1] < 1e-8:
            theta1 = np.arccos(
                ((p1 / r) - 1.) / orbita1.parametros[1]) * 180. / np.pi
            listaang.append(theta1)
            theta2 = theta1 + orbita1.parametros[4]
            listaang2.append(theta2)

        elif orbita1.parametros[1] < 1e-8:
            theta2 = np.arccos(
                ((p2 / r) - 1.) / orbita2.parametros[1]) * 180. / np.pi
            thetasum2 = theta2 + orbita2.parametros[4]
            theta1 = thetasum2 - orbita1.parametros[4]
            listaang.append(theta1)
            listaang2.append(theta2)

        while theta <= 360.:

            theta1 = theta - orbita1.parametros[4]
            theta2 = theta - orbita2.parametros[4]
            r1 = p1 / (1. +
                       orbita1.parametros[1] * np.cos(np.pi * theta1 / 180.))
            r2 = p2 / (1. +
                       orbita2.parametros[1] * np.cos(np.pi * theta2 / 180.))
            if signo * (r1 - r2) <= 0.:
                listaang.append(theta1)
                listaang2.append(theta2)
            signo = r1 - r2
            theta = theta + Atheta

        return listaang, listaang2
    x1 = np.array([1., 0., 0.])
    z1 = np.array([0., 0., 1.])
    x1 = cua.giro(x1, z1, orbita1.parametros[3])

    ang = np.dot(vector, x1) / (modulo(vector) * modulo(x1))
    if ang >= 1.:
        ang = 1.
    if ang <= -1:
        ang = -1.
    ang = np.arccos(ang)
    sector = np.arcsin(np.dot(vector, x1))
    ang = ang * 180. / np.pi
    if sector < 0.:
        ang = -ang
    ang = ang - orbita1.parametros[4]
    while ang < 0.:
        ang = 360. + ang
    orbitatest = orbita()
    orbitatest.setorbita(orbita1.parametros[0], orbita1.parametros[1],
                         orbita1.parametros[2], orbita1.parametros[3],
                         orbita1.parametros[4], ang)
    posicion1, _ = orbitatest.par2xv()
    en1, ang1 = orbita2.xenorbita(posicion1)
    angcomp = ang + 180.
    if ang > 360.:
        angcomp = angcomp - 360.
    orbitatest.setorbita(orbita1.parametros[0], orbita1.parametros[1],
                         orbita1.parametros[2], orbita1.parametros[3],
                         orbita1.parametros[4], angcomp)
    posicion2, _ = orbitatest.par2xv()
    en2, ang2 = orbita2.xenorbita(posicion2)
    if en1 and en2:
        return [ang, angcomp], [ang1, ang2]
    elif en1:
        return [ang], [ang1]
    elif en2:
        return [angcomp], [ang2]
    else:
        return [], []
Example #15
0
    def traza(self):
        lat, lon = xtogeo(self.pos[0, :], self.t[0, 0])
        lonsub = lon
        latsub = lat
        tiempo = self.t[0, 0]
        posicion = self.pos[0, :]
        subsat = geotox(lat, lon, tiempo)
        z = np.array([0., 0., 1.])
        puntoant = np.array([subsat[0], subsat[1], subsat[2]])
        listapuntos = np.array([puntoant])
        maxlat = 0
        maxlon = 0

        #Calculo del maximo semiangulo visible en horizontal, para la representacion
        maximolon = 0.
        i = 0
        while i == 0:
            punto = np.array(cua.giro(puntoant, z, 0.5))
            maximolon = maximolon + 0.5
            vector = posicion - punto
            puntoant = punto
            ##                if maxlon>=180.:
            ##                    temp= geotox(lat,180.,tiempo)
            ##                    puntoant=np.array([temp[0],temp[1],temp[2]])
            if cua.productoescalar(vector, -punto) > 0.:
                i = 1

        #Se divide el circulo en tres arcos, sentido contrario a las aguajs del reloj
        # De la horizontal hacia el este, hacia arriba
        # De la vertical norte hasta la sur
        # De la vertical sur hasta la norte

        #Primer arco
        while maxlat == 0:
            while (maxlon + lonsub) < 180. + maximolon:
                punto = np.array(cua.giro(puntoant, z, 0.5))
                maxlon = maxlon + 0.5
                vector = posicion - punto
                puntoant = punto
                ##                if maxlon>=180.:
                ##                    temp= geotox(lat,180.,tiempo)
                ##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector, -punto) > 0.:
                    maxlon = 400.

            listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
            lat = lat + 0.5
            maxlon = 0.
            punto = geotox(lat, lonsub, tiempo)
            vector = posicion - punto
            if cua.productoescalar(vector, -punto) > 0.:
                listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
                maxlat = 1
            elif lat > 90:
                maxlat = 1
            puntoant = punto

        maxlat = 0
        maxlon = 0

        #Segundo arco
        while maxlat == 0:
            while maxlon + lonsub > -180. - maximolon:
                punto = np.array(cua.giro(puntoant, z, -0.5))
                maxlon = maxlon - 0.5
                vector = posicion - punto
                puntoant = punto
                ##                if maxlon<=-180.:
                ##                    temp= geotox(lat,180.,tiempo)
                ##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector, -punto) > 0.:
                    maxlon = -400.

            listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
            lat = lat - 0.5
            maxlon = 0.
            punto = geotox(lat, lon, tiempo)

            vector = posicion - punto
            if cua.productoescalar(vector, -punto) > 0.:
                listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
                maxlat = 1
            elif lat < -90:
                maxlat = 1
            puntoant = punto

        maxlat = 0
        maxlon = 0
        listapuntos[0, :] = listapuntos[1, :]

        #Tercer arco
        while maxlat == 0:
            while maxlon + lonsub < 180. + maximolon:
                punto = np.array(cua.giro(puntoant, z, 0.5))

                vector = posicion - punto
                maxlon = maxlon + 0.5
                puntoant = punto
                ##                if maxlon>=180.:
                ##                    temp= geotox(lat,180.,tiempo)
                ##                    puntoant=np.array([temp[0],temp[1],temp[2]])
                if cua.productoescalar(vector, -punto) > 0.:
                    maxlon = 400.

            listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
            lat = lat + 0.5
            maxlon = 0
            punto = geotox(lat, lon, tiempo)
            puntoant = punto
            vector = posicion - punto
            if cua.productoescalar(vector, -punto) > 0.:
                listapuntos = np.append(listapuntos, np.array([puntoant]), 0)
                maxlat = 1
            elif lat > 90:
                maxlat = 1
            elif lat - latsub >= 0.:
                maxlat = 1
            puntoant = punto

        return listapuntos