pysatellites-2.1.orig/0000755000175000017500000000000012210727147015236 5ustar georgeskgeorgeskpysatellites-2.1.orig/Changelog0000755000175000017500000000406111012562310017040 0ustar georgeskgeorgeskJB : Jean-Baptiste BUTET BG : Bastient GRAVIERE GK : Georges Khaznadar 2008-03-12 : JB, interface graphique. 2008-04-08 : GK, méthode d'intégration, validation avec un champ de gravité terrestre. 2008-04-11 : GK, modification de la fonction verifie_et_traduit afin de faciliter l'entrée d'expressions complètes. Par exemple on peut rentrer 2*3.14*(35786+6400)*1000/24/3600 comme vitesse tangentielle d'un satellite géostationnaire, et on voit bien l'orbite circulaire se construire. 2008-04-11 : GK, calcul de la période de révolution, dans le cas où l'énergie mécanique Em est négative, par la méthode suivante (k=mMG) : - calcul du grand axe : a = - k/2Em - calcul de la période : T = 2pi(a³/k)^0.5 2008-04-12 : GK, mise en place d'une liste d'astres à l'aide de Wikipedia et intégration avec l'application xplanet et les textures de celestia pour tracer l'image de la planète. Changé les appels à print pour tracer le programme en appels valués à self.debug Changement de quelques widgets : combo pour choisir l'astre, renseignements pour le comparer à la Terre. 2008-04-15 : GK, correction de la prise des données de vitesse. Redressé l'axe Oy. Activé les graphiques pour Vx et Vy. Ajouté une fonction d'agrandissement pour les graphiques. 2008-04-20 : GK, correction de problèmes avec le tracé et l'effacement de points de la trajectoire, quelques changements de style, amélioration des graphiques agrandis, implémenté le cas des énergies mécaniques positives. Ajouté le traitement d'options en ligne de commande. Réglé la gestion des chemins d'accès aux répertoires. 2008-04-26 : GK, ajout de support pour créer une vidéo vue du satellite. la vitesse initiale Vx a été réglée négative, pour un lancer vers l'est. Séparation du code de vérification/calcul de nombres flottants.pysatellites-2.1.orig/point.py0000755000175000017500000000362611012562310016737 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * class Point(QLabel): def __init__(self, parent, point, color, numero, app, pred=None,type_de_point="petit"): """ Crée un point graphique. Paramètres : parent : widget parent point : coordonnées (de type vecteur) color : couleur numero : numéro à afficher app : l'application qui commande pred : le point prédecesseur type_de_point : un paramètre de style """ QLabel.__init__(self, parent) self.app=app self.point, self.color = point,color #self.setGeometry(QRect(0,0,640,480)) self.setGeometry(QRect(0,0,parent.width(),parent.height())) self.numero=numero self.type_de_point = type_de_point if type_de_point=="petit" : self.largeur=2 elif type_de_point=="gros" : self.largeur=4 else : self.largeur=2 def icone(self,nom): return self.app.rep.fichier("icones",nom) def paintEvent(self,event): self.painter = QPainter() self.painter.begin(self) self.painter.setPen(QColor(self.color)) self.painter.translate(self.point[0], self.point[1]) if self.type_de_point=="boum" : self.image_sat=QPixmap(self.icone("sat_mini_boum.png")) self.painter.drawPixmap(0,0,self.image_sat) elif self.type_de_point=="gros" : self.image_sat=QPixmap(self.icone("sat_mini.png")) self.painter.drawPixmap(0,0,self.image_sat) self.painter.drawLine(-self.largeur,0,self.largeur,0) self.painter.drawLine(0,-self.largeur,0,self.largeur) elif self.type_de_point=="petit" : self.painter.drawLine(-self.largeur,0,self.largeur,0) self.painter.drawLine(0,-self.largeur,0,self.largeur) self.painter.end() pysatellites-2.1.orig/debug.py0000755000175000017500000000031311773533262016704 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- class Debug: def __init__(self, debugLevel): self.debugLevel=debugLevel def __call__(self,level,msg): if self.debugLevel > level: print(msg) pysatellites-2.1.orig/graphe.ui0000755000175000017500000000317611012562310017041 0ustar georgeskgeorgesk Graphe 0 0 302 516 Dialog 110 480 81 32 Qt::Horizontal QDialogButtonBox::Close 10 10 270 450 buttonBox accepted() Graphe accept() 248 254 157 274 buttonBox rejected() Graphe reject() 316 260 286 274 pysatellites-2.1.orig/pysatellites.10000755000175000017500000000304111012570610020031 0ustar georgeskgeorgesk.\" Title: PYSATELLITES .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 .\" Date: mai 14, 2008 .\" Manual: .\" Source: .\" .TH "PYSATELLITES" "1" "mai 14, 2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" pysatellites - simulates the launching of satellites .SH "SYNOPSIS" .HP 13 \fBpysatellites\fR [\fB\-d\ \fR\fB\fIdebuglevel\fR\fR] [\fB\-\-debug=\fR\fB\fIdebuglevel\fR\fR] [\fB\-f\ \fR\fB\fIfile\fR\fR] [\fB\-\-fichier=\fR\fB\fIfile\fR\fR] [\fB\-h\ \fR] [\fB\-\-help\fR] .SH "DESCRIPTION" .PP This program can be used to train people to spatial mechanics at an elementary level\. You are given the power to launch a satellite, from outside the atmosphere, around a handfull of predefined planets, or around any special object you may imagine\. Input the intial velocity vector of the satellite, and you will get the simulated trajectory, as well as some informations like the plots of variation of speed\. As an extra, you can compute a movie, which represents the planet seen from the satellite\'s point of view during its orbital period\. .SH "OPTIONS" .PP \fB\-h\fR \fB\-\-help\fR .RS 4 Show a short usage description\. .RE .PP \fB\-d \fR\fB\fIdebuglevel\fR\fR \fB\-\-debug=\fR\fB\fIdebuglevel\fR\fR .RS 4 Sets the debug level, from 0 to 10 (default = 0)\. .RE .PP \fB\-f \fR\fB\fIfile\fR\fR \fB\-\-fichier=\fR\fB\fIfile\fR\fR .RS 4 Sets the configuration file (default: none) .RE .SH "COPYRIGHT" Copyright \(co 2008 Georges Khaznadar .br pysatellites-2.1.orig/Makefile0000755000175000017500000000144311535222055016700 0ustar georgeskgeorgeskDESTDIR = CELESTIA_TEXTURES = /usr/share/celestia/textures/lores \ /usr/share/celestia/textures/medres \ /usr/share/celestia/textures/hires all: user-interface pysatellites.1 pysatellites.1: manpage.xml xsltproc --nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl manpage.xml clean: rm -f *~ *.pyc rm -f UI_* rm -rf build user-interface: UI_pysat.py UI_graphe.py UI_%.py: %.ui pyuic4 $< -o $@ install: all python setup.py install --root=$(DESTDIR) install -m 755 pysatellites $(DESTDIR)/usr/bin install-textures: mkdir -p $(DESTDIR)/usr/share/pysatellites/images for d in $(CELESTIA_TEXTURES); do \ cp $$d/* $(DESTDIR)/usr/share/pysatellites/images; \ done .PHONY = user-interface install clean install-textures all install-for-debian pysatellites-2.1.orig/pysatellites0000755000175000017500000000007311012566600017700 0ustar georgeskgeorgesk#!/usr/bin/python import pysatellites pysatellites.run() pysatellites-2.1.orig/manpage.xml0000755000175000017500000001024311012570572017370 0ustar georgeskgeorgesk .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry in a Makefile or Makefile.am is: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ manpages/docbook.xsl XP=xsltproc -''-nonet manpage.1: manpage.dbk $(XP) $(DB2MAN) $< The xsltproc binary is found in the xsltproc package. The XSL files are in docbook-xsl. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include xsltproc and docbook-xsl in your Build-Depends control field. --> Georges"> Khaznadar"> mai 14, 2008"> 1"> georgesk@ofset.org"> PYSATELLITES"> Debian"> GNU"> GPL"> ]>
&dhemail;
2008 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; simulates the launching of satellites &dhpackage; DESCRIPTION This program can be used to train people to spatial mechanics at an elementary level. You are given the power to launch a satellite, from outside the atmosphere, around a handfull of predefined planets, or around any special object you may imagine. Input the intial velocity vector of the satellite, and you will get the simulated trajectory, as well as some informations like the plots of variation of speed. As an extra, you can compute a movie, which represents the planet seen from the satellite's point of view during its orbital period. OPTIONS Show a short usage description. Sets the debug level, from 0 to 10 (default = 0). Sets the configuration file (default: none)
pysatellites-2.1.orig/.svn/0000755000175000017500000000000011012562310016106 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/text-base/0000755000175000017500000000000011012562310020002 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/text-base/mainWindow.py.svn-base0000444000175000017500000002074111012562310024207 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- """ code pour la fenêtre principale de pysatellites """ licence=""" the file mainWindow.py is part of the package pysatellites. Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ import sys, os from PyQt4.QtCore import * from PyQt4.QtGui import * from glob import glob from UI_pysat import Ui_MainWindow from traj_satellite import Trajectoire from math import pi, cos, sin, fabs from astres import astreNom from point import Point from matplotlib_widget import MyMplCanvas from repertoire import repertoire from video import Cinema import flottant from debug import Debug class StartQT4(QMainWindow): def __init__(self, parent, rep=None , debugger=Debug(0), app=None): QMainWindow.__init__(self) QWidget.__init__(self, parent) self.debug=debugger self.app=app self.ui = Ui_MainWindow() self.ui.setupUi(self) if rep == None: self.rep=repertoire(sys.argv[0]) else: self.rep=rep self.trajectoire = Trajectoire(self.ui.afficheur, 6400, self, debugger=self.debug) self.initAstres() self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) os.chdir(self.rep.chemin("defaut")) self.image_sat=QPixmap("icones/sat_mini.gif") self.connexions_signaux() self.placeDepart() self.cinemaThread=None self.progress=None def getRayonAstre(self): return flottant.traduit(self.ui.rayon_astre.text())*1000 def placeDepart(self): self.trajectoire.efface() x=0 y=(flottant.traduit(self.ui.rayon_astre.text())+flottant.traduit(self.ui.altitude_objet.text()))*1000 self.trajectoire.setEchelle(y,"max") vx=flottant.traduit(self.ui.vitesse_tangentielle_objet.text()) vy=flottant.traduit(self.ui.vitesse_normale_objet.text()) self.trajectoire.dessine([(x,y,0,vx,vy,0)]) self.trajectoire.update() def initAstres(self): for a in astreNom: self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.astreCourant="earth" self.choisi_astre(0) def connexions_signaux(self): QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.trajectoire.lance) QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) QObject.connect(self.ui.bouton_video,SIGNAL("clicked()"), self.cinema) QObject.connect(self.ui.altitude_objet,SIGNAL("editingFinished()"), self.placeDepart) QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) QObject.connect(self.ui.radioButton_Frenet,SIGNAL("toggled(bool)"), self.choisi_coordoonees) #QObject.connect(self.ui.checkBox_efface,SIGNAL("stateChanged(bool)"), self.change_comportement_effacege) timer = QTimer(self); QObject.connect(timer, SIGNAL("timeout()"), self.routines); timer.start(1000); self.ui.mTerre.setReadOnly (True) self.ui.rTerre.setReadOnly (True) self.ui.auSujetAstre.setReadOnly (True) def change_comportement_effacege(self,int): pass def efface_trajectoire(self): self.trajectoire.efface() self.placeDepart() def cinema(self): if self.cinemaThread!=None and self.cinemaThread.isAlive(): return import datetime,copy from numpy import arange date=datetime.datetime(2008,04,25) date=date.today() if self.trajectoire.traj != None: liste_temps=arange(0,self.trajectoire.t,self.trajectoire.dt) pas=10 # une image pour 10 calculs numériques titre=QApplication.translate("MainWindow", "Calcul de la vidéo", None, QApplication.UnicodeUTF8) legende=QApplication.translate("MainWindow", "Avancement ...", None, QApplication.UnicodeUTF8) echap=QApplication.translate("MainWindow", "Arrêt", None, QApplication.UnicodeUTF8) self.progress=QProgressDialog(legende,echap,0,len(liste_temps)/pas) self.progress.setWindowTitle(titre) self.progress.setValue(0) self.progress.show() # on lance le thread avec une copie de la liste calculée self.cinemaThread=Cinema(self.rep, self.astreCourant, date, liste_temps, copy.copy(self.trajectoire.traj.pv), "380x240", pas=pas, boum=self.trajectoire.boum, debugger=self.debug) self.cinemaThread.start() def routines(self): if self.cinemaThread!=None and self.cinemaThread.isAlive(): self.progress.setValue(self.cinemaThread.nbImage) if self.progress.wasCanceled(): self.progress.close() self.cinemaThread.fini=True if self.cinemaThread.fini: self.progress.setValue(self.progress.maximum()+1) if self.progress: self.progress.close() def getMasseAstre(self): return flottant.traduit(self.ui.masse_astre.text()) def getDistanceAstre(self): return (flottant.traduit(self.ui.rayon_astre.text()) + flottant.traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres def getVitesse(self): return (flottant.traduit(self.ui.vitesse_tangentielle_objet.text()), flottant.traduit(self.ui.vitesse_normale_objet.text())) def choisi_coordoonees(self,bool): if self.ui.radioButton_Cartesiennes.isChecked()==True : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse selon Ox", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse selon Oy", None, QApplication.UnicodeUTF8)) elif self.ui.radioButton_Cartesiennes.isChecked()==False : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse Tangentielle", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse Normale", None, QApplication.UnicodeUTF8)) def choisi_astre(self,int): mt0=astreNom[0][2] rt0=astreNom[0][3] astre=self.ui.astreCombo.currentText() for a in astreNom: if a[0]==astre: self.trajectoire.choisi_astre(a[1]) self.astreCourant=a[1] masse_astre=a[2] rayon_astre=a[3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) mt=flottant.traduit(masse_astre)/flottant.traduit(mt0) rt=flottant.traduit(rayon_astre)/flottant.traduit(rt0) mt="%5g" %mt rt="%5g" %rt self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) self.placeDepart() self.trajectoire.update() return self.debug(0,u"Astre inconnu : %s" %astre) pysatellites-2.1.orig/.svn/text-base/repertoire.py.svn-base0000444000175000017500000000175611012562310024260 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- import os.path class repertoire: def __init__(self, chemin): self.chemin0=os.path.abspath(chemin) if os.path.isfile(self.chemin0): self.chemin0=os.path.dirname(self.chemin0) def chemin(self,choix="defaut"): if choix=="defaut": return self.chemin0 if choix=="textures": for d in [os.path.join(self.chemin0,"images"), "/usr/share/celestia/textures/medres"]: if os.path.exists(d+'/moon.jpg'): return d print "erreur : pas de répertoire des planètes" print "=== Il faudrait installer Celestia ===" raise(IOError) elif os.path.isdir(os.path.join(self.chemin0,choix)): return os.path.join(self.chemin0,choix) else: raise(IOError) def fichier(self,*elementsDeChemin): f=self.chemin0 for e in elementsDeChemin: f=os.path.join(f,e) return f pysatellites-2.1.orig/.svn/text-base/video.py.svn-base0000444000175000017500000000654511012562310023207 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- """ video.py est un module permettant de faire un fichier video à partir d'un tableau de positions-vitesses tel que pysatellite peut le réaliser. """ import math, datetime, tempfile, os.path, os from astres import Astre from PyQt4.QtGui import * from threading import * from debug import Debug import flottant class Cinema(Thread): def __init__(self,repertoire, astre, dateorigine, liste_temps, liste_pos, geometrie, pas=1, nettoie=True, boum=-1.0, debugger=Debug(0)): Thread.__init__(self) self.repertoire=repertoire self.astre=astre self.dateorigine=dateorigine self.liste_temps=liste_temps self.liste_pos=liste_pos self.geometrie=geometrie self.pas=pas self.nettoie=nettoie self.boum=boum self.dir=tempfile.mkdtemp("","pysat") self.fini=False self.nbImage=0 self.debug=debugger def run(self): self.video() os.system("vlc --loop %s > /dev/null 2>&1" %os.path.join(self.dir,"out.avi")) if self.nettoie: os.system("rm -r %s" %self.dir) def video(self): self.images() cmd="ffmpeg -r 25 -f image2 -i %s -r 25 -f avi -vcodec mpeg1video -b 800k %s > /dev/null 2>&1" %(os.path.join(self.dir, "%04d.jpg"), os.path.join(self.dir, "out.avi")) os.system(cmd) def images(self): listenum= range(0, len(self.liste_temps), self.pas) for i in listenum: if self.fini: return temps=self.liste_temps[i] if self.boum > 0 and temps > self.boum: self.imageCrash(self.nbImage) self.fini=True return x=self.liste_pos[i][0] y=self.liste_pos[i][1] z=self.liste_pos[i][2] cmd=self.xplanetCmd(temps, x, y, z, os.path.join(self.dir, "%04d.jpg" %self.nbImage)) os.system(cmd) self.nbImage+=1 def imageCrash(self,num): for n in range(20): nomfichier=os.path.join(self.dir, "%04d.jpg" %(num+n)) (w,h)=self.geometrie.split("x") img=QImage(int(w), int(h), QImage.Format_RGB32) img.fill(QColor("red").rgb()) img.save(nomfichier) def xplanetCmd(self,temps, x, y, z, nomfichier): """ dateorigine est un objet datetime fixe, temps est une durée en seconde """ a=Astre(self.astre) td=datetime.timedelta(seconds=temps) date=self.dateorigine+td dateXplanet=date.strftime("%Y%m%d.%H%M%S") rayon=1.0*(x**2+y**2+z**2)**0.5 range=rayon/a.rayon if range > 1.0: radius=100*math.asin(1.0/range) else: radius=9000 longitude0=360.0*temps/(24*3600*flottant.traduit(a.rotationSiderale)) longitude=180/math.pi*math.atan2(y,x)-90 latitude=180/math.pi*math.atan2(z,(x**2+y**2)**0.5) cmd="xplanet -date %s -radius %s -num_times 1 -output '%s' -geometry %s -origin %s -range %s -longitude %s -latitude %s -starmap BSC -searchdir %s -body %s -label >/dev/null 2>&1" %(dateXplanet, radius, nomfichier, self.geometrie, self.astre, range, int(a.flip)*(longitude-longitude0), latitude, self.repertoire.chemin("textures"), self.astre) self.debug(4,u"Lancemende de «%s»" %cmd) return cmd pysatellites-2.1.orig/.svn/text-base/point.py.svn-base0000444000175000017500000000362611012562310023227 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * class Point(QLabel): def __init__(self, parent, point, color, numero, app, pred=None,type_de_point="petit"): """ Crée un point graphique. Paramètres : parent : widget parent point : coordonnées (de type vecteur) color : couleur numero : numéro à afficher app : l'application qui commande pred : le point prédecesseur type_de_point : un paramètre de style """ QLabel.__init__(self, parent) self.app=app self.point, self.color = point,color #self.setGeometry(QRect(0,0,640,480)) self.setGeometry(QRect(0,0,parent.width(),parent.height())) self.numero=numero self.type_de_point = type_de_point if type_de_point=="petit" : self.largeur=2 elif type_de_point=="gros" : self.largeur=4 else : self.largeur=2 def icone(self,nom): return self.app.rep.fichier("icones",nom) def paintEvent(self,event): self.painter = QPainter() self.painter.begin(self) self.painter.setPen(QColor(self.color)) self.painter.translate(self.point[0], self.point[1]) if self.type_de_point=="boum" : self.image_sat=QPixmap(self.icone("sat_mini_boum.png")) self.painter.drawPixmap(0,0,self.image_sat) elif self.type_de_point=="gros" : self.image_sat=QPixmap(self.icone("sat_mini.png")) self.painter.drawPixmap(0,0,self.image_sat) self.painter.drawLine(-self.largeur,0,self.largeur,0) self.painter.drawLine(0,-self.largeur,0,self.largeur) elif self.type_de_point=="petit" : self.painter.drawLine(-self.largeur,0,self.largeur,0) self.painter.drawLine(0,-self.largeur,0,self.largeur) self.painter.end() pysatellites-2.1.orig/.svn/text-base/AUTHORS.svn-base0000444000175000017500000000015711012562310022570 0ustar georgeskgeorgeskJean-Baptiste BUTET Bastien Georges Khaznadar pysatellites-2.1.orig/.svn/text-base/astres.py.svn-base0000444000175000017500000000661311012562310023376 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- """La plupart de ces données ont été adaptées à partir de la version anglaise de Wikipedia : http://en.wikipedia.org """ from flottant import traduit astreNom=[ # nom_local, nom_celestia, masse_kg, rayon_km, commentaire, jour, flipped # flipped fait référence à une propréiété dans le fichier Planet.cpp # de src/libplanet du logiciel xplanet. ["Terre","earth","6x10^24","6400","Planète du système solaire","1","1"], ["Soleil","sun","6x10^31","695000","Étoile du système solaire","26","1"], ["Lune","moon","7.33x10^22","1740","Lune de Terre","27.3216","1"], ["Amalthée","amalthea","2.08x10^18","83.5","Lune de Jupiter","0.49817943","-1"], ["Callisto","callisto","1.076x10^23 ","2410","Lune de Jupiter","16.6890184","-1"], ["Deimos","deimos","1.48x10^15","6.2","Lune de Mars","1.26244","-1"], ["Dione","dione","1.1x10^21","561","Lune de Saturne","2.736915","-1"], ["Encelade","enceladus","1.08x10^20","252","Lune de Saturne","1.370218","-1"], ["Épiméthée","epimetheus","57","5.3x10^17","Lune de Saturne","0.694333517","-1"], ["Europe","europa","4.80x10^22","1569","Lune de Jupiter","3.551181","-1"], ["Ganymède","ganymede","1.4819x10^23","2634","Lune de Jupiter","7.15455296","-1"], ["Hyperion","hyperion","0.558x10^19","280","Lune de Saturne","21.27661","-1"], ["Iapète","iapetus","1.80x10^21","1450","Lune de Saturne","79.3215","-1"], ["Io","io","8.9319x10^22","1821.3","Lune de Jupiter","1.769137786","-1"], ["Janus","janus","1.91x10^18","173","Lune de Saturne","0.694660342","-1"], ["Jupiter","jupiter","1.90x10^27 ","70x10^3","Planète du système solaire","9.925/24","-1"], ["Mars","mars","6.4185x10^23","3390","Planète du système solaire","1.025957","-1"], ["Mercure","mercury","3.3022x10^23","2440","Planète du système solaire","58.646","-1"], ["Mimas","mimas","3.7493x10^19","390","Lune de Saturne","0.9424218 ","-1"], ["Miranda","miranda","6.59x10^19","470","Lune d'Uranus","1.413479","1"], ["Neptune","neptune","1.0243x10^26","24750","Planète du système solaire","0.6713","-1"], ["Obéron","oberon","3.014x10^21","761.4","Lune d'Uranus","13.463234","1"], ["Phobos","phobos","1.07x10^16","11.1","Lune de Mars","0.318 910 23","-1"], ["Pluton","pluto-lok","1.30x10^22","1195","Planète du système solaire","-6.387230","1"], ["Prométhée","prometheus","1.566x10^17","100","Lune de Saturne","0.612990038","-1"], ["Protée","proteus","4.4x10^19","410","Lune de Neptune","1.12231477","-1"], ["Rhéa","rhea","2.3065x10^21","1525","Lune de Saturne","4.518212","-1"], ["Saturne","saturn","5.6846x10^26","60x10^3","Planète du système solaire","0.445","-1"], ["Tethys","tethys","6.174x10^20","1060","Lune de Saturne","1.887802","-1"], ["Titan","titan","1.345x10^23","2576","Lune de Saturne","15.945","-1"], ["Triton","triton","2.14x10^22","1353","Lune de Neptune","-5.877","-1"], ["Umbriel","umbriel","1.2x10^21","1169","Lune d'Uranus","4.144","1"], ["Vénus","venus","4.8685x10^24","6051","Planète du système solaire","-243.0185","1"] ] class Astre: def __init__(self,cle): for a in astreNom: if a[1]==cle: break self.nom=a[0] self.cle=cle self.masse=traduit(a[2]) self.rayon=1000*traduit(a[3]) self.commentaire=a[4] self.rotationSiderale=a[5] #unité jour self.flip=a[6] pysatellites-2.1.orig/.svn/text-base/flottant.py.svn-base0000444000175000017500000000235111012562310023723 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- def traduit(chaine): """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" # on force le type chaîne pour pouvoir faire des évaluations. chaine=str(chaine).replace(" ","") # et retrait de tous les espaces #vérification de la présence d'un float correct, sinon tente des modifs. try : chaine=float(eval(chaine)) except : chaine=chaine.replace("10^","e") #remplace la chaine 10^ par e else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "x" pour la multiplication chaine=chaine.replace("x","*") chaine=chaine.replace("X","*") else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "*" devant un "e" chaine=chaine.replace("*e","e") else: return chaine try : chaine=float(eval(chaine)) except : #self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) return 1.0 else: return chaine return 1.0 pysatellites-2.1.orig/.svn/text-base/LISEZMOI.svn-base0000444000175000017500000000200511012562310022670 0ustar georgeskgeorgeskLe logiciel pysatellites permet de simuler le lancement d'un satellite autour de nombreux astres connus. C'est un logiciel libre, diffusé sous la licence GPL version 3. Voyez les fichiers COPYING Changelog et AUTHORS Pour être pleinement fonctionnel, il est préférable d'installer en même temps les logiciels libres xplanet et la base de données du logiciel celestia ;) de toute façon, une personne intéressée par pysatellites sera très probablement aussi intéressée par xplanet et celestia, pour de nombreux usages complémentaires. Certaines formules sont utilisées pour faciliter la simulation : - la méthode d'intégration de Runge-Kutta qui est d'ordre 4, beaucoup pkus efficace que al méthode d'Euler - un calcul des paramètres de la trajectoire à partir des données connues dès le lancement : énergie mécanique, grand axe, excentricité, période, etc. Le fondement théorique des méthodes emplyées est décrit dans le fichier methodes.tm, qui s'ouvre à l'aide du logiciel libre TexMacs. pysatellites-2.1.orig/.svn/text-base/methodes.tm.svn-base0000444000175000017500000001434311012562310023674 0ustar georgeskgeorgesk <\body> ||>> Le logiciel pysatellites sert simuler le lancement de satellites autour de diverses plantes. En France, ce logiciel est utilis dans l'enseignement au niveau du lyce. L'lve est invit choisir une plante, ou prciser les paramtres de rayon et de masse qu'il veut, puis il contrle le point de lancment d'un satellite, sa vitesse radiale et sa vitesse orthoradiale. Quand ce choix est fini, il lance la simulation et voit quelle trajectoire le satellite peut alors suivre. La mthode est une mthode de calcul de proche en proche : des intervalles de temps rguliers, la vitesse et la position du satellite connues sont utilises afin de prdire sa position et sa vitesse un intervalle de temps plus tard. On parle d'intgration numrique, car seule la loi locale qui donne la force d'attraction applique au satellite est prise en considration. Un autre mthode serait possible : dans le cas d'un problme un corps plong dans un potentiel newtonien, les quations de la dynamique du satellite admettent des solutions algbriques que l'on sait dterminer. J'ai utilis un document synthtique publi sur Internet, l'adresse\ Ce document rsume ce qu'on peut retenir comme proprit des coniques (ellipses, parabole, hyperboles), et la solution connue du problme un corps dans un potentiel newtonien. On peut l'utiliser pour calculer sans avoir terminer la simulation divers paramtres. L'un d'entre eux est trs important, il s'agit de la priode du mouvement quand l'nergie mcanique > du satellite est ngative, et que celui-ci dcrit une ellipse dans le puits de potentiel de l'astre qui l'attire. On connat la distance du satellite l'astre de masse . On en dduit facilement son nergie potentielle massique, /m=->, o u.s.i.> est la constante universelle de gravitation. Connaissant sa vitesse radiale >|\>> et sa vitesse orthoradiale |\>>, on dduit son nergie cintique massique, /m=>>^2>+(|\>>>)>. Il suffit d'aditionner les nergies pour parvenir l'nergie mcanique massique, /m=-+>>^2>+(|\>>>)>. Plusieurs cas se prsentent alors : <\enumerate-numeric> /m \ 0> : le satellite reste dans le puits de potentiel de l'astre, sa trajectoire est une ellipse, qu'il parcourt avec une priode . /m = 0> : le satellite n'est pas li, il possde tout juste la vitesse de libration, sa trajectoire est une parabole, sa vitesse s'annule l'infini. /m \ 0> : le satellite n'est pas li, sa vitesse l'infini est non nulle, sa trajectoire est hyperbolique. Dans le premier cas seulement, une priode existe pour le mouvement du satellite, et on la calcule ainsi : le grand axe de l'ellipse se dduit de la constante d'attraction ( par la formule +>>^2>+(|\>>>))>>. Connaissant le grand axe de l'ellipse, on peut alors dterminer la priode du mouvement grce la troisime loi de Kepler, =4\/MG*a>, soit >|>>. Quand la priode du mouvement est connue, on peut prendre comme ordre de grandeur de l'intervalle de temps pour l'intgration, un centime de cette priode. a donne des rsultats satisfaisants pour les mouvement d'excentricit faible : c'est dire que la trajectoire apparat facilement comme ferme l'cran, au pixel prs. Dans le cas d'ellipses fortement excentriques, il faut diminuer le l'intervalle de temps utilis pour l'intgration. <\initial> <\collection> <\references> <\collection> > > > > <\auxiliary> <\collection> <\associate|toc> |math-font-series||1Utilit du logiciel \S pysatellites \T> |.>>>>|> |math-font-series||2Mthode utilise pour la simulation> |.>>>>|> |math-font-series||3La mthode d'intgration de Runge-Kutta> |.>>>>|> |math-font-series||4Dtermination de la priode d'un mouvement elliptique> |.>>>>|> pysatellites-2.1.orig/.svn/text-base/traj_satellite.py.svn-base0000444000175000017500000003711611012562310025105 0ustar georgeskgeorgesk#! /usr/bin/python # -*- coding: utf-8 -*- # Résolution numérique d'un problème à un corps soumis à un # potentiel newtonien (en 1/r^2) # d'équa. diff. vec{r}'' = -k/m vec{r}/r^3 # le vecteur de données considéré sera le vecteur (x, y , vx, vy) # dont la dérivée est (vx, vy, -k/m*x/(x^2+y^2)^3/2, -k/m*y/(x^2+y^2)^3/2) from numpy import * from pylab import * from PyQt4.QtCore import * from PyQt4.QtGui import * from point import Point import os, tempfile, time from matplotlib_widget import MyMplCanvas import flottant from rectangle_sensible import Rs from debug import Debug def rk4(derivs, y0, t): """ C'est le code de rk4 pris dans le module matplotplib. Liste des paramètres d'entrée derivs : une fonction qui accepte en entrée un 6-uplet position,vitesse et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. y0 : un 6-uplet représentant la position et la vitesse initiales t : une liste de dates régulièrement espacées pour lesquelles on veut construire les points et vitessesde la trajectoire Résultat de la fonction : une liste de 6-uplets représentant les positions et vitesses aux instants de la liste des dates données. """ Float=0.0 try: Ny = len(y0) except TypeError: yout = zeros( (len(t),), float) else: yout = zeros( (len(t), Ny), float) yout[0] = y0 i = 0 for i in arange(len(t)-1): thist = t[i] dt = t[i+1] - thist dt2 = dt/2.0 y0 = yout[i] k1 = asarray(derivs(y0, thist)) k2 = asarray(derivs(y0 + dt2*k1, thist+dt2)) k3 = asarray(derivs(y0 + dt2*k2, thist+dt2)) k4 = asarray(derivs(y0 + dt*k3, thist+dt)) yout[i+1] = y0 + dt/6.0*(k1 + 2*k2 + 2*k3 + k4) return yout def euler(derivs, y0, t): """ C'est le code de la méthode d'Euler, qui est d'ordre 1 et très simple. Liste des paramètres d'entrée derivs : une fonction qui accepte en entrée un 6-uplet position,vitesse et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. y0 : un 6-uplet représentant la position et la vitesse initiales t : une liste de dates régulièrement espacées pour lesquelles on veut construire les points et vitessesde la trajectoire Résultat de la fonction : une liste de 6-uplets représentant les positions et vitesses aux instants de la liste des dates données. """ try: Ny = len(y0) except TypeError: yout = zeros( (len(t),), Float) else: yout = zeros( (len(t), Ny), Float) yout[0] = y0 i = 0 for i in arange(len(t)-1): thist = t[i] dt = t[i+1] - thist y0 = yout[i] k1 = asarray(derivs(y0, thist)) yout[i+1] = y0 + dt*k1 return yout def nouvChampGrav(x0,m): """Cette fonction renvoie une fonction anonyme représentant un champ gravitationnel créé par un objet de masse m immobile aux coordonnées spécifiées par x0. le profil de la fonction résultat est : (vecteur position -> vecteur accélération) """ return lambda x: (-6.67e-11*m*(x[0]-x0[0])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, -6.67e-11*m*(x[1]-x0[1])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, -6.67e-11*m*(x[2]-x0[2])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**(1.5)) class trajectoire(QObject): def __init__(self,dt,t,y0, champ): """Les paramètres sont : dt : intervalle de temps t : durée totale de la simulation y0 : vecteur à 6 composantes (position, vitesse initiales) champ : une fonction donnant l'accélération à partir de la position """ QObject.__init__(self) self.dt = dt self.t = arange(0,t,self.dt) self.y0 = y0 self.champ=champ self.calcul() def dessine(self): x=[] y=[] for point in self.pv : x.append(point[0]) y.append(point[1]) self.x = x self.y = y plot(self.x,self.y) # le dessin est en projection dans le plan x,y axis('equal') show() def derivs(self,x,t): """calcul de la dérivée du vecteur à 6 composantes position,vitesse """ g = self.champ(x[0:3]) # le champ de gravité return (x[3], # vitesse x x[4], # vitesse y x[5], # vitesse z g[0], # acceleration x g[1], # acceleration y g[2]) # acceleration z def calcul(self): """lance le calcul de la trajectoire à l'aide de l'algorithme de Runge-Kutta qui est d'ordre 4 et rapide en même temps. le résultat est dans self.pv, qui est une liste contenant les 6-uplets position, vitesse. """ self.pv = rk4(self.derivs, self.y0, self.t) def calculeNorme(nuplet): s=0 for x in nuplet: s+=x**2 return s**0.5 def projection(n): if n >=0: return lambda nuplet:nuplet[n] else: return 0.0 class Trajectoire(Rs): def __init__(self, parent, rayon_astre, mainWin, debugger=Debug(0)): Rs.__init__(self, parent, debugger=debugger) self.parent = parent self.mainWin=mainWin self.milieuX=self.width()/2 self.milieuY=self.height()/2 self.rep= mainWin.rep #self.setFrameShape(QFrame.Box) self.setEchelle(6.4e6/25) self.points={} self.planetes={} self.vitesse=[] self.date=[] self.dt=1 self.widget_vit_norm=None self.widget_vitx=None self.widget_vity=None self.boum=-1.0 self.traj=None def setEchelle(self,val, mode="mppx"): """ Régle l'échelle, selon le mode choisi. mode=mppx : échelle en mètre par pixel mode=max : l'échelle sera ajustée pour que le point (0,val) soit dans la fenêtre de trajectoire (à 95% du maximum) """ if mode=="mppx": self.echelle=val self.debug(9,u"Échelle %s px/m (mode direct)" %self.echelle) elif mode=="max": self.echelle=val/self.milieuY/0.95 self.debug(9,u"%s m pour %s px" %(val,self.milieuY)) self.debug(9,u"Échelle %s px/m (mode max)" %self.echelle) else: self.debug(0,u"Le mode %s ne convient pas pour setEchelle()" %mode) def lance(self): self.calcul_parametre() if self.mainWin.ui.checkBox_efface.isChecked() : self.efface() self.debug(10,u"efface la trajectoire depuis un lancé") a=time.time() self.traj= trajectoire(self.dt, self.t, self.pos+self.vit, self.gAstre) self.debug(8, u"%s, %s, %s, %s" %(self.dt, self.t, self.pos+self.vit, self.gAstre)) self.debug(5,u"calcul en %s secondes" %(time.time()-a)) self.dessine_trajectoire() #dessine les vitesses self.grapheV() def grapheV(self): if self.widget_vit_norm != None: self.widget_vit_norm.hide() if self.widget_vitx != None: self.widget_vitx.hide() if self.widget_vity != None: self.widget_vity.hide() self.widget_vit_norme = MyMplCanvas(self.mainWin.ui.label_vit_norm,self.vitesse, calculeNorme, self.date, width=3, height=5, dpi=30, cliquable=True, titre="Norme de la vitesse") self.widget_vitx = MyMplCanvas(self.mainWin.ui.label_vitx,self.vitesse, projection(0), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Abscisse de la vitesse") self.widget_vity = MyMplCanvas(self.mainWin.ui.label_vity,self.vitesse, projection(1), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Ordonnée de la vitesse") self.widget_vit_norme.show() self.widget_vitx.show() self.widget_vity.show() def calcul_parametre(self): self.masse_astre = self.mainWin.getMasseAstre() self.distance_astre = self.mainWin.getDistanceAstre() self.vitesse_x,self.vitesse_y = self.mainWin.getVitesse() self.G=6.67259e-11 #calcul des énergies massiques (cinétique, potentielle, mécanique) Ec_massique=0.5*(self.vitesse_x**2+self.vitesse_y**2) Ep_massique=-self.masse_astre*self.G/self.distance_astre Em_massique=Ec_massique+Ep_massique if Em_massique >= 0: self.debug(1,u"L'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pas" %Em_massique) t=QApplication.translate("MainWindow", "Ce n'est pas un satellite", None, QApplication.UnicodeUTF8) q=QApplication.translate("MainWindow", "L'énergie mécanique initiale est positive, l'objet lancé échappera à l'attraction de l'astre. Voulez-vous tracer une partie de la trajectoire ?", None, QApplication.UnicodeUTF8) ret=QMessageBox.question (self, t, q, 1, 2) if ret==1: self.t=30*(self.distance_astre**3/self.masse_astre/self.G)**0.5 self.dt=self.t/100 else: raise(ValueError) else: # calcul du grand axe a : Em = -k/2a pour une trajectoire elliptique # donc a = -k/2Em a = - self.masse_astre*self.G/2/Em_massique # calcul de la période, en utilisant la troisième loi de Kepler # T²=4pi²/MG*a³ self.t = 2*pi*(a**3/self.masse_astre/self.G)**0.5 self.dt = self.t/1000 self.debug(5,u"masse astre %s" %self.masse_astre) self.gAstre = nouvChampGrav((0,0,0),self.masse_astre) self.pos = (0.0, self.distance_astre, 0) self.vit = (self.vitesse_x,self.vitesse_y,0.0) def dessine_trajectoire(self): self.debug(9,u"dessine la trajectoire") self.dessine(self.traj.pv) # on teste si toute la trajectoire tien bien là. r=self.maxDistance(self.traj.pv) if not self.surementVisible(r) and not self.boum > 0: t=QApplication.translate("MainWindow", "Changement d'échelle", None, QApplication.UnicodeUTF8) q=QApplication.translate("MainWindow", "Un dépassement a été détecté. Voulez-vous changer d'échelle ?", None, QApplication.UnicodeUTF8) ret=QMessageBox.question (self, t, q, 1, 2) if ret==1: self.setEchelle(r,"max") self.efface() self.dessine(self.traj.pv) def maxDistance(self,points_vitesses): """renvoie la distance max entre le centre et le satellite en projection sur le plan xy. """ r=0 for pv in points_vitesses: if fabs(pv[0])>r: r=fabs(pv[0]) if fabs(pv[1])>r: r=fabs(pv[1]) return r def surementVisible(self,r): """vrai si un cercle de rayon r est visible à coup sûr""" return r/self.echelle < self.milieuY def efface(self): for k in self.points.keys(): objet=self.points[k] objet.hide() objet.clear() self.points = {} self.vitesse = [] def trace_point(self, x, y, couleur, type="petit", tau=None): if tau: cle=(x,y,tau) else: cle=(x,y) if cle in self.points.keys(): # efface des points préexistants de même emplacement objet=self.points[cle] objet.hide() objet.clear() self.points[cle]=Point(self, (x,y), couleur, "", self.mainWin,type_de_point=type) self.points[cle].show() def dessine(self,points_vitesses): self.boum=-1.0 OKtau=False intervalle=self.mainWin.ui.intervale.text() self.tau = int(flottant.traduit(intervalle)) if self.tau > 60: OKtau=True self.vitesse = [] self.date=[] tau_entier = 0 for i in range(0,len(points_vitesses),10): # on ne trace qu'un point sur 10, soit 100 points # sur les 1000 calculés pv=points_vitesses[i] pix_x=int(pv[0]/self.echelle+self.milieuX) pix_y=int(-pv[1]/self.echelle+self.milieuY) # pv est un hexuplet : 3 coordonnées de position, 3 de vitesse self.vitesse.append((pv[3],pv[4])) self.date.append(self.dt*i) if ((pix_x-self.milieuX)**2+(pix_y-self.milieuY)**2)**(0.5) < int(self.mainWin.getRayonAstre()/self.echelle) : self.trace_point(pix_x, pix_y, "red", type="boum") self.boum=self.dt*i break else: self.trace_point(pix_x, pix_y, "red") if OKtau: try : #dessine un point tous les "tau" secondes si défini. tau = i*self.dt/self.tau if int(tau) > int(tau_entier) : self.trace_point(pix_x, pix_y, "blue", type="gros", tau=tau) tau_entier=int(tau) except AttributeError: pass self.repaint() self.update() def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) rayon=int(self.mainWin.getRayonAstre()/self.echelle) painter.drawLine(self.milieuX, 0, self.milieuX, self.milieuY*2) painter.drawLine(0,self.milieuY , 2*self.milieuX, self.milieuY) img=self.astreImg sourcerect=QRect(0,0,512,512) targetrect=QRect(self.milieuX-rayon,self.milieuY-rayon,2*rayon,2*rayon) #TODO : il faudrait redessiner le rectangle en fonction de l'échelle painter.drawEllipse(targetrect) painter.drawImage(targetrect,img,sourcerect) painter.end() def dir(self,choix): return self.rep.chemin(choix) def debug(self,level,msg): self.mainWin.debug(level,msg) def getPlanete(self,nom): if nom not in self.planetes.keys(): handle, imageFile = tempfile.mkstemp(".png") os.close(handle) cmd="xplanet -latitude 90 -num_times 1 -glare 10 -body %s -radius 50 -searchdir %s -transpng %s -rotate -70" %(nom,self.dir("textures"),imageFile) # la rotation de -70° permet au méridiens français de se trouver # au centre de l'image. Cette valeur est empirique et dépend # probablement de l'implémentation de Xplanet. Il n'est pas # évident de jouer avec l'option -north qui seule permet de # contrôler totalement l'orientation de l'image. self.debug(8,u"Création de l'image de planète par \"%s\"" %cmd) os.system(cmd) self.planetes[nom]=QImage(imageFile) os.system("rm -f %s" %imageFile) return self.planetes[nom] def choisi_astre(self,nom): self.astreImg= self.getPlanete(nom) class Satellite(QLabel): def __init__(self, parent, coord_sat, image): QLabel.__init__(self, parent) self.parent = parent self.coord_sat=coord_sat self.image = image def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) x, y = self.coord_sat.x(), self.coord_sat.y() self.debug(5,u"%s,%s" %(x,y)) painter.drawEllipse(x,y,30,16) painter.drawPixmap(self.coord_sat, self.image) painter.end() pysatellites-2.1.orig/.svn/text-base/rectangle_sensible.py.svn-base0000444000175000017500000000605511012562310025725 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- from PyQt4.QtGui import * from PyQt4.QtCore import * from debug import Debug class Rs(QWidget): def __init__(self, parent, geometry=None, image=None, text=None, color=QColor("grey"), debuglevel=0, onPress=None, onRelease=None, onDoubleClick=None, onMove=None, debugger=Debug(0)): QWidget.__init__(self,parent) if geometry==None: # le widget recouvrira le parent if parent!=None: self.setGeometry(QRect(0,0,parent.width(),parent.height())) else: self.setGeometry(QRect(0,0,100,100)) else: self.setGeometry(geometry) self.setMouseTracking(True) self.image=image self.text=text self.color=color self.debug=debugger self.onPress=onPress self.onRelease=onRelease self.onDoubleClick=onDoubleClick self.onMove=onMove def mousePressEvent(self,ev): if self.onPress != None: return self.onPress(ev) else: self.debug(9, "event onPress still to implement") def mouseReleaseEvent(self,ev): if self.onRelease != None: return self.onRelease(ev) else: self.debug(9, "event onRelease still to implement") def mouseMoveEvent(self,ev): if self.onMove != None: return self.onMove(ev) else: self.debug(9, "event onMove still to implement ... x=%s, y=%s" %(ev.x(),ev.y())) def mouseDoubleClickEvent(self,ev): if self.onDoubleClick != None: return self.onDoubleClick(ev) else: self.debug(9, "event onDoubleClick still to implement") def paintEvent(self, event): QWidget.paintEvent(self,event) self.painter = QPainter() self.painter.begin(self) if self.color !=None: self.painter.fillRect(QRect(0,0,self.width(),self.height()), self.color) if self.image != None: self.painter.drawImage(0,0,self.image) if self.text != None: self.painter.drawText(0,0,self.text) self.painter.end() class RsImage(Rs): """Une classe dérivée du rectangle sensible Rs, qui contient une image et se place en x,y sur le parent """ def __init__(self, parent, x, y, image, text=None, color=QColor("grey"), onPress=None, onRelease=None, onDoubleClick=None, onMove=None, debugger=Debug(0)): rect=QRect(x,y,image.size().width(), image.size().height()) Rs.__init__(self, parent, rect, image=image, text=None, color=color, onPress=onPress, onRelease=onRelease, onDoubleClick=onDoubleClick, onMove=onMove, debugger=debugger) pysatellites-2.1.orig/.svn/text-base/pysat.ui.svn-base0000444000175000017500000003536311012562310023226 0ustar georgeskgeorgesk MainWindow 0 0 1018 624 pySatellite, simulateur de trajectoire plane de satellites 20 40 591 561 true QFrame::Panel QFrame::Raised 3 620 270 241 171 Astres connus 20 110 201 46 30 50 113 20 150 50 81 16 masses terrestres 30 80 113 20 150 80 81 16 rayons terrestres 30 20 191 22 870 30 131 571 Vitesses 10 20 141 21 coord. cartésiennes true 10 40 101 21 repère de frénet false 10 80 101 141 Cliquez pour agrandir QFrame::Box 10 60 114 18 Vitesse selon OX 10 240 101 141 Cliquez pour agrandir QFrame::Box 10 220 104 18 Vitesse selon OY 10 402 101 141 Cliquez pour agrandir QFrame::Box 10 382 121 18 Norme de la vitesse 10 550 106 16 (Cliquez pour agrandir) 620 30 241 171 Objet lancé 20 20 81 20 Masse (kg) 110 20 113 25 100 20 50 81 20 altitude (km) 110 50 113 25 1000 10 75 221 81 Vitesses au départ (m/s) 10 20 94 20 Vx (tangentielle) 20 50 71 16 Vy (normale) 120 20 91 29 -4000 122 50 91 29 0 620 200 241 71 Asre défini 110 40 113 25 110 10 113 25 6*10^24 20 40 67 20 Rayon (km) 20 20 65 20 Masse (kg) 620 450 241 51 40 20 61 25 3600 110 20 56 20 temps entre chaque point secondes Qt::AlignCenter 20 0 201 31 temps entre chaque point Visualiser le satellite toutes les Qt::AlignCenter true 620 500 241 101 Actions 140 20 80 25 Effacer 10 20 80 25 Lancer l'objet 130 50 101 21 0 0 à chaque fois 10 60 75 24 Vidéo Button_efface pressed() afficheur clear() 244 579 241 519 pysatellites-2.1.orig/.svn/text-base/Changelog.svn-base0000444000175000017500000000406111012562310023330 0ustar georgeskgeorgeskJB : Jean-Baptiste BUTET BG : Bastient GRAVIERE GK : Georges Khaznadar 2008-03-12 : JB, interface graphique. 2008-04-08 : GK, méthode d'intégration, validation avec un champ de gravité terrestre. 2008-04-11 : GK, modification de la fonction verifie_et_traduit afin de faciliter l'entrée d'expressions complètes. Par exemple on peut rentrer 2*3.14*(35786+6400)*1000/24/3600 comme vitesse tangentielle d'un satellite géostationnaire, et on voit bien l'orbite circulaire se construire. 2008-04-11 : GK, calcul de la période de révolution, dans le cas où l'énergie mécanique Em est négative, par la méthode suivante (k=mMG) : - calcul du grand axe : a = - k/2Em - calcul de la période : T = 2pi(a³/k)^0.5 2008-04-12 : GK, mise en place d'une liste d'astres à l'aide de Wikipedia et intégration avec l'application xplanet et les textures de celestia pour tracer l'image de la planète. Changé les appels à print pour tracer le programme en appels valués à self.debug Changement de quelques widgets : combo pour choisir l'astre, renseignements pour le comparer à la Terre. 2008-04-15 : GK, correction de la prise des données de vitesse. Redressé l'axe Oy. Activé les graphiques pour Vx et Vy. Ajouté une fonction d'agrandissement pour les graphiques. 2008-04-20 : GK, correction de problèmes avec le tracé et l'effacement de points de la trajectoire, quelques changements de style, amélioration des graphiques agrandis, implémenté le cas des énergies mécaniques positives. Ajouté le traitement d'options en ligne de commande. Réglé la gestion des chemins d'accès aux répertoires. 2008-04-26 : GK, ajout de support pour créer une vidéo vue du satellite. la vitesse initiale Vx a été réglée négative, pour un lancer vers l'est. Séparation du code de vérification/calcul de nombres flottants.pysatellites-2.1.orig/.svn/text-base/graphe.ui.svn-base0000444000175000017500000000317611012562310023331 0ustar georgeskgeorgesk Graphe 0 0 302 516 Dialog 110 480 81 32 Qt::Horizontal QDialogButtonBox::Close 10 10 270 450 buttonBox accepted() Graphe accept() 248 254 157 274 buttonBox rejected() Graphe reject() 316 260 286 274 pysatellites-2.1.orig/.svn/text-base/debug.py.svn-base0000444000175000017500000000031211012562310023151 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- class Debug: def __init__(self, debugLevel): self.debugLevel=debugLevel def __call__(self,level,msg): if self.debugLevel > level: print msg pysatellites-2.1.orig/.svn/text-base/matplotlib_widget.py.svn-base0000444000175000017500000000523711012562310025610 0ustar georgeskgeorgesk#!/usr/bin/env python # embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases # # Copyright (C) 2005 Florent Rougon # 2006 Darren Dale # # This file is an example program for matplotlib. It may be used and # modified with no restriction; raw copies as well as modified versions # may be distributed without limitation. import sys, os, random from PyQt4 import QtGui, QtCore from numpy import arange, sin, pi from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt4.QtCore import * from PyQt4.QtGui import * from UI_graphe import Ui_Graphe progname = os.path.basename(sys.argv[0]) progversion = "0.1" class MyMplCanvas(FigureCanvas): """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.).""" def __init__(self, parent, donnees, traitement, dates, width=0, height=0, dpi=100, cliquable=False, titre=""): self.fig = Figure(figsize=(width, height), dpi=dpi ) FigureCanvas.__init__(self, self.fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self) self.axes = self.fig.add_subplot(111) a = self.axes.set_axis_off() # We want the axes cleared every time plot() is called self.axes.axison = False self.axes.axis('off') self.axes.hold(False) self.cliquable=cliquable self.donnees=donnees self.traitement=traitement self.dates=dates self.titre=titre self.plot(donnees, traitement, dates) def mouseReleaseEvent(self, event): if self.cliquable: self.fils=QDialog() self.fils.ui=Ui_Graphe() self.fils.ui.setupUi(self.fils) self.fils.setWindowTitle(QtGui.QApplication.translate("Graphe", self.titre, None, QtGui.QApplication.UnicodeUTF8)) self.fils.show() ratio=2 w=3*ratio h=5*ratio d=90/ratio self.fils.canvas=MyMplCanvas(self.fils.ui.grapheLabel,self.donnees, self.traitement, self.dates, width=w, height=h, dpi=d, cliquable=False, titre=self.titre) self.fils.canvas.show() def sizeHint(self): w, h = self.get_width_height() #print "w, h", w, h return QtCore.QSize(w, h) def minimumSizeHint(self): return QtCore.QSize(10, 10) def plot(self,donnees, traitement, dates): d=[] for dd in donnees: d.append(traitement(dd)) self.axes.plot(dates,d) pysatellites-2.1.orig/.svn/text-base/__init__.py.svn-base0000444000175000017500000000535111012562310023632 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- licence=""" pysatellites : a program to plot trajectories of satellites Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ licence_fr=u""" pysatellites : un programme pour tracer les trajectoires de satellites Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 3 ou plus de la dite licence. Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. . """ import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from debug import Debug from mainWindow import StartQT4 def usage(): print "Usage : pysatellites [-h | --help] [-d n | --debug=n] [-f fichier | --fichier=fichier]" sys.exit(0) def run(): app = QApplication(sys.argv) #translation #locale = QLocale.system().name() #qtTranslator = QTranslator() #if qtTranslator.load("qt_" + locale): # app.installTranslator(qtTranslator) #appTranslator = QTranslator() # if appTranslator.load("lang/pyfocus_" + locale): #app.installTranslator(appTranslator) from getopt import getopt optlist, argv=getopt(sys.argv[1:],"d:f:h",["debug=","fichier=","help"]) debugger=Debug(0) for (cle,val) in optlist: if cle=="-d" or cle=="--debug": debugger=Debug(int(val)) if cle=="-h" or cle=="--help": usage() if cle=="-f" or cle=="--fichier": print "On ne sait pas encore quoi faire de '%s', la fonctionnalité gouvernée par '%s' reste à implémenter." %(val,cle) windows = StartQT4(None, debugger=debugger, app=app) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run() pysatellites-2.1.orig/.svn/text-base/COPYING.svn-base0000444000175000017500000010437411012562310022561 0ustar georgeskgeorgesk GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pysatellites-2.1.orig/.svn/text-base/Makefile.svn-base0000444000175000017500000000104611012562310023156 0ustar georgeskgeorgeskDESTDIR = CELESTIA_TEXTURES = /usr/share/celestia/textures/lores \ /usr/share/celestia/textures/medres \ /usr/share/celestia/textures/hires all: user-interface clean: rm -f *~ *.pyc rm -f UI_* user-interface: UI_pysat.py UI_graphe.py UI_%.py: %.ui pyuic4 $< -o $@ install: install-textures install-textures: mkdir -p $(DESTDIR)/usr/share/pysatellites/images for d in $(CELESTIA_TEXTURES); do \ cp $$d/* $(DESTDIR)/usr/share/pysatellites/images; \ done .PHONY = user-interface install clean install-textures all pysatellites-2.1.orig/.svn/format0000444000175000017500000000000211012562310017307 0ustar georgeskgeorgesk8 pysatellites-2.1.orig/.svn/props/0000755000175000017500000000000011012562310017251 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/prop-base/0000755000175000017500000000000011012562310017776 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/prop-base/__init__.py.svn-base0000444000175000017500000000003611012562310023621 0ustar georgeskgeorgeskK 14 svn:executable V 1 * END pysatellites-2.1.orig/.svn/prop-base/Makefile.svn-base0000444000175000017500000000004211012562310023145 0ustar georgeskgeorgeskK 13 svn:eol-style V 6 native END pysatellites-2.1.orig/.svn/tmp/0000755000175000017500000000000011012562310016706 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/tmp/tempfile.4.tmp0000644000175000017500000000535711012562310021411 0ustar georgeskgeorgesk#!/usr/bin/env python # embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases # # Copyright (C) 2005 Florent Rougon # 2006 Darren Dale # # This file is an example program for matplotlib. It may be used and # modified with no restriction; raw copies as well as modified versions # may be distributed without limitation. import sys, os, random from PyQt4 import QtGui, QtCore from numpy import arange, sin, pi from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt4.QtCore import * from PyQt4.QtGui import * from UI_graphe import Ui_Graphe progname = os.path.basename(sys.argv[0]) progversion = "0.1" class MyMplCanvas(FigureCanvas): """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.).""" def __init__(self, parent, donnees, traitement, dates, width=0, height=0, dpi=100, cliquable=False, titre=""): self.fig = Figure(figsize=(width, height), dpi=dpi ) FigureCanvas.__init__(self, self.fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self) self.axes = self.fig.add_subplot(111) a = self.axes.set_axis_off() # We want the axes cleared every time plot() is called self.axes.axison = False self.axes.axis('off') self.axes.hold(False) self.cliquable=cliquable self.donnees=donnees self.traitement=traitement self.dates=dates self.titre=titre self.plot(donnees, traitement, dates) def mouseReleaseEvent(self, event): if self.cliquable: self.fils=QDialog() self.fils.ui=Ui_Graphe() self.fils.ui.setupUi(self.fils) self.fils.setWindowTitle(QtGui.QApplication.translate("Graphe", self.titre, None, QtGui.QApplication.UnicodeUTF8)) self.fils.show() self.fils.canvas=MyMplCanvas(self.fils.ui.grapheLabel,self.donnees, self.traitement, self.dates, width=3, height=5, dpi=90, cliquable=False, titre=self.titre) self.fils.canvas.show() def sizeHint(self): w, h = self.get_width_height() #print "w, h", w, h return QtCore.QSize(w, h) def minimumSizeHint(self): return QtCore.QSize(10, 10) <<<<<<< .mine def plot(self,donnees, traitement, dates): d=[] for dd in donnees: d.append(traitement(dd)) self.axes.plot(dates,d) ======= def compute_initial_figure(self,donnees): self.axes.plot(donnees) >>>>>>> .r31 self.axes.axis([0, 1, 0, 1.2*max(donnees) ]) pysatellites-2.1.orig/.svn/tmp/text-base/0000755000175000017500000000000011012562310020602 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/tmp/tempfile.7.tmp0000644000175000017500000004767211012562310021422 0ustar georgeskgeorgesk MainWindow 0 0 972 633 pySatellite, simulateur de trajectoire plane de satellites 30 30 531 521 QFrame::Box <<<<<<< .mine ======= 150 20 71 18 Objet lancé 42 50 81 20 Masse (kg) 40 80 81 20 altitude (km) 0 120 230 20 Vitesse tangentielle au départ, Vx (m/s) 30 160 181 16 Vitesse normale au départ, Vy, m/s 230 50 113 25 100 230 80 113 25 1000 230 120 113 25 7200 230 160 113 25 0 479 80 67 20 Rayon (km) 550 20 61 16 Astre >>>>>>> .r31 570 300 241 171 Astres connus 30 106 201 46 30 46 113 20 150 46 81 16 masses terrestres 30 76 113 20 150 76 81 16 rayons terrestres 40 16 191 22 490 620 56 20 <<<<<<< .mine ======= Masse (kg) 570 80 113 25 500 130 84 20 Astres connus 110 570 80 25 Lancer l'objet 500 380 61 16 Vitesses 500 410 114 18 Vitesse tangentielle 620 410 104 18 Vitesse radiale 740 410 121 18 Norme de la vitesse 500 430 101 141 QFrame::Box 620 430 101 141 QFrame::Box 740 430 101 141 QFrame::Box 730 230 182 18 >>>>>>> .r31 temps entre chaque point secondes Qt::AlignCenter 820 24 131 571 Vitesses 10 20 141 21 coord. cartésiennes true 10 40 101 21 repère de frénet false 10 80 101 141 QFrame::Box 10 60 114 18 Vitesse selon OX 10 240 101 141 QFrame::Box 10 220 104 18 Vitesse selon OY 10 410 101 141 QFrame::Box 10 390 121 18 Norme de la vitesse <<<<<<< .mine 570 30 241 171 Objet lancé 20 16 81 20 Masse (kg) 110 16 113 25 100 20 46 81 20 altitude (km) 110 46 113 25 1000 10 75 221 81 Vitesses au départ (m/s) 10 16 81 20 Vx (tangentielle) 10 46 71 16 Vy (normale) 100 16 113 25 4000 100 46 113 25 0 570 200 241 91 Asre défini 110 46 113 25 110 16 113 25 6*10^24 20 46 67 20 Rayon (km) 20 16 65 20 Masse (kg) ======= >>>>>>> .r31 570 480 241 51 Durées 46 6 81 31 temps entre chaque point Visualiser le satellite toutes les Qt::AlignCenter true 136 16 61 25 3600 200 20 21 16 s 570 540 241 61 Actions 150 20 80 25 Effacer 10 20 80 25 Lancer l'objet Button_efface pressed() afficheur clear() 244 579 241 519 pysatellites-2.1.orig/.svn/tmp/props/0000755000175000017500000000000011012562310020051 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/tmp/tempfile.tmp0000644000175000017500000004125411012562310021243 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- licence=""" pysatellites : This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ licence_fr=u""" pysatellites : un programme pour tracer les trajectoires des points dans une vidéo. Copyright (C) 2007 Jean-Baptiste Butet , (C) 2007 Georges Khaznadar Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 2 ou plus de la dite licence. Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. . """ import sys, os, time, tempfile from PyQt4.QtCore import * from PyQt4.QtGui import * from glob import glob from UI_pysatellites import Ui_MainWindow from traj_satellite import trajectoire, nouvChampGrav from math import pi, cos, sin from astres import astreNom class Point(QLabel): def __init__(self, parent, point, color, numero, app, pred=None): """ Crée un point graphique. Paramètres : parent : widget parent point : coordonnées (de type vecteur) color : couleur numero : numéro à afficher app : l'application qui commande pred : le point prédecesseur """ QLabel.__init__(self, parent) self.app=app self.point, self.color = point,color self.setGeometry(QRect(0,0,640,480)) self.numero=numero def paintEvent(self,event): self.painter = QPainter() self.painter.begin(self) self.painter.setPen(QColor(self.color)) self.painter.translate(self.point[0], self.point[1]) self.painter.drawLine(-2,0,2,0) self.painter.drawLine(0,-2,0,2) self.painter.end() class StartQT4(QMainWindow): def __init__(self, parent, debuglevel=0): #Données principales du logiciel : #self.index_de_l_image : la position de l'image actuellement affichée #self.index_de_l_image_du_pointk : le nombre de click fait sur l'image. ceci signifie donc que c'est le nombre de lignes dans le tableau. démarre à zéro ######QT QMainWindow.__init__(self) QWidget.__init__(self, parent) self.debuglevel=debuglevel self.ui = Ui_MainWindow() self.ui.setupUi(self) self.label_trajectoire = Label_trajectoire(self.ui.centralwidget, 6400,self) self.initAstres() self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) self.echelle= self.verifie_et_traduit(self.ui.rayon_astre.text())*1000/25.0 #m/pixel self.appdir=os.path.dirname(os.path.abspath(sys.argv[0])) os.chdir(self.dir("defaut")) self.image_sat=QPixmap("icones/sat_mini.gif") self.connexions_signaux() self.dessine_objet(self.ui.altitude_objet.text(), pi/2) self.points={} def initAstres(self): self.planetes={} for a in astreNom: self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.choisi_astre(0) def getPlanete(self,nom): if nom not in self.planetes.keys(): handle, imageFile = tempfile.mkstemp(".png") os.close(handle) cmd="xplanet -latitude 90 -num_times 1 -glare 10 -body %s -radius 50 -searchdir %s -transpng %s" %(nom,self.dir("textures"),imageFile) self.debug(8,u"Création de l'image de planète par \"%s\"" %cmd) os.system(cmd) self.planetes[nom]=QImage(imageFile) os.system("rm -f %s" %imageFile) return self.planetes[nom] def debug(self,niveau,obj): if self.debuglevel >= niveau: msg="DEBUG[%d] : %s" %(niveau, obj) print msg.encode('utf-8') def dir(self,d="defaut"): if d=="defaut": return self.appdir elif d=="textures": for d in ["/usr/share/pysatellites/images", "/usr/share/celestia/textures/medres"]: if os.path.exists(d+'/moon.jpg'): return d self.debug(0,u"Le répertoire de textures n'existe pas") else: self.debug(0,u"Erreur : %d n'est pas un répertoire système" %d) def connexions_signaux(self): QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.lance) QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) QObject.connect(self.ui.radioButton_Cartesiennes,SIGNAL("toggled()"), self.choisi_astre) QObject.connect(self.ui.radioButton_Frenet,SIGNAL("toggled(bool)"), self.choisi_coordoonees) self.ui.mTerre.setReadOnly (True) self.ui.rTerre.setReadOnly (True) self.ui.auSujetAstre.setReadOnly (True) def dessine_objet(self, r, teta): """dessine le satellite avec pour corrondées, R et téta (en radian))""" r = float(r) teta = float(teta) self.debug(5,u"échelle : %s mètres par pixels" %self.echelle) coord_sat = QPoint(int(r*cos(teta)/self.echelle + 205.0), int((r + float(self.ui.rayon_astre.text()))/self.echelle*sin(teta) + 185.0)) #self.sat = Satellite(self.label_trajectoire,coord_sat, self.image_sat) #self.sat.show() def efface_trajectoire(self): for objet in self.ui.label.children(): # on peut le refaire à partir du dico. peut etre plus sur. #objet.delete() objet.hide() objet.clear() self.points = {} def calcul_echelle(self): """calcul l'echelle en fonction des divers paramètres de la trajectoire""" #si on considère la trajectoire fermée, on a une période, donc un max et un min #il faut que la trajectoire soit comprise dans le cadre (exemple géostationnaire) mais aussi possible pour l'ISS (800km) #il faut donc changer l'échelle en fonction de la distance maximale. if self.ex < 1 : # on a une trajectoire fermée self.debug(8,u"self.echelle = %s" %self.echelle) def lance(self): #self.efface_trajectoire() self.calcul_parametre() a=time.time() self.traj= trajectoire(self.dt, self.t, self.pos+self.vit, self.gAstre) self.debug(9, self.traj.pv) self.debug(8, u"%s, %s, %s, %s" %(self.dt, self.t, self.pos+self.vit, self.gAstre)) #self.traj.dessine() self.calcul_echelle() #dt,t,y0, k, m,defaut,dessin self.debug(5,u"calcul en %s secondes" %(time.time()-a)) self.dessine_trajectoire() def dessine_trajectoire(self): self.debug(9,u"dessine la trajectoire") x=[] y=[] for point in self.traj.pv : x.append(point[0]) y.append(point[1]) for i in range(len(x)) : pix_x=x[i]/self.echelle+205 pix_y=y[i]/self.echelle+185 #A FAIRE :il faut gérer les doublons de points. self.points[(pix_x,pix_y)]=Point(self.ui.label, (pix_x,pix_y), "red", "", self) self.points[(pix_x,pix_y)].show() #self.points[(pix_x,pix_y)].update() #self.processEvents#essai pour dessiner les points un par un. non concluant. self.repaint() def verifie_et_traduit(self,chaine): """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" # on force le type chaîne pour pouvoir faire des évaluations. chaine=str(chaine).replace(" ","") # et retrait de tous les espaces #vérification de la présence d'un float correct, sinon tente des modifs. try : chaine=float(eval(chaine)) except : chaine=chaine.replace("10^","e") #remplace la chaine 10^ par e else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "x" pour la multiplication chaine=chaine.replace("x","*") chaine=chaine.replace("X","*") else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "*" devant un "e" chaine=chaine.replace("*e","e") else: return chaine try : chaine=float(eval(chaine)) except : self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) else: return chaine return 1.0 def calcul_parametre(self): self.masse_astre = self.verifie_et_traduit(self.ui.masse_astre.text()) self.distance_astre = (self.verifie_et_traduit(self.ui.rayon_astre.text()) + self.verifie_et_traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres self.vitesse_x = self.verifie_et_traduit(self.ui.vitesse_tangentielle_objet.text()) self.vitesse_y= self.verifie_et_traduit(self.ui.vitesse_normale_objet.text()) self.G=6.67259e-11 #calcul des énergies massiques (cinétique, potentielle, mécanique) Ec_massique=0.5*(self.vitesse_x**2+self.vitesse_y**2) Ep_massique=-self.masse_astre*self.G/self.distance_astre Em_massique=Ec_massique+Ep_massique if Em_massique >= 0: self.debug(1,u"L'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pas" %Em_massique) p = self.distance_astre**2*self.vitesse_x**2/(self.masse_astre*self.G) self.ex = (p-self.distance_astre)/self.distance_astre self.t = (2*pi*((p/(1-self.ex**2))*1000)**3)/(self.masse_astre*self.G) self.dt=self.t/100 # les calculs ci-dessus semblent fortement erronés, # ça donne par exemple pour une altitude de 1000 km au-dessus de la # terre, lancement à 4000 m/s : # t= 1.28475309351e+15 s et dt = 1.28475309351e+13 s. # calcul du grand axe a : Em = -k/2a pour une trajectoire elliptique # donc a = -k/2Em a = - self.masse_astre*self.G/2/Em_massique # calcul de la période, en utilisant la troisième loi de Kepler # T²=4pi²/MG*a³ self.t = 2*pi*(a**3/self.masse_astre/self.G)**0.5 self.dt = self.t/100 self.debug(5,u"masse astre %s" %self.masse_astre) self.gAstre = nouvChampGrav((0,0,0),self.masse_astre) self.pos = (0.0, self.distance_astre, 0) # un point sur l'orbite géostationnaire self.vit = (self.vitesse_x,self.vitesse_y,0.0) # vitesse du satellite #for t in range(0,T,pas): #evidemment, faut un pas raisonnable !!! 32 millions de secondes pour la révolution terrestre !!! #teta=2*pi*t/T ## coordonnées du satellite, le centre attracteur étant en O : x,y #x = p*cos(teta)/(1+self.ex*cos(teta)) #y = p*sin(teta)/(1+self.ex*cos(teta)) #Bastien : remplit ici les calculs qui ne concernent que l'équation (avec des "self" devant si tu veux pouvoir les choper dans une autre fonction. def choisi_coordoonees(self,bool): if self.ui.radioButton_Cartesiennes.isChecked()==True : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse selon Ox", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse selon Oy", None, QApplication.UnicodeUTF8)) elif self.ui.radioButton_Cartesiennes.isChecked()==False : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse Tangentielle", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse Normale", None, QApplication.UnicodeUTF8)) def choisi_astre(self,int): mt0=astreNom[0][2] rt0=astreNom[0][3] astre=self.ui.astreCombo.currentText() <<<<<<< .mine for a in astreNom: if a[0]==astre: self.astreImg= self.getPlanete(a[1]) masse_astre=a[2] rayon_astre=a[3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) ======= for k in astreNom.keys(): if astreNom[k][0]==astre: self.astreImg= self.getPlanete(astreNom[k][1]) self.masse_astre=astreNom[k][2] self.rayon_astre=astreNom[k][3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", self.masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", self.rayon_astre, None, QApplication.UnicodeUTF8)) >>>>>>> .r7 mt=self.verifie_et_traduit(masse_astre)/self.verifie_et_traduit(mt0) rt=self.verifie_et_traduit(rayon_astre)/self.verifie_et_traduit(rt0) mt="%5g" %mt rt="%5g" %rt self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) self.label_trajectoire.update() return self.debug(0,u"Astre inconnu : %s" %astre) class Label_trajectoire(QLabel): def __init__(self, parent, rayon_astre, mainWin): QLabel.__init__(self, parent) self.parent = parent self.mainWin=mainWin self.setGeometry(QRect(40,190,410,370)) self.setFrameShape(QFrame.Box) def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) #l'échelle fait qu'un cercle de 50 pixels est notre astre rayon=int(float(self.mainWin.rayon_astre)*1000/self.mainWin.echelle) painter.drawLine(205, 0, 205, 370) painter.drawLine(0,185 , 410, 185) img=self.mainWin.astreImg sourcerect=QRect(0,0,512,512) targetrect=QRect(205-rayon,185-rayon,2*rayon,2*rayon) #TODO : il faudrait redessiner le rectangle en fonction de l'échelle #painter.drawEllipse(targetrect) painter.drawImage(targetrect,img,sourcerect) painter.end() class Satellite(QLabel): def __init__(self, parent, coord_sat, image): QLabel.__init__(self, parent) self.parent = parent self.coord_sat=coord_sat self.image = image def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) x, y = self.coord_sat.x(), self.coord_sat.y() self.debug(5,u"%s,%s" %(x,y)) painter.drawEllipse(x,y,30,16) painter.drawPixmap(self.coord_sat, self.image) painter.end() def usage(): print "Usage : pysatellites [-f fichier | --fichier_pysatellites=fichier]" def run(): app = QApplication(sys.argv) #translation #locale = QLocale.system().name() #qtTranslator = QTranslator() #if qtTranslator.load("qt_" + locale): # app.installTranslator(qtTranslator) #appTranslator = QTranslator() # if appTranslator.load("lang/pyfocus_" + locale): #app.installTranslator(appTranslator) windows = StartQT4(None, debuglevel=10) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run() pysatellites-2.1.orig/.svn/tmp/tempfile.6.tmp0000644000175000017500000000336711012562310021412 0ustar georgeskgeorgeskJB : Jean-Baptiste BUTET BG : Bastient GRAVIERE GK : Georges Khaznadar 2008-03-12 : JB, interface graphique. 2008-04-08 : GK, méthode d'intégration, validation avec un champ de gravité terrestre. 2008-04-11 : GK, modification de la fonction verifie_et_traduit afin de faciliter l'entrée d'expressions complètes. Par exemple on peut rentrer 2*3.14*(35786+6400)*1000/24/3600 comme vitesse tangentielle d'un satellite géostationnaire, et on voit bien l'orbite circulaire se construire. 2008-04-11 : GK, calcul de la période de révolution, dans le cas où l'énergie mécanique Em est négative, par la méthode suivante (k=mMG) : - calcul du grand axe : a = - k/2Em - calcul de la période : T = 2pi(a³/k)^0.5 2008-04-12 : GK, mise en place d'une liste d'astres à l'aide de Wikipedia et intégration avec l'application xplanet et les textures de celestia pour tracer l'image de la planète. Changé les appels à print pour tracer le programme en appels valués à self.debug Changement de quelques widgets : combo pour choisir l'astre, renseignements pour le comparer à la Terre. <<<<<<< .mine 2008-04-15 : GK, correction de la prise des données de vitesse. Redressé l'axe Oy. Activé les graphiques pour Vx et Vy. Ajouté une fonction d'agrandissement pour les graphiques. ======= 2008-04-14 : JB, prise en compte de la vitesse avec matplotplib, gestion des collisions, intégration de graphismes pour les satellites, possibilité de pointage de la position d'un satelite selon une période prédéfinie. 2008-04-15 : GK, correction de la prise des données de vitesse. >>>>>>> .r31 pysatellites-2.1.orig/.svn/tmp/prop-base/0000755000175000017500000000000011012562310020576 5ustar georgeskgeorgeskpysatellites-2.1.orig/.svn/tmp/tempfile.5.tmp0000644000175000017500000002050511012562310021402 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- licence=""" pysatellites : This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ licence_fr=u""" pysatellites : un programme pour tracer les trajectoires des points dans une vidéo. Copyright (C) 2007 Jean-Baptiste Butet , (C) 2007 Georges Khaznadar Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 3 ou plus de la dite licence. Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. . """ import sys, os from PyQt4.QtCore import * from PyQt4.QtGui import * from glob import glob from UI_pysat import Ui_MainWindow from traj_satellite import Label_trajectoire from math import pi, cos, sin, fabs from astres import astreNom from point import Point from matplotlib_widget import MyMplCanvas class StartQT4(QMainWindow): def __init__(self, parent, debuglevel=0): #Données principales du logiciel : #self.index_de_l_image : la position de l'image actuellement affichée #self.index_de_l_image_du_pointk : le nombre de click fait sur l'image. ceci signifie donc que c'est le nombre de lignes dans le tableau. démarre à zéro ######QT QMainWindow.__init__(self) QWidget.__init__(self, parent) self.debuglevel=debuglevel self.ui = Ui_MainWindow() self.ui.setupUi(self) self.label_trajectoire = Label_trajectoire(self.ui.afficheur, 6400,self) self.initAstres() self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) #self.label_trajectoire.setEchelle(self.verifie_et_traduit(self.ui.rayon_astre.text())*1000/25.0,"mppx") self.appdir=os.path.dirname(os.path.abspath(sys.argv[0])) os.chdir(self.dir("defaut")) self.image_sat=QPixmap("icones/sat_mini.gif") self.connexions_signaux() self.placeDepart() def getRayonAstre(self): return self.verifie_et_traduit(self.ui.rayon_astre.text())*1000 def placeDepart(self): self.label_trajectoire.efface() x=0 y=(self.verifie_et_traduit(self.ui.rayon_astre.text())+self.verifie_et_traduit(self.ui.altitude_objet.text()))*1000 self.label_trajectoire.setEchelle(y,"max") vx=self.verifie_et_traduit(self.ui.vitesse_tangentielle_objet.text()) vy=self.verifie_et_traduit(self.ui.vitesse_normale_objet.text()) self.label_trajectoire.dessine([(x,y,0,vx,vy,0)]) self.label_trajectoire.update() def initAstres(self): for a in astreNom: self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.choisi_astre(0) def debug(self,niveau,obj): if self.debuglevel >= niveau: msg="DEBUG[%d] : %s" %(niveau, obj) print msg.encode('utf-8') def dir(self,d="defaut"): if d=="defaut": return self.appdir else: self.debug(0,u"Erreur : %s n'est pas un répertoire système" %d) def connexions_signaux(self): QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.label_trajectoire.lance) QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) QObject.connect(self.ui.altitude_objet,SIGNAL("editingFinished()"), self.placeDepart) QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) self.ui.mTerre.setReadOnly (True) self.ui.rTerre.setReadOnly (True) self.ui.auSujetAstre.setReadOnly (True) def efface_trajectoire(self): self.label_trajectoire.efface() def verifie_et_traduit(self,chaine): """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" # on force le type chaîne pour pouvoir faire des évaluations. chaine=str(chaine).replace(" ","") # et retrait de tous les espaces #vérification de la présence d'un float correct, sinon tente des modifs. try : chaine=float(eval(chaine)) except : chaine=chaine.replace("10^","e") #remplace la chaine 10^ par e else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "x" pour la multiplication chaine=chaine.replace("x","*") chaine=chaine.replace("X","*") else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "*" devant un "e" chaine=chaine.replace("*e","e") else: return chaine try : chaine=float(eval(chaine)) except : self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) else: return chaine return 1.0 def getMasseAstre(self): return self.verifie_et_traduit(self.ui.masse_astre.text()) def getDistanceAstre(self): return (self.verifie_et_traduit(self.ui.rayon_astre.text()) + self.verifie_et_traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres def getVitesse(self): return (self.verifie_et_traduit(self.ui.vitesse_tangentielle_objet.text()), self.verifie_et_traduit(self.ui.vitesse_normale_objet.text())) def choisi_astre(self,int): mt0=astreNom[0][2] rt0=astreNom[0][3] astre=self.ui.astreCombo.currentText() for a in astreNom: if a[0]==astre: self.label_trajectoire.choisi_astre(a[1]) masse_astre=a[2] rayon_astre=a[3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) mt=self.verifie_et_traduit(masse_astre)/self.verifie_et_traduit(mt0) rt=self.verifie_et_traduit(rayon_astre)/self.verifie_et_traduit(rt0) mt="%5g" %mt rt="%5g" %rt self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) self.placeDepart() self.label_trajectoire.update() return self.debug(0,u"Astre inconnu : %s" %astre) def usage(): print "Usage : pysatellites [-f fichier | --fichier_pysatellites=fichier]" def run(): app = QApplication(sys.argv) #translation #locale = QLocale.system().name() #qtTranslator = QTranslator() #if qtTranslator.load("qt_" + locale): # app.installTranslator(qtTranslator) #appTranslator = QTranslator() # if appTranslator.load("lang/pyfocus_" + locale): #app.installTranslator(appTranslator) windows = StartQT4(None, debuglevel=10) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run() pysatellites-2.1.orig/.svn/tmp/tempfile.2.tmp0000644000175000017500000004151011012562310021376 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- licence=""" pysatellites : This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ licence_fr=u""" pysatellites : un programme pour tracer les trajectoires des points dans une vidéo. Copyright (C) 2007 Jean-Baptiste Butet , (C) 2007 Georges Khaznadar Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 2 ou plus de la dite licence. Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. . """ import sys, os, time, tempfile from PyQt4.QtCore import * from PyQt4.QtGui import * from glob import glob from UI_pysatellites import Ui_MainWindow from traj_satellite import trajectoire, nouvChampGrav from math import pi, cos, sin from astres import astreNom class Point(QLabel): def __init__(self, parent, point, color, numero, app, pred=None): """ Crée un point graphique. Paramètres : parent : widget parent point : coordonnées (de type vecteur) color : couleur numero : numéro à afficher app : l'application qui commande pred : le point prédecesseur """ QLabel.__init__(self, parent) self.app=app self.point, self.color = point,color self.setGeometry(QRect(0,0,640,480)) self.numero=numero def paintEvent(self,event): self.painter = QPainter() self.painter.begin(self) self.painter.setPen(QColor(self.color)) self.painter.translate(self.point[0], self.point[1]) self.painter.drawLine(-2,0,2,0) self.painter.drawLine(0,-2,0,2) self.painter.end() class StartQT4(QMainWindow): def __init__(self, parent, debuglevel=0): #Données principales du logiciel : #self.index_de_l_image : la position de l'image actuellement affichée #self.index_de_l_image_du_pointk : le nombre de click fait sur l'image. ceci signifie donc que c'est le nombre de lignes dans le tableau. démarre à zéro ######QT QMainWindow.__init__(self) QWidget.__init__(self, parent) self.debuglevel=debuglevel self.ui = Ui_MainWindow() self.ui.setupUi(self) self.connexions_signaux() self.label_trajectoire = Label_trajectoire(self.ui.centralwidget, 6400,self) self.initAstres() self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) self.echelle= self.verifie_et_traduit(self.ui.rayon_astre.text())*1000/25.0 #m/pixel self.emit(SIGNAL('echelle_changed()')) self.appdir=os.path.dirname(os.path.abspath(sys.argv[0])) os.chdir(self.dir("defaut")) self.image_sat=QPixmap("icones/sat_mini.gif") self.dessine_objet(self.ui.altitude_objet.text(), pi/2) self.points={} def initAstres(self): self.planetes={} for a in astreNom: self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.choisi_astre(0) def getPlanete(self,nom): if nom not in self.planetes.keys(): handle, imageFile = tempfile.mkstemp(".png") os.close(handle) cmd="xplanet -latitude 90 -num_times 1 -glare 10 -body %s -radius 50 -searchdir %s -transpng %s" %(nom,self.dir("textures"),imageFile) self.debug(8,u"Création de l'image de planète par \"%s\"" %cmd) os.system(cmd) self.planetes[nom]=QImage(imageFile) os.system("rm -f %s" %imageFile) return self.planetes[nom] def debug(self,niveau,obj): if self.debuglevel >= niveau: msg="DEBUG[%d] : %s" %(niveau, obj) print msg.encode('utf-8') def dir(self,d="defaut"): if d=="defaut": return self.appdir elif d=="textures": for d in ["/usr/share/pysatellites/images", "/usr/share/celestia/textures/medres"]: if os.path.exists(d+'/moon.jpg'): return d self.debug(0,u"Le répertoire de textures n'existe pas") else: self.debug(0,u"Erreur : %d n'est pas un répertoire système" %d) def connexions_signaux(self): QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.lance) QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) QObject.connect(self.ui.radioButton_Cartesiennes,SIGNAL("toggled()"), self.choisi_astre) QObject.connect(self.ui.radioButton_Frenet,SIGNAL("toggled(bool)"), self.choisi_coordoonees) <<<<<<< .mine self.ui.mTerre.setReadOnly (True) self.ui.rTerre.setReadOnly (True) self.ui.auSujetAstre.setReadOnly (True) ======= QObject.connect(self,SIGNAL("echelle_changed()"), self.change_echelle) QObject.connect(self.ui.checkBox_echelle,SIGNAL("stateChanged(int)"), self.active_echelle) >>>>>>> .r8 def active_echelle(self,state): if self.ui.echelle_edit.isEnabled == True : self.ui.echelle_edit.setEnabled(0) else : self.ui.echelle_edit.setEnabled(1) def change_echelle(self): self.ui.echelle_edit.setText(QApplication.translate("MainWindow", str(int(self.echelle)), None, QApplication.UnicodeUTF8)) def dessine_objet(self, r, teta): """dessine le satellite avec pour corrondées, R et téta (en radian))""" r = float(r) teta = float(teta) self.debug(5,u"échelle : %s mètres par pixels" %self.echelle) self.emit(SIGNAL('echelle_changed()')) coord_sat = QPoint(int(r*cos(teta)/self.echelle + 205.0), int((r + float(self.ui.rayon_astre.text()))/self.echelle*sin(teta) + 185.0)) #self.sat = Satellite(self.label_trajectoire,coord_sat, self.image_sat) #self.sat.show() def efface_trajectoire(self): for objet in self.ui.label.children(): # on peut le refaire à partir du dico. peut etre plus sur. #objet.delete() objet.hide() objet.clear() self.points = {} def calcul_echelle(self): """calcul l'echelle en fonction des divers paramètres de la trajectoire""" #si on considère la trajectoire fermée, on a une période, donc un max et un min #il faut que la trajectoire soit comprise dans le cadre (exemple géostationnaire) mais aussi possible pour l'ISS (800km) #il faut donc changer l'échelle en fonction de la distance maximale. if self.ex < 1 : # on a une trajectoire fermée self.debug(8,u"self.echelle = %s" %self.echelle) def lance(self): #self.efface_trajectoire() self.calcul_parametre() a=time.time() self.traj= trajectoire(self.dt, self.t, self.pos+self.vit, self.gAstre) self.debug(9, self.traj.pv) self.debug(8, u"%s, %s, %s, %s" %(self.dt, self.t, self.pos+self.vit, self.gAstre)) #self.traj.dessine() self.calcul_echelle() #dt,t,y0, k, m,defaut,dessin self.debug(5,u"calcul en %s secondes" %(time.time()-a)) self.dessine_trajectoire() def dessine_trajectoire(self): self.debug(9,u"dessine la trajectoire") x=[] y=[] for point in self.traj.pv : x.append(point[0]) y.append(point[1]) for i in range(len(x)) : pix_x=x[i]/self.echelle+205 pix_y=y[i]/self.echelle+185 #A FAIRE :il faut gérer les doublons de points. self.points[(pix_x,pix_y)]=Point(self.ui.label, (pix_x,pix_y), "red", "", self) self.points[(pix_x,pix_y)].show() #self.points[(pix_x,pix_y)].update() #self.processEvents#essai pour dessiner les points un par un. non concluant. self.repaint() def verifie_et_traduit(self,chaine): """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" # on force le type chaîne pour pouvoir faire des évaluations. chaine=str(chaine).replace(" ","") # et retrait de tous les espaces #vérification de la présence d'un float correct, sinon tente des modifs. try : chaine=float(eval(chaine)) except : chaine=chaine.replace("10^","e") #remplace la chaine 10^ par e else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "x" pour la multiplication chaine=chaine.replace("x","*") chaine=chaine.replace("X","*") else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "*" devant un "e" chaine=chaine.replace("*e","e") else: return chaine try : chaine=float(eval(chaine)) except : self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) else: return chaine return 1.0 def calcul_parametre(self): self.masse_astre = self.verifie_et_traduit(self.ui.masse_astre.text()) self.distance_astre = (self.verifie_et_traduit(self.ui.rayon_astre.text()) + self.verifie_et_traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres self.vitesse_x = self.verifie_et_traduit(self.ui.vitesse_tangentielle_objet.text()) self.vitesse_y= self.verifie_et_traduit(self.ui.vitesse_normale_objet.text()) self.G=6.67259e-11 #calcul des énergies massiques (cinétique, potentielle, mécanique) Ec_massique=0.5*(self.vitesse_x**2+self.vitesse_y**2) Ep_massique=-self.masse_astre*self.G/self.distance_astre Em_massique=Ec_massique+Ep_massique if Em_massique >= 0: self.debug(1,u"L'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pas" %Em_massique) p = self.distance_astre**2*self.vitesse_x**2/(self.masse_astre*self.G) self.ex = (p-self.distance_astre)/self.distance_astre self.t = (2*pi*((p/(1-self.ex**2))*1000)**3)/(self.masse_astre*self.G) self.dt=self.t/100 # les calculs ci-dessus semblent fortement erronés, # ça donne par exemple pour une altitude de 1000 km au-dessus de la # terre, lancement à 4000 m/s : # t= 1.28475309351e+15 s et dt = 1.28475309351e+13 s. # calcul du grand axe a : Em = -k/2a pour une trajectoire elliptique # donc a = -k/2Em a = - self.masse_astre*self.G/2/Em_massique # calcul de la période, en utilisant la troisième loi de Kepler # T²=4pi²/MG*a³ self.t = 2*pi*(a**3/self.masse_astre/self.G)**0.5 self.dt = self.t/100 self.debug(5,u"masse astre %s" %self.masse_astre) self.gAstre = nouvChampGrav((0,0,0),self.masse_astre) self.pos = (0.0, self.distance_astre, 0) # un point sur l'orbite géostationnaire self.vit = (self.vitesse_x,self.vitesse_y,0.0) # vitesse du satellite #for t in range(0,T,pas): #evidemment, faut un pas raisonnable !!! 32 millions de secondes pour la révolution terrestre !!! #teta=2*pi*t/T ## coordonnées du satellite, le centre attracteur étant en O : x,y #x = p*cos(teta)/(1+self.ex*cos(teta)) #y = p*sin(teta)/(1+self.ex*cos(teta)) #Bastien : remplit ici les calculs qui ne concernent que l'équation (avec des "self" devant si tu veux pouvoir les choper dans une autre fonction. def choisi_coordoonees(self,bool): if self.ui.radioButton_Cartesiennes.isChecked()==True : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse selon Ox", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse selon Oy", None, QApplication.UnicodeUTF8)) elif self.ui.radioButton_Cartesiennes.isChecked()==False : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse Tangentielle", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse Normale", None, QApplication.UnicodeUTF8)) def choisi_astre(self,int): mt0=astreNom[0][2] rt0=astreNom[0][3] astre=self.ui.astreCombo.currentText() for a in astreNom: if a[0]==astre: self.astreImg= self.getPlanete(a[1]) masse_astre=a[2] rayon_astre=a[3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) mt=self.verifie_et_traduit(masse_astre)/self.verifie_et_traduit(mt0) rt=self.verifie_et_traduit(rayon_astre)/self.verifie_et_traduit(rt0) mt="%5g" %mt rt="%5g" %rt self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) self.label_trajectoire.update() return self.debug(0,u"Astre inconnu : %s" %astre) class Label_trajectoire(QLabel): def __init__(self, parent, rayon_astre, mainWin): QLabel.__init__(self, parent) self.parent = parent self.mainWin=mainWin self.setGeometry(QRect(40,190,410,370)) self.setFrameShape(QFrame.Box) def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) #l'échelle fait qu'un cercle de 50 pixels est notre astre rayon=int(float(self.mainWin.rayon_astre)*1000/self.mainWin.echelle) painter.drawLine(205, 0, 205, 370) painter.drawLine(0,185 , 410, 185) img=self.mainWin.astreImg sourcerect=QRect(0,0,512,512) targetrect=QRect(205-rayon,185-rayon,2*rayon,2*rayon) #TODO : il faudrait redessiner le rectangle en fonction de l'échelle painter.drawEllipse(targetrect) painter.drawImage(targetrect,img,sourcerect) painter.end() class Satellite(QLabel): def __init__(self, parent, coord_sat, image): QLabel.__init__(self, parent) self.parent = parent self.coord_sat=coord_sat self.image = image def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) x, y = self.coord_sat.x(), self.coord_sat.y() self.debug(5,u"%s,%s" %(x,y)) painter.drawEllipse(x,y,30,16) painter.drawPixmap(self.coord_sat, self.image) painter.end() def usage(): print "Usage : pysatellites [-f fichier | --fichier_pysatellites=fichier]" def run(): app = QApplication(sys.argv) #translation #locale = QLocale.system().name() #qtTranslator = QTranslator() #if qtTranslator.load("qt_" + locale): # app.installTranslator(qtTranslator) #appTranslator = QTranslator() # if appTranslator.load("lang/pyfocus_" + locale): #app.installTranslator(appTranslator) windows = StartQT4(None, debuglevel=10) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run() pysatellites-2.1.orig/.svn/tmp/tempfile.3.tmp0000644000175000017500000003203111012562310021375 0ustar georgeskgeorgesk MainWindow 0 0 921 641 pySatellite, simulateur de trajectoire plane de satellites 40 190 411 371 QFrame::Box 150 20 71 18 Objet lancé 42 50 81 20 Masse (kg) 40 80 81 20 altitude (km) 0 120 230 20 Vitesse tangentielle au départ, Vx (m/s) 30 160 181 16 Vitesse normale au départ, Vy, m/s 230 50 113 25 100 230 80 113 25 1000 230 120 113 25 4000 230 160 113 25 0 479 80 67 20 Rayon (km) 550 20 61 16 Astre 570 50 113 25 6*10^24 480 50 65 20 Masse (kg) 570 80 113 25 500 130 84 20 Astres connus 110 570 80 25 Lancer l'objet 500 360 61 16 Vitesses 500 410 114 18 Vitesse selon OX 620 410 104 18 Vitesse selon OY 740 410 121 18 Norme de la vitesse 500 430 101 141 QFrame::Box 620 430 101 141 QFrame::Box 740 430 101 141 QFrame::Box <<<<<<< .mine 730 270 ======= 470 290 >>>>>>> .r8 76 18 temps entre chaque point τ en seconde Qt::AlignCenter <<<<<<< .mine 810 260 ======= 550 290 >>>>>>> .r8 61 25 500 380 181 21 coordonnées cartésiennes (X, Y) true 700 380 181 21 repère de frénet (X, Y) false 290 570 80 25 Effacer 480 170 211 22 830 320 31 23 Qt::RightToLeft true false 730 <<<<<<< .mine 160 141 91 ======= 320 113 29 >>>>>>> .r8 false non définie false <<<<<<< .mine 480 160 211 22 ======= 641 320 84 20 >>>>>>> .r8 Echelle (px/m) 480 210 113 20 610 210 81 16 masses terrestres 480 240 113 20 610 240 81 16 rayons terrestres 470 190 231 151 Au sujet de l'astre connu 10 90 201 46 Button_efface pressed() label clear() 244 579 241 519 pysatellites-2.1.orig/.svn/entries0000444000175000017500000000515011012562310017501 0ustar georgeskgeorgesk8 dir 48 svn+ssh://georgesk@svn.tuxfamily.org/svnroot/oppl/pysatellites/trunk svn+ssh://georgesk@svn.tuxfamily.org/svnroot/oppl/pysatellites 2008-04-28T19:54:23.247399Z 48 djibb svn:special svn:externals svn:needs-lock 1cd0251c-75d9-4da3-83ca-c37868f82735 rectangle_sensible.py file 53 2008-05-01T20:12:17.000000Z 567cd5b40da3ac8bd5d73951025ed4db 2008-05-01T20:26:19.221915Z 53 georgesk point.py file 2008-04-20T20:48:08.000000Z 64814ce0e493b53bba8639a2ec6670a5 2008-04-20T20:50:19.967470Z 43 georgesk icones dir flottant.py file 2008-04-25T23:06:26.000000Z e0bc3a128cfe43b49bc543c37493645a 2008-04-25T23:14:00.704826Z 47 georgesk graphe.ui file 2008-04-15T09:00:47.000000Z 68134cd4cadb47b28b2ff4c1f6a8be0a 2008-04-15T10:03:36.541703Z 32 georgesk AUTHORS file 2008-04-12T12:04:26.000000Z b4907a78bc7d3fb89c82abc1220219bd 2008-04-12T09:44:36.333907Z 2 djibb __init__.py file 55 2008-05-01T20:34:23.000000Z 4e84521c4e21d8d6ba6ac6862cd298f8 2008-05-01T22:17:35.137919Z 55 georgesk has-props methodes.tm file 2008-04-12T18:49:11.000000Z cef1b2b29547c41de07141f586b317ba 2008-04-12T18:50:05.937657Z 14 georgesk Changelog file 2008-04-25T23:03:13.000000Z 0794223a1eacc06298b8774b9e11171e 2008-04-25T23:14:00.704826Z 47 georgesk astres.py file 58 2008-05-02T00:33:46.000000Z 97b6ca17e6511676a0a79b5311a65f77 2008-05-02T00:43:18.782459Z 58 georgesk LISEZMOI file 2008-04-12T18:07:34.000000Z 55d1e82f215215e9a3e3d37b8fdf3c80 2008-04-12T18:50:05.937657Z 14 georgesk traj_satellite.py file 53 2008-05-01T20:22:47.000000Z 17357b821594fb3ccedca7d8cf121240 2008-05-01T20:26:19.221915Z 53 georgesk video.py file 58 2008-05-02T00:36:44.000000Z 13f13480f73dafdbbd2a36ed2718d880 2008-05-02T00:43:18.782459Z 58 georgesk matplotlib_widget.py file 2008-04-20T15:24:03.000000Z ec85da9a1c1de4d658e3e00bef96251a 2008-04-20T15:29:54.122293Z 36 georgesk mainWindow.py file 57 2008-05-01T22:45:34.000000Z 2683060a8e86f82a65359b33ec408ebe 2008-05-01T22:50:59.261643Z 57 georgesk repertoire.py file 2008-04-20T17:44:20.000000Z a655718cefec73e31395f11d2de3ab29 2008-04-20T17:57:13.149124Z 39 georgesk COPYING file 2008-04-12T12:04:26.000000Z f27defe1e96c2e1ecd4e0c9be8967949 2008-04-12T09:44:36.333907Z 2 djibb pysat.ui file 2008-05-01T16:20:14.000000Z 1abe87beb9e42e4299c269c029f2a91b 2008-04-28T19:54:23.247399Z 48 djibb Makefile file 2008-04-15T08:30:41.000000Z 4aae88a1666b7047c3b4f3d0ff6447be 2008-04-15T10:03:36.541703Z 32 georgesk has-props debug.py file 53 2008-05-01T20:12:38.000000Z 783d5205be1f324e9f4998e110e8f289 2008-05-01T20:26:19.221915Z 53 georgesk pysatellites-2.1.orig/video.py0000755000175000017500000000654512210727016016726 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- """ video.py est un module permettant de faire un fichier video à partir d'un tableau de positions-vitesses tel que pysatellite peut le réaliser. """ import math, datetime, tempfile, os.path, os from astres import Astre from PyQt4.QtGui import * from threading import * from debug import Debug import flottant class Cinema(Thread): def __init__(self,repertoire, astre, dateorigine, liste_temps, liste_pos, geometrie, pas=1, nettoie=True, boum=-1.0, debugger=Debug(0)): Thread.__init__(self) self.repertoire=repertoire self.astre=astre self.dateorigine=dateorigine self.liste_temps=liste_temps self.liste_pos=liste_pos self.geometrie=geometrie self.pas=pas self.nettoie=nettoie self.boum=boum self.dir=tempfile.mkdtemp("","pysat") self.fini=False self.nbImage=0 self.debug=debugger def run(self): self.video() os.system("vlc --loop %s > /dev/null 2>&1" %os.path.join(self.dir,"out.avi")) if self.nettoie: os.system("rm -r %s" %self.dir) def video(self): self.images() cmd="avconv -r 25 -f image2 -i %s -r 25 -f avi -vcodec mpeg1video -b 800k %s > /dev/null 2>&1" %(os.path.join(self.dir, "%04d.jpg"), os.path.join(self.dir, "out.avi")) os.system(cmd) def images(self): listenum= range(0, len(self.liste_temps), self.pas) for i in listenum: if self.fini: return temps=self.liste_temps[i] if self.boum > 0 and temps > self.boum: self.imageCrash(self.nbImage) self.fini=True return x=self.liste_pos[i][0] y=self.liste_pos[i][1] z=self.liste_pos[i][2] cmd=self.xplanetCmd(temps, x, y, z, os.path.join(self.dir, "%04d.jpg" %self.nbImage)) os.system(cmd) self.nbImage+=1 def imageCrash(self,num): for n in range(20): nomfichier=os.path.join(self.dir, "%04d.jpg" %(num+n)) (w,h)=self.geometrie.split("x") img=QImage(int(w), int(h), QImage.Format_RGB32) img.fill(QColor("red").rgb()) img.save(nomfichier) def xplanetCmd(self,temps, x, y, z, nomfichier): """ dateorigine est un objet datetime fixe, temps est une durée en seconde """ a=Astre(self.astre) td=datetime.timedelta(seconds=temps) date=self.dateorigine+td dateXplanet=date.strftime("%Y%m%d.%H%M%S") rayon=1.0*(x**2+y**2+z**2)**0.5 range=rayon/a.rayon if range > 1.0: radius=100*math.asin(1.0/range) else: radius=9000 longitude0=360.0*temps/(24*3600*flottant.traduit(a.rotationSiderale)) longitude=180/math.pi*math.atan2(y,x)-90 latitude=180/math.pi*math.atan2(z,(x**2+y**2)**0.5) cmd="xplanet -date %s -radius %s -num_times 1 -output '%s' -geometry %s -origin %s -range %s -longitude %s -latitude %s -starmap BSC -searchdir %s -body %s -label >/dev/null 2>&1" %(dateXplanet, radius, nomfichier, self.geometrie, self.astre, range, int(a.flip)*(longitude-longitude0), latitude, self.repertoire.chemin("textures"), self.astre) self.debug(4,u"Lancemende de «%s»" %cmd) return cmd pysatellites-2.1.orig/pysatellites.desktop0000644000175000017500000000040711030465733021353 0ustar georgeskgeorgesk[Desktop Entry] Name=pySatellites Comment=Interactive simulator for launching satellites Comment[fr_FR.UTF-8]=Simulateur interactif de lancement de satellites Exec=pysatellites Icon=pysatellites Terminal=false Type=Application Categories=Video;Education;Science; pysatellites-2.1.orig/mainWindow.py0000755000175000017500000002152311773533340017735 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- """ code pour la fenêtre principale de pysatellites """ licence=""" the file mainWindow.py is part of the package pysatellites. Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ import sys, os from PyQt4.QtCore import * from PyQt4.QtGui import * from glob import glob from UI_pysat import Ui_MainWindow from traj_satellite import Trajectoire from math import pi, cos, sin, fabs from astres import astreNom from point import Point from matplotlib_widget import MyMplCanvas from repertoire import repertoire from video import Cinema import flottant from debug import Debug class StartQT4(QMainWindow): def __init__(self, parent, rep=None , debugger=Debug(0), app=None): QMainWindow.__init__(self) QWidget.__init__(self, parent) self.debug=debugger self.app=app self.ui = Ui_MainWindow() self.ui.setupUi(self) if rep == None: self.rep=repertoire(sys.argv[0]) else: self.rep=rep self.trajectoire = Trajectoire(self.ui.afficheur, 6400, self, debugger=self.debug) self.initAstres() self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) os.chdir(self.rep.chemin("defaut")) self.image_sat=QPixmap("icones/sat_mini.gif") self.connexions_signaux() self.placeDepart() self.cinemaThread=None self.progress=None def getRayonAstre(self): return flottant.traduit(self.ui.rayon_astre.text())*1000 def placeDepart(self): """ place la croix à la position de départ du satellite et figure le vecteur vitesse """ self.trajectoire.efface() x=0 y=(flottant.traduit(self.ui.rayon_astre.text())+flottant.traduit(self.ui.altitude_objet.text()))*1000 self.trajectoire.setEchelle(y,"max") vx=flottant.traduit(self.ui.vitesse_tangentielle_objet.text()) vy=flottant.traduit(self.ui.vitesse_normale_objet.text()) self.trajectoire.dessine([(x,y,0,vx,vy,0)]) self.trajectoire.update() def initAstres(self): """ Peuple le combo avec les noms d'astres """ for a in astreNom: self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.astreCourant="earth" self.choisi_astre(0) def connexions_signaux(self): QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.trajectoire.lance) QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) QObject.connect(self.ui.bouton_video,SIGNAL("clicked()"), self.cinema) QObject.connect(self.ui.altitude_objet,SIGNAL("editingFinished()"), self.placeDepart) QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) QObject.connect(self.ui.radioButton_Frenet,SIGNAL("toggled(bool)"), self.choisi_coordoonees) #QObject.connect(self.ui.checkBox_efface,SIGNAL("stateChanged(bool)"), self.change_comportement_effacege) timer = QTimer(self); QObject.connect(timer, SIGNAL("timeout()"), self.routines); timer.start(1000); self.ui.mTerre.setReadOnly (True) self.ui.rTerre.setReadOnly (True) self.ui.auSujetAstre.setReadOnly (True) def change_comportement_effacege(self,int): pass def efface_trajectoire(self): self.trajectoire.efface() self.placeDepart() def cinema(self): if self.cinemaThread!=None and self.cinemaThread.isAlive(): return import datetime,copy from numpy import arange date=datetime.datetime(2008,4,25) date=date.today() if self.trajectoire.traj != None: liste_temps=arange(0,self.trajectoire.t,self.trajectoire.dt) pas=10 # une image pour 10 calculs numériques titre=QApplication.translate("MainWindow", "Calcul de la vidéo", None, QApplication.UnicodeUTF8) legende=QApplication.translate("MainWindow", "Avancement ...", None, QApplication.UnicodeUTF8) echap=QApplication.translate("MainWindow", "Arrêt", None, QApplication.UnicodeUTF8) self.progress=QProgressDialog(legende,echap,0,len(liste_temps)/pas) self.progress.setWindowTitle(titre) self.progress.setValue(0) self.progress.show() # on lance le thread avec une copie de la liste calculée self.cinemaThread=Cinema(self.rep, self.astreCourant, date, liste_temps, copy.copy(self.trajectoire.traj.pv), "380x240", pas=pas, boum=self.trajectoire.boum, debugger=self.debug) self.cinemaThread.start() def routines(self): if self.cinemaThread!=None and self.cinemaThread.isAlive(): self.progress.setValue(self.cinemaThread.nbImage) if self.progress.wasCanceled(): self.progress.close() self.cinemaThread.fini=True if self.cinemaThread.fini: self.progress.setValue(self.progress.maximum()+1) if self.progress: self.progress.close() def getMasseAstre(self): return flottant.traduit(self.ui.masse_astre.text()) def getDistanceAstre(self): return (flottant.traduit(self.ui.rayon_astre.text()) + flottant.traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres def getVitesse(self): return (flottant.traduit(self.ui.vitesse_tangentielle_objet.text()), flottant.traduit(self.ui.vitesse_normale_objet.text())) def choisi_coordoonees(self,bool): if self.ui.radioButton_Cartesiennes.isChecked()==True : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse selon Ox", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse selon Oy", None, QApplication.UnicodeUTF8)) elif self.ui.radioButton_Cartesiennes.isChecked()==False : self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse Tangentielle", None, QApplication.UnicodeUTF8)) self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse Normale", None, QApplication.UnicodeUTF8)) def choisi_astre(self,int): """ choisit un astre parmi la liste disponible, sur la base du texte couramment sélectionné dans le combo @param int non utiliséé """ mt0=astreNom[0][2] rt0=astreNom[0][3] astre=self.ui.astreCombo.currentText() for a in astreNom: if a[0]==astre: self.trajectoire.choisi_astre(a[1]) self.astreCourant=a[1] masse_astre=a[2] rayon_astre=a[3] self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) mt=flottant.traduit(masse_astre)/flottant.traduit(mt0) rt=flottant.traduit(rayon_astre)/flottant.traduit(rt0) mt="%5g" %mt rt="%5g" %rt self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) self.placeDepart() self.trajectoire.update() return self.debug(0,"Astre inconnu : %s" %astre) pysatellites-2.1.orig/setup.py0000755000175000017500000000126211012566764016761 0ustar georgeskgeorgesk### setup.py ### #-*- coding: utf-8 -*- from distutils.core import setup setup (name='pysatellites', version='1.0', description=u"pysatellites permet de simuler le lancement de satellites, d'en visualiser les trajectoires, et de realiser des videos realistes prises depuis le satellite simule.", author='Georges Khaznadar, Jean-Baptiste BUTET', author_email='georgesk@ofset.org, ashashiwa@gmail.com', url='svn.tuxfamily.org/svnroot/oppl/pysatellites', license='GPLv3', packages=['pysatellites'], package_dir={'pysatellites': '.'}, package_data={'pysatellites': ['icones/*']} #data_files=[('share/pysatellites', ['test.html'])] ) pysatellites-2.1.orig/AUTHORS0000644000175000017500000000015711012562310016275 0ustar georgeskgeorgeskJean-Baptiste BUTET Bastien Georges Khaznadar pysatellites-2.1.orig/COPYING0000644000175000017500000010437411012562310016266 0ustar georgeskgeorgesk GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pysatellites-2.1.orig/lisezmoi0000755000175000017500000000200511012562310017000 0ustar georgeskgeorgeskLe logiciel pysatellites permet de simuler le lancement d'un satellite autour de nombreux astres connus. C'est un logiciel libre, diffusé sous la licence GPL version 3. Voyez les fichiers COPYING Changelog et AUTHORS Pour être pleinement fonctionnel, il est préférable d'installer en même temps les logiciels libres xplanet et la base de données du logiciel celestia ;) de toute façon, une personne intéressée par pysatellites sera très probablement aussi intéressée par xplanet et celestia, pour de nombreux usages complémentaires. Certaines formules sont utilisées pour faciliter la simulation : - la méthode d'intégration de Runge-Kutta qui est d'ordre 4, beaucoup pkus efficace que al méthode d'Euler - un calcul des paramètres de la trajectoire à partir des données connues dès le lancement : énergie mécanique, grand axe, excentricité, période, etc. Le fondement théorique des méthodes emplyées est décrit dans le fichier methodes.tm, qui s'ouvre à l'aide du logiciel libre TexMacs. pysatellites-2.1.orig/LISEZMOI0000644000175000017500000000200511012562310016375 0ustar georgeskgeorgeskLe logiciel pysatellites permet de simuler le lancement d'un satellite autour de nombreux astres connus. C'est un logiciel libre, diffusé sous la licence GPL version 3. Voyez les fichiers COPYING Changelog et AUTHORS Pour être pleinement fonctionnel, il est préférable d'installer en même temps les logiciels libres xplanet et la base de données du logiciel celestia ;) de toute façon, une personne intéressée par pysatellites sera très probablement aussi intéressée par xplanet et celestia, pour de nombreux usages complémentaires. Certaines formules sont utilisées pour faciliter la simulation : - la méthode d'intégration de Runge-Kutta qui est d'ordre 4, beaucoup pkus efficace que al méthode d'Euler - un calcul des paramètres de la trajectoire à partir des données connues dès le lancement : énergie mécanique, grand axe, excentricité, période, etc. Le fondement théorique des méthodes emplyées est décrit dans le fichier methodes.tm, qui s'ouvre à l'aide du logiciel libre TexMacs. pysatellites-2.1.orig/rectangle_sensible.py0000755000175000017500000000605511012562310021435 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- from PyQt4.QtGui import * from PyQt4.QtCore import * from debug import Debug class Rs(QWidget): def __init__(self, parent, geometry=None, image=None, text=None, color=QColor("grey"), debuglevel=0, onPress=None, onRelease=None, onDoubleClick=None, onMove=None, debugger=Debug(0)): QWidget.__init__(self,parent) if geometry==None: # le widget recouvrira le parent if parent!=None: self.setGeometry(QRect(0,0,parent.width(),parent.height())) else: self.setGeometry(QRect(0,0,100,100)) else: self.setGeometry(geometry) self.setMouseTracking(True) self.image=image self.text=text self.color=color self.debug=debugger self.onPress=onPress self.onRelease=onRelease self.onDoubleClick=onDoubleClick self.onMove=onMove def mousePressEvent(self,ev): if self.onPress != None: return self.onPress(ev) else: self.debug(9, "event onPress still to implement") def mouseReleaseEvent(self,ev): if self.onRelease != None: return self.onRelease(ev) else: self.debug(9, "event onRelease still to implement") def mouseMoveEvent(self,ev): if self.onMove != None: return self.onMove(ev) else: self.debug(9, "event onMove still to implement ... x=%s, y=%s" %(ev.x(),ev.y())) def mouseDoubleClickEvent(self,ev): if self.onDoubleClick != None: return self.onDoubleClick(ev) else: self.debug(9, "event onDoubleClick still to implement") def paintEvent(self, event): QWidget.paintEvent(self,event) self.painter = QPainter() self.painter.begin(self) if self.color !=None: self.painter.fillRect(QRect(0,0,self.width(),self.height()), self.color) if self.image != None: self.painter.drawImage(0,0,self.image) if self.text != None: self.painter.drawText(0,0,self.text) self.painter.end() class RsImage(Rs): """Une classe dérivée du rectangle sensible Rs, qui contient une image et se place en x,y sur le parent """ def __init__(self, parent, x, y, image, text=None, color=QColor("grey"), onPress=None, onRelease=None, onDoubleClick=None, onMove=None, debugger=Debug(0)): rect=QRect(x,y,image.size().width(), image.size().height()) Rs.__init__(self, parent, rect, image=image, text=None, color=color, onPress=onPress, onRelease=onRelease, onDoubleClick=onDoubleClick, onMove=onMove, debugger=debugger) pysatellites-2.1.orig/authors0000755000175000017500000000015711012562310016640 0ustar georgeskgeorgeskJean-Baptiste BUTET Bastien Georges Khaznadar pysatellites-2.1.orig/matplotlib_widget.py0000755000175000017500000000521011346172532021324 0ustar georgeskgeorgesk# embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases # # Copyright (C) 2005 Florent Rougon # 2006 Darren Dale # # This file is an example program for matplotlib. It may be used and # modified with no restriction; raw copies as well as modified versions # may be distributed without limitation. import sys, os, random from PyQt4 import QtGui, QtCore from numpy import arange, sin, pi from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt4.QtCore import * from PyQt4.QtGui import * from UI_graphe import Ui_Graphe progname = os.path.basename(sys.argv[0]) progversion = "0.1" class MyMplCanvas(FigureCanvas): """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.).""" def __init__(self, parent, donnees, traitement, dates, width=0, height=0, dpi=100, cliquable=False, titre=""): self.fig = Figure(figsize=(width, height), dpi=dpi ) FigureCanvas.__init__(self, self.fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self) self.axes = self.fig.add_subplot(111) a = self.axes.set_axis_off() # We want the axes cleared every time plot() is called self.axes.axison = False self.axes.axis('off') self.axes.hold(False) self.cliquable=cliquable self.donnees=donnees self.traitement=traitement self.dates=dates self.titre=titre self.plot(donnees, traitement, dates) def mouseReleaseEvent(self, event): if self.cliquable: self.fils=QDialog() self.fils.ui=Ui_Graphe() self.fils.ui.setupUi(self.fils) self.fils.setWindowTitle(QtGui.QApplication.translate("Graphe", self.titre, None, QtGui.QApplication.UnicodeUTF8)) self.fils.show() ratio=2 w=3*ratio h=5*ratio d=90/ratio self.fils.canvas=MyMplCanvas(self.fils.ui.grapheLabel,self.donnees, self.traitement, self.dates, width=w, height=h, dpi=d, cliquable=False, titre=self.titre) self.fils.canvas.show() def sizeHint(self): w, h = self.get_width_height() #print "w, h", w, h return QtCore.QSize(w, h) def minimumSizeHint(self): return QtCore.QSize(10, 10) def plot(self,donnees, traitement, dates): d=[] for dd in donnees: d.append(traitement(dd)) self.axes.plot(dates,d) pysatellites-2.1.orig/__pycache__/0000755000175000017500000000000011773533425017455 5ustar georgeskgeorgeskpysatellites-2.1.orig/__pycache__/traj_satellite.cpython-32.pyc0000644000175000017500000004650611773533425025120 0ustar georgeskgeorgeskl Oc@sddlTddlTddlTddlTddlmZddlZddlZddlZddl m Z ddl Z ddl m Z ddlmZdZdZd ZGd d eZd Zd ZGdde ZGddeZdS(i(u*(uPointN(u MyMplCanvas(uRs(uDebugcCsid}yt|}Wn*tk rBtt|ft}YnXtt||ft}||d vecteur accélération) cs d|dd|ddd|ddd|ddddd|dd|ddd|ddd|ddddd|dd|ddd|ddd|ddddfS( NgmaU=iiig?gmaUҽgmaUҽgmaUҽ((ux(ux0um(uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudsWW((ux0um((ux0umuL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu nouvChampGrav]scBs2|EeZdZdZdZdZdS(cCsNtj|||_td||j|_||_||_|jdS(u Les paramètres sont : dt : intervalle de temps t : durée totale de la simulation y0 : vecteur à 6 composantes (position, vitesse initiales) champ : une fonction donnant l'accélération à partir de la position iN(uQObjectu__init__udtuarangeutuy0uchampucalcul(uselfudtutuy0uchamp((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu__init__is     cCs|g}g}x3|jD](}|j|d|j|dqW||_||_t|j|jtdtdS(Niiuequal(upvuappenduxuyuplotuaxisushow(uselfuxuyupoint((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudessinews   cCsG|j|dd}|d|d|d|d|d|dfS(uLcalcul de la dérivée du vecteur à 6 composantes position,vitesse iiiiii(uchamp(uselfuxutug((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyuderivsscCs"t|j|j|j|_dS(ulance le calcul de la trajectoire à l'aide de l'algorithme de Runge-Kutta qui est d'ordre 4 et rapide en même temps. le résultat est dans self.pv, qui est une liste contenant les 6-uplets position, vitesse. N(urk4uderivsuy0utupv(uself((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyucalculsN(u__name__u __module__u__init__udessineuderivsucalcul(u __locals__((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu trajectoirehs   u trajectoirecCs-d}x|D]}||d7}q W|dS(Niig?((unupletusux((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu calculeNormes cs!dkrfdSdSdS(Nics|S(N((unuplet(un(uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyusg((un((unuL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu projections  cBs|EeZeddZddZdZdZdZdZdZ d Z d Z d dd Z d ZdZdZdZdZdZdS(icCstj||d|||_||_|jd|_|jd|_|j|_|j di|_ i|_ g|_ g|_ d|_d|_d|_d|_d|_d|_dS( NudebuggerigjXAiig?g@Ag(uRsu__init__uparentumainWinuwidthumilieuXuheightumilieuYurepu setEchelleupointsuplanetesuvitesseudateudtuNoneuwidget_vit_normu widget_vitxu widget_vityuboumutraj(uselfuparentu rayon_astreumainWinudebugger((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu__init__s"             umppxcCs|dkr/||_|jdd|jnk|dkr||jd|_|jdd||jf|jdd|jn|jdd |d S( u Régle l'échelle, selon le mode choisi. mode=mppx : échelle en mètre par pixel mode=max : l'échelle sera ajustée pour que le point (0,val) soit dans la fenêtre de trajectoire (à 95% du maximum) umppxi uÉchelle %s px/m (mode direct)umaxgffffff?u%s m pour %s pxuÉchelle %s px/m (mode max)iu,Le mode %s ne convient pas pour setEchelle()N(uechelleudebugumilieuY(uselfuvalumode((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu setEchelles   cCs|j|jjjjr<|j|jddntj}t|j |j |j |j |j |_|jdd|j |j |j |j |j f|jddtj||j|jdS(Ni u&efface la trajectoire depuis un lancéiu%s, %s, %s, %siucalcul en %s secondes(ucalcul_parametreumainWinuuiucheckBox_effaceu isCheckedueffaceudebugutimeu trajectoireudtutuposuvitugAstreutrajudessine_trajectoireugrapheV(uselfua((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyulances   +3 cCsc|jdkr|jjn|jdkr>|jjn|jdkr]|jjnt|jjj|j t |j dddddddddd |_ t|jjj|j td |j dddddddddd |_t|jjj|j td |j dddddddddd |_|j j|jj|jjdS(Nuwidthiuheightiudpiiu cliquableutitreuNorme de la vitesseiuAbscisse de la vitesseiuOrdonnée de la vitesseT(uwidget_vit_normuNoneuhideu widget_vitxu widget_vityu MyMplCanvasumainWinuuiulabel_vit_normuvitesseu calculeNormeudateuTrueuwidget_vit_normeu label_vitxu projectionu label_vityushow(uself((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyugrapheVsEKK  cCs|jj|_|jj|_|jj\|_|_d|_d|jd|jd}|j |j|j}||}|dkrE|j dd|t j dddt j }t j dd dt j }tj|||dd}|dkr<d |jd |j|jd|_|jd |_qtnP|j |jd|}dt|d |j|jd|_|jd |_|j dd|jtd|j|_d|jdf|_|j|jdf|_dS(NgjW=g?iiiuOL'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pasu MainWindowuCe n'est pas un satelliteuL'énergie mécanique initiale est positive, l'objet lancé échappera à l'attraction de l'astre. Voulez-vous tracer une partie de la trajectoire ?iiidiiumasse astre %sg(iii(umainWinu getMasseAstreu masse_astreugetDistanceAstreudistance_astreu getVitesseu vitesse_xu vitesse_yuGudebugu QApplicationu translateuNoneu UnicodeUTF8u QMessageBoxuquestionutudtu ValueErrorupiu nouvChampGravugAstreuposuvit(uselfu Ec_massiqueu Ep_massiqueu Em_massiqueutuquretua((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyucalcul_parametres.    & 'cCs|jdd|j|jj|j|jj}|j| r|jdk rtjdddtj }tjdddtj }t j |||dd}|dkr|j |d |j|j|jjqndS( Ni udessine la trajectoireiu MainWindowuChangement d'échelleuCUn dépassement a été détecté. Voulez-vous changer d'échelle ?iiumax(udebugudessineutrajupvu maxDistanceusurementVisibleuboumu QApplicationu translateuNoneu UnicodeUTF8u QMessageBoxuquestionu setEchelleuefface(uselfurutuquret((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudessine_trajectoire s   cCsmd}x`|D]X}t|d|kr<t|d}nt|d|kr t|d}q q W|S(ufrenvoie la distance max entre le centre et le satellite en projection sur le plan xy. ii(ufabs(uselfupoints_vitessesurupv((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu maxDistances cCs||j|jkS(u5vrai si un cercle de rayon r est visible à coup sûr(uechelleumilieuY(uselfur((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyusurementVisible$scCsQx8|jjD]'}|j|}|j|jqWi|_g|_dS(N(upointsukeysuhideuclearuvitesse(uselfukuobjet((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyuefface(s    upetitcCs|r|||f}n ||f}||jjkr]|j|}|j|jnt|||f|d|jd||j|<|j|jdS(Nuu type_de_point(upointsukeysuhideuclearuPointumainWinushow(uselfuxuyucouleurutypeutauucleuobjet((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu trace_point0s    .c Csd|_d}|jjjj}ttj||_ |j dkrTd}ng|_ g|_ d}xt dt|dD]}||}t|d|j|j}t|d |j|j}|j j|d|df|j j|j|||jd||jdd t|jj|jkrt|j||d d d |j||_Pn|j||d |ry^||j|j } t| t|kr|j||d d dd| t| }nWqtk rYqXn|jqW|jdS(Ng?i<ii iiiig?uredutypeuboumublueugrosutaugFT(uboumuFalseumainWinuuiu intervaleutextuintuflottantutraduitutauuTrueuvitesseudateurangeulenuechelleumilieuXumilieuYuappendudtu getRayonAstreu trace_pointuAttributeErrorurepaintuupdate( uselfupoints_vitessesuOKtauu intervalleu tau_entieruiupvupix_xupix_yutau((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudessine>s<     @ cCsAt}|j||jtj|jtjt|jj |j }|j |j d|j |j d|j d|j d|j |j |j}tdddd}|jjd|_ |jjd|_ t|j ||j |d|d|}|j||j||||jdS(Niii(uQPainterubeginusetBrushuQtu CrossPatternusetPenugreenuintumainWinu getRayonAstreuechelleudrawLineumilieuXumilieuYuastreImguQRectusizeuwidthuheightu drawEllipseu drawImageuend(uselfueventupainterurayonuimgu sourcerectu targetrect((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyu paintEventfs  ## + cCs|jj|S(N(urepuchemin(uselfuchoix((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudirzscCs|jj||dS(N(umainWinudebug(uselfulevelumsg((uL/home/georgesk/developpement/pysatellites/pysatellites-2.0/traj_satellite.pyudebug}scCs||jjkrtjd\}}tj|d||jd|f}|jdd|tj|t ||j|s"    $  ( " 0  pysatellites-2.1.orig/__pycache__/mainWindow.cpython-32.pyc0000644000175000017500000002600311773533343024213 0ustar georgeskgeorgeskl Oc@s dZdZddlZddlZddlTddlTddlmZddlmZddl m Z ddl m Z m Z mZmZdd lmZdd lmZdd lmZdd lmZdd lmZddlZddlmZGddeZdS(u2 code pour la fenêtre principale de pysatellites ub the file mainWindow.py is part of the package pysatellites. Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . iN(u*(uglob(u Ui_MainWindow(u Trajectoire(upiucosusinufabs(uastreNom(uPoint(u MyMplCanvas(u repertoire(uCinema(uDebugcBs|EeZdedddZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdS(icCsItj|tj||||_||_t|_|jj||dkrpt t j d|_ n ||_ t |jjd|d|j|_|j|jjjtjdddtj|jjjtjdddtjtj|j jdtd|_|j|jd|_d|_dS( Niiudebuggeru MainWindowu6x10^24u6400udefautuicones/sat_mini.gif( u QMainWindowu__init__uQWidgetudebuguappu Ui_MainWindowuuiusetupUiuNoneu repertoireusysuargvurepu Trajectoireu afficheuru trajectoireu initAstresu masse_astreusetTextu QApplicationu translateu UnicodeUTF8u rayon_astreuosuchdirucheminuQPixmapu image_satuconnexions_signauxu placeDepartu cinemaThreaduprogress(uselfuparenturepudebuggeruapp((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu__init__,s&      $ ((   cCstj|jjjdS(Ni(uflottantutraduituuiu rayon_astreutext(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu getRayonAstreCscCs|jjd}tj|jjjtj|jjjd}|jj|dtj|jj j}tj|jj j}|jj ||d||dfg|jj dS(ul place la croix à la position de départ du satellite et figure le vecteur vitesse iiumaxN( u trajectoireueffaceuflottantutraduituuiu rayon_astreutextualtitude_objetu setEchelleuvitesse_tangentielle_objetuvitesse_normale_objetudessineuupdate(uselfuxuyuvxuvy((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu placeDepartFs 8%cCs}x:tD]2}|jjjtjd|ddtjqW|jjjd|jjj dd|_ |j ddS(u8 Peuple le combo avec les noms d'astres u MainWindowiuearthNF( uastreNomuuiu astreCombouaddItemu QApplicationu translateuNoneu UnicodeUTF8u setEditableuFalseusetCurrentIndexu astreCourantu choisi_astre(uselfua((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu initAstresUs  0 cCsAtj|jjtd|jjtj|jjtd|jtj|jj td|j tj|jj td|j tj|jj td|jtj|jjtd|jt|}tj|td|j|jd|jjjd|jjjd|jjjddS(Nu clicked()ueditingFinished()ucurrentIndexChanged(int)u toggled(bool)u timeout()iT(uQObjectuconnectuuiu Bouton_LanceruSIGNALu trajectoireulanceu Button_effaceuefface_trajectoireu bouton_videoucinemaualtitude_objetu placeDepartu astreCombou choisi_astreuradioButton_Frenetuchoisi_coordooneesuQTimeruroutinesustartumTerreu setReadOnlyuTrueurTerreu auSujetAstre(uselfutimer((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuconnexions_signaux`s%"""""  cCsdS(N((uselfuint((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuchange_comportement_effacegeqscCs|jj|jdS(N(u trajectoireueffaceu placeDepart(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuefface_trajectoirets c Cs|jdkr"|jjr"dSddl}ddl}ddlm}|jddd}|j}|jj dkr|d|jj |jj }d}t j dddt j}t j dd dt j}t j dd dt j} t|| dt|||_|jj||jjd|jjt|j|j|||j|jj jd d |d |jjd|j|_|jjndS(Ni(uarangeiiii u MainWindowuCalcul de la vidéouAvancement ...uArrêtu380x240upasuboumudebugger(u cinemaThreaduNoneuisAliveudatetimeucopyunumpyuarangeutodayu trajectoireutrajutudtu QApplicationu translateu UnicodeUTF8uQProgressDialogulenuprogressusetWindowTitleusetValueushowuCinemaurepu astreCourantupvuboumudebugustart( uselfudatetimeucopyuarangeudateu liste_tempsupasutitreulegendeuechap((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyucinemaxs. " cCs|jdkr|jjr|jj|jj|jjr_|jjd|j_ n|jj r|jj|jj d|jr|jjqqndS(NiT( u cinemaThreaduNoneuisAliveuprogressusetValueunbImageu wasCanceleducloseuTrueufiniumaximum(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuroutiness   cCstj|jjjS(N(uflottantutraduituuiu masse_astreutext(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu getMasseAstrescCs6tj|jjjtj|jjjdS(Ni(uflottantutraduituuiu rayon_astreutextualtitude_objet(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyugetDistanceAstrescCs4tj|jjjtj|jjjfS(N(uflottantutraduituuiuvitesse_tangentielle_objetutextuvitesse_normale_objet(uself((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu getVitessescCs|jjjdkrk|jjjtjdddtj |jj jtjdddtj nk|jjjdkr|jjjtjdddtj |jj jtjdddtj ndS(Nu MainWindowuVitesse selon OxuVitesse selon OyuVitesse TangentielleuVitesse NormaleTF( uuiuradioButton_Cartesiennesu isCheckeduTrueulabel_V1usetTextu QApplicationu translateuNoneu UnicodeUTF8ulabel_V2uFalse(uselfubool((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuchoisi_coordooneess (+(c Cstdd}tdd}|jjj}xtD]~}|d|kr5|jj|d|d|_|d}|d}|jjjt j d|dt j |jj jt j d|dt j tj|tj|}tj|tj|} d|}d| } |jjjt j d|dt j |jjjt j d| dt j |jjjt j d|ddt j |j|jjdSq5W|jdd |dS( u choisit un astre parmi la liste disponible, sur la base du texte couramment sélectionné dans le combo @param int non utiliséé iiiiu MainWindowu%5giNuAstre inconnu : %s(uastreNomuuiu astreCombou currentTextu trajectoireu choisi_astreu astreCourantu masse_astreusetTextu QApplicationu translateuNoneu UnicodeUTF8u rayon_astreuflottantutraduitumTerreurTerreu auSujetAstreu placeDepartuupdateudebug( uselfuintumt0urt0uastreuau masse_astreu rayon_astreumturt((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyu choisi_astres,    ((  ((,  N(u__name__u __module__uNoneuDebugu__init__u getRayonAstreu placeDepartu initAstresuconnexions_signauxuchange_comportement_effacegeuefface_trajectoireucinemauroutinesu getMasseAstreugetDistanceAstreu getVitesseuchoisi_coordooneesu choisi_astre(u __locals__((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyuStartQT4+s           uStartQT4(u__doc__ulicenceusysuosu PyQt4.QtCoreu PyQt4.QtGuiuglobuUI_pysatu Ui_MainWindowutraj_satelliteu TrajectoireumathupiucosusinufabsuastresuastreNomupointuPointumatplotlib_widgetu MyMplCanvasu repertoireuvideouCinemauflottantudebuguDebugu QMainWindowuStartQT4(((uH/home/georgesk/developpement/pysatellites/pysatellites-2.0/mainWindow.pyus   " pysatellites-2.1.orig/__pycache__/debug.cpython-32.pyc0000644000175000017500000000155411773533266023175 0ustar georgeskgeorgeskl Oc@sGddZdS(cBs |EeZdZdZdS(cCs ||_dS(N(u debugLevel(uselfu debugLevel((uC/home/georgesk/developpement/pysatellites/pysatellites-2.0/debug.pyu__init__scCs |j|krt|ndS(N(u debugLeveluprint(uselfulevelumsg((uC/home/georgesk/developpement/pysatellites/pysatellites-2.0/debug.pyu__call__sN(u__name__u __module__u__init__u__call__(u __locals__((uC/home/georgesk/developpement/pysatellites/pysatellites-2.0/debug.pyuDebugs  uDebugN(uDebug(((uC/home/georgesk/developpement/pysatellites/pysatellites-2.0/debug.pyuspysatellites-2.1.orig/__pycache__/UI_pysat.cpython-32.pyc0000644000175000017500000003110111773533343023627 0ustar georgeskgeorgeskl Oc @s[ddlmZmZyejjZWnek rCdZYnXGddeZdS(i(uQtCoreuQtGuicCs|S(N((us((uF/home/georgesk/developpement/pysatellites/pysatellites-2.0/UI_pysat.pyuscBs |EeZdZdZdS(cCs|jtd|jddtj||_|jjtdtj|j|_|jjtdtj|j|_ tj tj j tj j }|j d|j d|j|j jj|j j||j jtjdd|j jdI|j jtd |j jtjj|j jtjj|j jd |j jtd |j jtd |jj|j tj|j|_ tj tj j!tj j"}|j d|j d|j|j jj|j j||j j#tjd d |j jtjj$|j jtjj|j jtdtj%|j |_&|j&jtdtj'|j |_(|j(jtdtj)|j(|_*|j*jtdtj|j(|_+|j+jtd|j*j,dtj)j-|j+tj.|j(|_/|j/jtd|j*j,dtj)j0|j/tj|j(|_1|j1jtd|j*j,dtj)j-|j1tj.|j(|_2|j2jtd|j*j,dtj)j0|j2|j&j|j(tj'|j |_3|j3jtdtj)|j3|_4|j4jtdtj|j3|_5|j5jtd|j4j,dtj)j-|j5tj.|j3|_6|j6jtd|j4j,dtj)j0|j6tj|j3|_7|j7jtd|j4j,dtj)j-|j7tj.|j3|_8|j8jtd|j4j,dtj)j0|j8|j&j|j3tj'|j |_9|j9jtdtj:|j9|_;|j;jtdtj|j9|_<|j<jtd|j;j|j<ddddtj.|j9|_=|j=jtd |j;j|j=ddddtj|j9|_>|j>jtd!|j;j|j>ddddtj.|j9|_?|j?jtd"|j;j|j?dddd|j&j|j9tj'|j |_@tj tj j tj j"}|j d|j d|j|j@jj|j@j||j@jtd#tj:|j@|_A|jAjtd$tjB|j@|_C|jCjtd%|jAj|jCdddd&tj.|j@|_Dtj tj j tj jE}|j d|j d|j|jDjj|jDj||jDjtjd'd|jDjtd(|jAj|jDddddtj|j@|_F|jFjtd)|jAj|jFddddtj.|j@|_Gtj tj j tj jE}|j d|j d|j|jGjj|jGj||jGjtjd'd|jGjtd*|jAj|jGd&dddtjH|j@|_Itj tj jJtj j!}|j d|j d|j|jIjj|jIj||jIj#tjd d+|jIjtd,|jAj|jId ddd&tj|j@|_K|jKjtjdd|jKjtd-|jAj|jKd&ddd|j&j|j@tj'|j |_L|jLjtd.tj|jL|_M|jMjtd/tj|jL|_N|jNjtd0|jMj|jNtj.|jL|_O|jOjtd1|jMj|jOtj|jL|_P|jPjQtjRjS|jPjtd2|jMj|jP|j&j|jLtj'|j |_T|jTjtd3tj:|jT|_U|jUjtd4tjV|jT|_W|jWjtd5|jUj|jWddddtjV|jT|_X|jXjtd6|jUj|jXddddtjV|jT|_Y|jYjtd7|jUj|jYddddtjZ|jT|_[tj tj j tj jE}|j d|j d|j|j[jj|j[j||j[jtd8|jUj|j[dddd|j&j|jT|jj|j tj'|j|_\tj tj j!tj j"}|j d|j d|j|j\jj|j\j||j\j#tjd9d |j\jtd:tj%|j\|_]|j]jtd;tj^|j\|__|j_j`dI|j_jtd<|j]j|j_tj^|j\|_a|jaj`dJ|jajtd=|j]j|jatj|j\|_c|jcjtd>|j]j|jctj|j\|_dtj tj j tj j }|j d|j d|j|jdjj|jdj||jdjtjd?d@|jdjtjje|jdjtd |jdjtdA|j]j|jdtj|j\|_f|jfjtdB|j]j|jftj|j\|_gtj tj j tj j }|j d|j d|j|jgjj|jgj||jgjtjd?d@|jgjtjje|jgjtd |jgjtdC|j]j|jgtj|j\|_h|jhjtdD|j]j|jhtj|j\|_itj tj j tj j }|j d|j d|j|jijj|jij||jijtjd?d@|jijtjje|jijtd |jijtdE|j]j|jitj|j\|_j|jjjtdF|j]j|jj|jj|j\|jk|jtjl||_m|jmjtdG|jn|jm|jo|tjpjq|jXtjrtdH|j jstjtju|dS(KNu MainWindowiiu centralwidgetuhorizontalLayout_2ii0iuiu afficheuriiuframeuverticalLayout_2u groupBox_3u formLayoutulabel_4u masse_objetulabel_5iualtitude_objetu groupBox_4u formLayout_2ulabel_6uvitesse_tangentielle_objetulabel_7uvitesse_normale_objetu groupBox_5u gridLayout_3ulabel_11u masse_astreulabel_10u rayon_astreugroupBoxu gridLayout_2u astreComboiidumTerreulabel_12urTerrei.u auSujetAstreulabel_13u groupBox_8uhorizontalLayoutulabel_2u intervaleulabel_20u groupBox_7u gridLayoutu Bouton_Lanceru Button_effaceu bouton_videoucheckBox_effaceiu groupBox_2uverticalLayouturadioButton_CartesiennesuradioButton_Frenetulabel_V1ieiu label_vitxulabel_V2u label_vityulabel_14ulabel_vit_normulabelu statusbaru pressed()TF(vu setObjectNameu _fromUtf8uresizeuQtGuiuQWidgetu centralwidgetu QHBoxLayoutuhorizontalLayout_2uQLabelu afficheuru QSizePolicyuMinimumusetHorizontalStretchusetVerticalStretchusetHeightForWidthu sizePolicyuhasHeightForWidthu setSizePolicyusetMinimumSizeuQtCoreuQSizeusetAutoFillBackgrounduTrueu setStyleSheetu setFrameShapeuQFrameuPanelusetFrameShadowuRaisedu setLineWidthusetTextu addWidgetuframeuMaximumu PreferredusetMaximumSizeu StyledPanelu QVBoxLayoutuverticalLayout_2u QGroupBoxu groupBox_3u QFormLayoutu formLayoutulabel_4u setWidgetu LabelRoleu QLineEditu masse_objetu FieldRoleulabel_5ualtitude_objetu groupBox_4u formLayout_2ulabel_6uvitesse_tangentielle_objetulabel_7uvitesse_normale_objetu groupBox_5u QGridLayoutu gridLayout_3ulabel_11u masse_astreulabel_10u rayon_astreugroupBoxu gridLayout_2u QComboBoxu astreComboumTerreuFixedulabel_12urTerreu QTextEditu auSujetAstreu Expandingulabel_13u groupBox_8uhorizontalLayoutulabel_2u intervaleulabel_20u setAlignmentuQtu AlignCenteru groupBox_7u gridLayoutu QPushButtonu Bouton_Lanceru Button_effaceu bouton_videou QCheckBoxucheckBox_effaceu groupBox_2uverticalLayoutu QRadioButtonuradioButton_Cartesiennesu setCheckeduradioButton_FrenetuFalseulabel_V1u label_vitxuBoxulabel_V2u label_vityulabel_14ulabel_vit_normulabelusetCentralWidgetu QStatusBaru statusbaru setStatusBaru retranslateUiuQObjectuconnectuSIGNALuclearu QMetaObjectuconnectSlotsByName(uselfu MainWindowu sizePolicy((uF/home/georgesk/developpement/pysatellites/pysatellites-2.0/UI_pysat.pyusetupUis                       .cCsc|jtjjdddtjj|jjtjjdddtjj|jj tjjdddtjj|j j tjjdddtjj|j j tjjdddtjj|j j tjjdddtjj|j jtjjdddtjj|jj tjjdd dtjj|jj tjjdd dtjj|jj tjjdd dtjj|jj tjjdd dtjj|jjtjjdd dtjj|jj tjjdddtjj|jj tjjdddtjj|jj tjjdddtjj|jjtjjdddtjj|jj tjjdddtjj|jj tjjdddtjj|jjtjjdddtjj|jj tjjdddtjj|jj tjjdddtjj|jjtjjdddtjj|jj tjjdddtjj|jjtjjdddtjj|jj tjjdddtjj|j j tjjdddtjj|j!j tjjdddtjj|j"j tjjdddtjj|j#jtjjdddtjj|j$j tjjdddtjj|j%j tjjdddtjj|j&j tjjdd dtjj|j'j(tjjdd!dtjj|j)j tjjdd"dtjj|j*j(tjjdd!dtjj|j+j tjjdd#dtjj|j,j(tjjdd!dtjj|j-j tjjdd$dtjjdS(%Nu MainWindowu:pySatellite, simulateur de trajectoire plane de satellitesu Objet lancéu Masse (kg)u100u altitude (km)u1000uVitesses au départ (m/s)uVx (tangentielle)u-4000u Vy (normale)u0u Astre définiu6*10^24u Rayon (km)u Astres connusu M. terrestresu R. terrestresuVisualiser le satelliteu chaque ...u3600utemps entre chaque pointusuActionsuLancer l'objetuEffaceruVidéou chaque foisuVitessesucoord. cartésiennesurepère de frénetuVitesse selon OXuCliquez pour agrandiruVitesse selon OYuNorme de la vitesseu(Cliquez pour agrandir)(.usetWindowTitleuQtGuiu QApplicationu translateuNoneu UnicodeUTF8u groupBox_3usetTitleulabel_4usetTextu masse_objetulabel_5ualtitude_objetu groupBox_4ulabel_6uvitesse_tangentielle_objetulabel_7uvitesse_normale_objetu groupBox_5ulabel_11u masse_astreulabel_10ugroupBoxulabel_12ulabel_13u groupBox_8ulabel_2u intervaleulabel_20usetAccessibleDescriptionu groupBox_7u Bouton_Lanceru Button_effaceu bouton_videoucheckBox_effaceu groupBox_2uradioButton_CartesiennesuradioButton_Frenetulabel_V1u label_vitxu setToolTipulabel_V2u label_vityulabel_14ulabel_vit_normulabel(uselfu MainWindow((uF/home/georgesk/developpement/pysatellites/pysatellites-2.0/UI_pysat.pyu retranslateUisL(++++++++++++++++++++++++++++++++++++N(u__name__u __module__usetupUiu retranslateUi(u __locals__((uF/home/georgesk/developpement/pysatellites/pysatellites-2.0/UI_pysat.pyu Ui_MainWindows  u Ui_MainWindowN( uPyQt4uQtCoreuQtGuiuQStringufromUtf8u _fromUtf8uAttributeErroruobjectu Ui_MainWindow(((uF/home/georgesk/developpement/pysatellites/pysatellites-2.0/UI_pysat.pyu s  pysatellites-2.1.orig/traj_satellite.py0000755000175000017500000003734211773533423020637 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- # Résolution numérique d'un problème à un corps soumis à un # potentiel newtonien (en 1/r^2) # d'équa. diff. vec{r}'' = -k/m vec{r}/r^3 # le vecteur de données considéré sera le vecteur (x, y , vx, vy) # dont la dérivée est (vx, vy, -k/m*x/(x^2+y^2)^3/2, -k/m*y/(x^2+y^2)^3/2) from numpy import * from pylab import * from PyQt4.QtCore import * from PyQt4.QtGui import * from point import Point import os, tempfile, time from matplotlib_widget import MyMplCanvas import flottant from rectangle_sensible import Rs from debug import Debug def rk4(derivs, y0, t): """ C'est le code de rk4 pris dans le module matplotplib. Liste des paramètres d'entrée derivs : une fonction qui accepte en entrée un 6-uplet position,vitesse et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. y0 : un 6-uplet représentant la position et la vitesse initiales t : une liste de dates régulièrement espacées pour lesquelles on veut construire les points et vitessesde la trajectoire Résultat de la fonction : une liste de 6-uplets représentant les positions et vitesses aux instants de la liste des dates données. """ Float=0.0 try: Ny = len(y0) except TypeError: yout = zeros( (len(t),), float) else: yout = zeros( (len(t), Ny), float) yout[0] = y0 i = 0 for i in arange(len(t)-1): thist = t[i] dt = t[i+1] - thist dt2 = dt/2.0 y0 = yout[i] k1 = asarray(derivs(y0, thist)) k2 = asarray(derivs(y0 + dt2*k1, thist+dt2)) k3 = asarray(derivs(y0 + dt2*k2, thist+dt2)) k4 = asarray(derivs(y0 + dt*k3, thist+dt)) yout[i+1] = y0 + dt/6.0*(k1 + 2*k2 + 2*k3 + k4) return yout def euler(derivs, y0, t): """ C'est le code de la méthode d'Euler, qui est d'ordre 1 et très simple. Liste des paramètres d'entrée derivs : une fonction qui accepte en entrée un 6-uplet position,vitesse et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. y0 : un 6-uplet représentant la position et la vitesse initiales t : une liste de dates régulièrement espacées pour lesquelles on veut construire les points et vitessesde la trajectoire Résultat de la fonction : une liste de 6-uplets représentant les positions et vitesses aux instants de la liste des dates données. """ try: Ny = len(y0) except TypeError: yout = zeros( (len(t),), Float) else: yout = zeros( (len(t), Ny), Float) yout[0] = y0 i = 0 for i in arange(len(t)-1): thist = t[i] dt = t[i+1] - thist y0 = yout[i] k1 = asarray(derivs(y0, thist)) yout[i+1] = y0 + dt*k1 return yout def nouvChampGrav(x0,m): """Cette fonction renvoie une fonction anonyme représentant un champ gravitationnel créé par un objet de masse m immobile aux coordonnées spécifiées par x0. le profil de la fonction résultat est : (vecteur position -> vecteur accélération) """ return lambda x: (-6.67e-11*m*(x[0]-x0[0])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, -6.67e-11*m*(x[1]-x0[1])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, -6.67e-11*m*(x[2]-x0[2])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**(1.5)) class trajectoire(QObject): def __init__(self,dt,t,y0, champ): """Les paramètres sont : dt : intervalle de temps t : durée totale de la simulation y0 : vecteur à 6 composantes (position, vitesse initiales) champ : une fonction donnant l'accélération à partir de la position """ QObject.__init__(self) self.dt = dt self.t = arange(0,t,self.dt) self.y0 = y0 self.champ=champ self.calcul() def dessine(self): x=[] y=[] for point in self.pv : x.append(point[0]) y.append(point[1]) self.x = x self.y = y plot(self.x,self.y) # le dessin est en projection dans le plan x,y axis('equal') show() def derivs(self,x,t): """calcul de la dérivée du vecteur à 6 composantes position,vitesse """ g = self.champ(x[0:3]) # le champ de gravité return (x[3], # vitesse x x[4], # vitesse y x[5], # vitesse z g[0], # acceleration x g[1], # acceleration y g[2]) # acceleration z def calcul(self): """lance le calcul de la trajectoire à l'aide de l'algorithme de Runge-Kutta qui est d'ordre 4 et rapide en même temps. le résultat est dans self.pv, qui est une liste contenant les 6-uplets position, vitesse. """ self.pv = rk4(self.derivs, self.y0, self.t) def calculeNorme(nuplet): s=0 for x in nuplet: s+=x**2 return s**0.5 def projection(n): if n >=0: return lambda nuplet:nuplet[n] else: return 0.0 class Trajectoire(Rs): def __init__(self, parent, rayon_astre, mainWin, debugger=Debug(0)): Rs.__init__(self, parent, debugger=debugger) self.parent = parent self.mainWin=mainWin self.milieuX=self.width()/2 self.milieuY=self.height()/2 self.rep= mainWin.rep #self.setFrameShape(QFrame.Box) self.setEchelle(6.4e6/25) self.points={} self.planetes={} self.vitesse=[] self.date=[] self.dt=1 self.widget_vit_norm=None self.widget_vitx=None self.widget_vity=None self.boum=-1.0 self.traj=None def setEchelle(self,val, mode="mppx"): """ Régle l'échelle, selon le mode choisi. mode=mppx : échelle en mètre par pixel mode=max : l'échelle sera ajustée pour que le point (0,val) soit dans la fenêtre de trajectoire (à 95% du maximum) """ if mode=="mppx": self.echelle=val self.debug(9,"Échelle %s px/m (mode direct)" %self.echelle) elif mode=="max": self.echelle=val/self.milieuY/0.95 self.debug(9,"%s m pour %s px" %(val,self.milieuY)) self.debug(9,"Échelle %s px/m (mode max)" %self.echelle) else: self.debug(0,"Le mode %s ne convient pas pour setEchelle()" %mode) def lance(self): self.calcul_parametre() if self.mainWin.ui.checkBox_efface.isChecked() : self.efface() self.debug(10,"efface la trajectoire depuis un lancé") a=time.time() self.traj= trajectoire(self.dt, self.t, self.pos+self.vit, self.gAstre) self.debug(8, "%s, %s, %s, %s" %(self.dt, self.t, self.pos+self.vit, self.gAstre)) self.debug(5,"calcul en %s secondes" %(time.time()-a)) self.dessine_trajectoire() #dessine les vitesses self.grapheV() def grapheV(self): if self.widget_vit_norm != None: self.widget_vit_norm.hide() if self.widget_vitx != None: self.widget_vitx.hide() if self.widget_vity != None: self.widget_vity.hide() self.widget_vit_norme = MyMplCanvas(self.mainWin.ui.label_vit_norm,self.vitesse, calculeNorme, self.date, width=3, height=5, dpi=30, cliquable=True, titre="Norme de la vitesse") self.widget_vitx = MyMplCanvas(self.mainWin.ui.label_vitx,self.vitesse, projection(0), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Abscisse de la vitesse") self.widget_vity = MyMplCanvas(self.mainWin.ui.label_vity,self.vitesse, projection(1), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Ordonnée de la vitesse") self.widget_vit_norme.show() self.widget_vitx.show() self.widget_vity.show() def calcul_parametre(self): self.masse_astre = self.mainWin.getMasseAstre() self.distance_astre = self.mainWin.getDistanceAstre() self.vitesse_x,self.vitesse_y = self.mainWin.getVitesse() self.G=6.67259e-11 #calcul des énergies massiques (cinétique, potentielle, mécanique) Ec_massique=0.5*(self.vitesse_x**2+self.vitesse_y**2) Ep_massique=-self.masse_astre*self.G/self.distance_astre Em_massique=Ec_massique+Ep_massique if Em_massique >= 0: self.debug(1,"L'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pas" %Em_massique) t=QApplication.translate("MainWindow", "Ce n'est pas un satellite", None, QApplication.UnicodeUTF8) q=QApplication.translate("MainWindow", "L'énergie mécanique initiale est positive, l'objet lancé échappera à l'attraction de l'astre. Voulez-vous tracer une partie de la trajectoire ?", None, QApplication.UnicodeUTF8) ret=QMessageBox.question (self, t, q, 1, 2) if ret==1: self.t=30*(self.distance_astre**3/self.masse_astre/self.G)**0.5 self.dt=self.t/100 else: raise(ValueError) else: # calcul du grand axe a : Em = -k/2a pour une trajectoire elliptique # donc a = -k/2Em a = - self.masse_astre*self.G/2/Em_massique # calcul de la période, en utilisant la troisième loi de Kepler # T²=4pi²/MG*a³ self.t = 2*pi*(a**3/self.masse_astre/self.G)**0.5 self.dt = self.t/1000 self.debug(5,"masse astre %s" %self.masse_astre) self.gAstre = nouvChampGrav((0,0,0),self.masse_astre) self.pos = (0.0, self.distance_astre, 0) self.vit = (self.vitesse_x,self.vitesse_y,0.0) def dessine_trajectoire(self): self.debug(9,"dessine la trajectoire") self.dessine(self.traj.pv) # on teste si toute la trajectoire tien bien là. r=self.maxDistance(self.traj.pv) if not self.surementVisible(r) and not self.boum > 0: t=QApplication.translate("MainWindow", "Changement d'échelle", None, QApplication.UnicodeUTF8) q=QApplication.translate("MainWindow", "Un dépassement a été détecté. Voulez-vous changer d'échelle ?", None, QApplication.UnicodeUTF8) ret=QMessageBox.question (self, t, q, 1, 2) if ret==1: self.setEchelle(r,"max") self.efface() self.dessine(self.traj.pv) def maxDistance(self,points_vitesses): """renvoie la distance max entre le centre et le satellite en projection sur le plan xy. """ r=0 for pv in points_vitesses: if fabs(pv[0])>r: r=fabs(pv[0]) if fabs(pv[1])>r: r=fabs(pv[1]) return r def surementVisible(self,r): """vrai si un cercle de rayon r est visible à coup sûr""" return r/self.echelle < self.milieuY def efface(self): for k in self.points.keys(): objet=self.points[k] objet.hide() objet.clear() self.points = {} self.vitesse = [] def trace_point(self, x, y, couleur, type="petit", tau=None): if tau: cle=(x,y,tau) else: cle=(x,y) if cle in self.points.keys(): # efface des points préexistants de même emplacement objet=self.points[cle] objet.hide() objet.clear() self.points[cle]=Point(self, (x,y), couleur, "", self.mainWin,type_de_point=type) self.points[cle].show() def dessine(self,points_vitesses): self.boum=-1.0 OKtau=False intervalle=self.mainWin.ui.intervale.text() self.tau = int(flottant.traduit(intervalle)) if self.tau > 60: OKtau=True self.vitesse = [] self.date=[] tau_entier = 0 for i in range(0,len(points_vitesses),10): # on ne trace qu'un point sur 10, soit 100 points # sur les 1000 calculés pv=points_vitesses[i] pix_x=int(pv[0]/self.echelle+self.milieuX) pix_y=int(-pv[1]/self.echelle+self.milieuY) # pv est un hexuplet : 3 coordonnées de position, 3 de vitesse self.vitesse.append((pv[3],pv[4])) self.date.append(self.dt*i) if ((pix_x-self.milieuX)**2+(pix_y-self.milieuY)**2)**(0.5) < int(self.mainWin.getRayonAstre()/self.echelle) : self.trace_point(pix_x, pix_y, "red", type="boum") self.boum=self.dt*i break else: self.trace_point(pix_x, pix_y, "red") if OKtau: try : #dessine un point tous les "tau" secondes si défini. tau = i*self.dt/self.tau if int(tau) > int(tau_entier) : self.trace_point(pix_x, pix_y, "blue", type="gros", tau=tau) tau_entier=int(tau) except AttributeError: pass self.repaint() self.update() def paintEvent(self, event): painter = QPainter() painter.begin(self) painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) rayon=int(self.mainWin.getRayonAstre()/self.echelle) painter.drawLine(self.milieuX, 0, self.milieuX, self.milieuY*2) painter.drawLine(0,self.milieuY , 2*self.milieuX, self.milieuY) img=self.astreImg sourcerect=QRect(0,0,512,512) self.milieuX=self.size().width()/2 self.milieuY=self.size().height()/2 targetrect=QRect(self.milieuX-rayon,self.milieuY-rayon,2*rayon,2*rayon) #TODO : il faudrait redessiner le rectangle en fonction de l'échelle #TODO : la taille n'est pas bien calculée quand on redimensionne !!! painter.drawEllipse(targetrect) painter.drawImage(targetrect,img,sourcerect) painter.end() def dir(self,choix): return self.rep.chemin(choix) def debug(self,level,msg): self.mainWin.debug(level,msg) def getPlanete(self,nom): if nom not in self.planetes.keys(): handle, imageFile = tempfile.mkstemp(".png") os.close(handle) cmd="xplanet -latitude 90 -num_times 1 -glare 10 -body %s -radius 50 -searchdir %s -transpng %s -rotate -70" %(nom,self.dir("textures"),imageFile) # la rotation de -70° permet au méridiens français de se trouver # au centre de l'image. Cette valeur est empirique et dépend # probablement de l'implémentation de Xplanet. Il n'est pas # évident de jouer avec l'option -north qui seule permet de # contrôler totalement l'orientation de l'image. self.debug(8,"Création de l'image de planète par \"%s\"" %cmd) os.system(cmd) self.planetes[nom]=QImage(imageFile) os.system("rm -f %s" %imageFile) return self.planetes[nom] def choisi_astre(self,nom): self.astreImg= self.getPlanete(nom) class Satellite(QLabel): def __init__(self, parent, coord_sat, image): QLabel.__init__(self, parent) self.parent = parent self.coord_sat=coord_sat self.image = image def paintEvent(self, event): painter = QPainter() painter.setBrush(Qt.CrossPattern) painter.setPen(Qt.green) painter.begin(self) x, y = self.coord_sat.x(), self.coord_sat.y() self.debug(5,"%s,%s" %(x,y)) painter.drawEllipse(x,y,30,16) painter.drawPixmap(self.coord_sat, self.image) painter.end() pysatellites-2.1.orig/copying0000755000175000017500000010437411012562310016631 0ustar georgeskgeorgesk GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pysatellites-2.1.orig/flottant.py0000755000175000017500000000235111012562310017433 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- def traduit(chaine): """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" # on force le type chaîne pour pouvoir faire des évaluations. chaine=str(chaine).replace(" ","") # et retrait de tous les espaces #vérification de la présence d'un float correct, sinon tente des modifs. try : chaine=float(eval(chaine)) except : chaine=chaine.replace("10^","e") #remplace la chaine 10^ par e else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "x" pour la multiplication chaine=chaine.replace("x","*") chaine=chaine.replace("X","*") else: return chaine try : chaine=float(eval(chaine)) except : #remplace les "*" devant un "e" chaine=chaine.replace("*e","e") else: return chaine try : chaine=float(eval(chaine)) except : #self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) return 1.0 else: return chaine return 1.0 pysatellites-2.1.orig/repertoire.py0000755000175000017500000000175711030455364020003 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- import os.path class repertoire: def __init__(self, chemin): self.chemin0=os.path.abspath(chemin) if os.path.isfile(self.chemin0): self.chemin0=os.path.dirname(self.chemin0) def chemin(self,choix="defaut"): if choix=="defaut": return self.chemin0 if choix=="textures": for d in [os.path.join(self.chemin0,"images"), "/usr/share/celestia/textures/medres"]: if os.path.exists(d+'/earth.png'): return d print "erreur : pas de répertoire des planètes" print "=== Il faudrait installer Celestia ===" raise(IOError) elif os.path.isdir(os.path.join(self.chemin0,choix)): return os.path.join(self.chemin0,choix) else: raise(IOError) def fichier(self,*elementsDeChemin): f=self.chemin0 for e in elementsDeChemin: f=os.path.join(f,e) return f pysatellites-2.1.orig/pysat.ui0000755000175000017500000003650711346154233016752 0ustar georgeskgeorgesk MainWindow 0 0 1005 690 pySatellite, simulateur de trajectoire plane de satellites 0 0 560 650 true QFrame::Panel QFrame::Raised 3 0 0 245 16777215 QFrame::StyledPanel QFrame::Raised Objet lancé Masse (kg) 100 altitude (km) 1000 Vitesses au départ (m/s) Vx (tangentielle) -4000 Vy (normale) 0 Astre défini Masse (kg) 6*10^24 Rayon (km) 0 0 Astres connus 0 0 100 0 M. terrestres 0 0 100 0 0 0 16777215 46 0 0 R. terrestres Visualiser le satellite chaque ... 3600 temps entre chaque point s Qt::AlignCenter Actions Lancer l'objet Effacer Vidéo 0 0 chaque fois 0 0 170 16777215 Vitesses coord. cartésiennes true repère de frénet false Vitesse selon OX 0 0 101 141 Cliquez pour agrandir QFrame::Box Vitesse selon OY 0 0 101 141 Cliquez pour agrandir QFrame::Box Norme de la vitesse 0 0 101 141 Cliquez pour agrandir QFrame::Box (Cliquez pour agrandir) Button_efface pressed() afficheur clear() 244 579 241 519 pysatellites-2.1.orig/icones/0000755000175000017500000000000011030456060016506 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/sat.gif0000755000175000017500000001055211012562310017766 0ustar georgeskgeorgeskGIF89a]<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤!,] H*\ȰÇ#2'ޅ 3jȱǍ2\(S>|\ɲK8xx)Srƒϟ@~\ɓ~r1$PJJu!E|Hf%+(P5EʪhP1܅,6\ڻI j Y#Թzo"42/k\0滷/\ǩX"O/=ŷާ8V6]ͧqD*S7ȅg49r>M%tKd]|G.ƫy2?S`+CI ɓyK4/uw9PuЕ)Xt^eS؄(]xd$v<vI\Jr9`@Dp`E(XSh`9r-{`u Dk΁Ám5e0O^yjB".uIj7 .DfqYgMXAƖ!Ij;`O}ݝ=h#(r1e8oM (ewbVgoJS7:˝QZ=p)$6 `%6[x]"[d!^08 &Xx(e^*7eV#.U|m(V:ix k NiV<%7kcu+njVV[A͹b^B϶u DzI3Aбt`IŽ |* *2Vˆび4G~<|3I1z@1x EGuJhY'q($7byx'#X=,ڞ?NBխ}G 3v=+\H4eRWf]q> m*cE5 <8A}Gxnvy^DWP h?P p1)]jAQjќMPDʀyeE!TT>q4IP\@C aZHk}0a~UzǛ D{zA,n@eG+IRv + ;<h,. >$fu|kFDpJXlokMwc*б VgyG\蔮!=0>cХȭR .jSj’xgIL/PsOn HNZҲE,qL{\)`&i.?d4ż1K޶& W\BX@-ѯhrz4Vƪ% m "*Cs4H$P1 /xxXT\.Q..ȵ+:ԏbƖr>68%a{Dw)GH2Aޱ[m@U*8@׺)!Z/b.v"2{!Ęy#MlO `^*S+WP8Y&~Nbuw tlS!:ttJTAЎLEOK9w/YhZq _Jx0]Kc@CO#DTʝRaJdk6+a j. pN6tAwv=@d[OW.'Vl@Z߻5w(/FUυhv!_؝|Tچ!pLUVy$SwѐORB<"EV=Jg١[6)ݘ`ٹzˇrfC|5⫔8b_\pZQ'GO5_p@bc쩯$ <&Xb[$ݛ㲑x#xZDp$)ś)4N2IFҀV Beŏ,Mэ3MN\8PC}!]0Ptٮ닙m?o'5Y UED42C 4IV6+2T_'Gǁuxgeā yr ,3KʵJIrBL-l ;ߘSH;rvC%^aFBcѠhlǍo%-]0D]]R+My-) 8Mit֩w+Sj;&#-Au7K PRQ2|?GDJ| }'@6%f@`Q^g)c6@ErGNQ0x 0#g{D8 3z|7Xt XG XD ¸ك~a}H6GEG7qKi QGb5FOp%( :Ufw6O !ф:~*8l,huR\8o0`H^Q `:# JLEXe!*LmsD(Gf%v izĈ5e)`_GsYtS)rf/Yj|gxȃ AlsP>a BSИ@PS5T699ɚxQpVhk2[!V:& 9y }䐷 蜓hZKY1@|wͩ0 ϐg.%Id4[ ^INVrĜJhJ0mtym@p?8h!E"QGhåƒ%ֈ7y~ɩ~; I%"UpfṀ)Y Yt{kZ|v29규 4呡ЕʡV`K:5Q'!4~6J::jWGФꜮ Rzeb)%ȥ7J! T1Qzɀyr*u gw:ͱJ৫ڈOZ姡G*_*:zGyJ;Z=Lɗ;Pڤ` ƭZ ٫*bY%/Q k*8ڊ/5yG&:yUW ڒʲBy4K3 f={(ȞE ۴Jpf T+(S K;pysatellites-2.1.orig/icones/sat_mini.gif0000755000175000017500000000207011012562310020776 0ustar georgeskgeorgeskGIF89a<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤!Created with GIMP, H:Ȑ+ N -`" S f~d '*"YYzK `L,)n3 dd5YHRm`[f#H;tT\hHSƑ햑Nc~2"E8CL`.奠3w xY^{{7wwToCdy +x0MnK_cf`IENDB`pysatellites-2.1.orig/icones/.svn/text-base/sat_mini.gif.svn-base0000444000175000017500000000207011012562310025266 0ustar georgeskgeorgeskGIF89a<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤!Created with GIMP, H:Ȑ•u\ "EwMa\B0~wgBpEWu.-OT>TGe;W\jm+ ˭8Zm!%t:>\fūœHZO CGWMU\)`ghao-3zPr(@bQ.(Ԩ@ٗSd(2] %= ]DUP6Օ$]qƺbšNJؾ>ЇW</wsL%pKEz !|pe"?96S "wk -z<) =4%hvTpG&dc*.OJWJw5a){~_ }w!G[.6Z(p;LmeYD˵RavAVtl{vdFRB1:,MKd\}Hńؽ2as &ĊQ96C1y,Ԓ)pa 14+- 99h}b^aA܎w(`^&&Krx|E*w jr P+6 ˫wVYt8yWdgxKfFs:4khvfzQ3YL! %ĊVqo_4k?aY1Htw(mPfnvRų-Y4uÚ8{Ʌ[P9!>MGyƒOv{YPNХa4jINdEJKN̏ofS1m%jVNqm4`5g!P^;p/fK;1moK(m:@r=9 B4{Xp2R{2O7-R! nqn:jgOOqjniw8J~UeNB޼_ځdy2Z3 VPVLűyRWYaV|©F}5{RA!>9u{T/-Ѣ{RU,ۘtQZ9rMVOl!'ՄeȐ59U4Mplb! Q 8x6ɠ~dz|}lʰ 5-[N sw 1B8dsD0. nmU8NVݛ)Ra,hvZm<?Y TBso̅l'u^P"sdIH~Q/&YL~(:>! 3Lu}C3TR^h*eD_JfA\QqzCo0{eL1` LY z.lݿ2:RسogtMJ0,LYt'Wf(=D%Vlat\<,*1Fen63n ͤ3x|? 6B#{4l"ׅEwzW;Wf!t .x grI(m1 m蕋DF ?Xykn5Y:&on'#$ak򅠉@BkY_UGdNl= n\^*!8rg6?V[ iQtZjR-^C'gg55v203 {kom#S! 5 ^%_C(wWؐnKD@3ToG~Gfh0cD:>Pል1G{0M[D0ff(X"FBLFBjZɤЊ E!<dkƉ9!BA~Iv?GJ4|'ƻMD^;P="GN:I=UL&F pѪB;#v:Jǜf K D8j)7M!mVk!c6siwΕfQ:!5~K >'o;@%]mL5PO`Zz9d VNɏ#T aĪ(wg 8"9Iq4\ElO9z_g#?^"<9p4< d"ndW#!"8 ».NßM1#|NœY?`.3#8?#Oi"d{D -Gs=YD粉`J.?樜{DȺl!;$BلD:C l/+! &B֚_ppDo/ZyIENDB`pysatellites-2.1.orig/icones/.svn/text-base/sat_mini_boum.png.svn-base0000444000175000017500000000213511012562310026331 0ustar georgeskgeorgeskPNG  IHDR6?sRGBPLTE<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤?tRNS@fbKGDH pHYs  tIME&e IDATU10 E+K΀z"Saz#v"Ujl<;q/&bS %29a `)kbI7,[afN~.d Wk~$Q۠ut-a7] qj{vxpINC(hxVWӂT[W{caZW10OeR^;Y[{-Gנe(IENDB`pysatellites-2.1.orig/icones/.svn/text-base/sat.gif.svn-base0000444000175000017500000001055211012562310024256 0ustar georgeskgeorgeskGIF89a]<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤!,] H*\ȰÇ#2'ޅ 3jȱǍ2\(S>|\ɲK8xx)Srƒϟ@~\ɓ~r1$PJJu!E|Hf%+(P5EʪhP1܅,6\ڻI j Y#Թzo"42/k\0滷/\ǩX"O/=ŷާ8V6]ͧqD*S7ȅg49r>M%tKd]|G.ƫy2?S`+CI ɓyK4/uw9PuЕ)Xt^eS؄(]xd$v<vI\Jr9`@Dp`E(XSh`9r-{`u Dk΁Ám5e0O^yjB".uIj7 .DfqYgMXAƖ!Ij;`O}ݝ=h#(r1e8oM (ewbVgoJS7:˝QZ=p)$6 `%6[x]"[d!^08 &Xx(e^*7eV#.U|m(V:ix k NiV<%7kcu+njVV[A͹b^B϶u DzI3Aбt`IŽ |* *2Vˆび4G~<|3I1z@1x EGuJhY'q($7byx'#X=,ڞ?NBխ}G 3v=+\H4eRWf]q> m*cE5 <8A}Gxnvy^DWP h?P p1)]jAQjќMPDʀyeE!TT>q4IP\@C aZHk}0a~UzǛ D{zA,n@eG+IRv + ;<h,. >$fu|kFDpJXlokMwc*б VgyG\蔮!=0>cХȭR .jSj’xgIL/PsOn HNZҲE,qL{\)`&i.?d4ż1K޶& W\BX@-ѯhrz4Vƪ% m "*Cs4H$P1 /xxXT\.Q..ȵ+:ԏbƖr>68%a{Dw)GH2Aޱ[m@U*8@׺)!Z/b.v"2{!Ęy#MlO `^*S+WP8Y&~Nbuw tlS!:ttJTAЎLEOK9w/YhZq _Jx0]Kc@CO#DTʝRaJdk6+a j. pN6tAwv=@d[OW.'Vl@Z߻5w(/FUυhv!_؝|Tچ!pLUVy$SwѐORB<"EV=Jg١[6)ݘ`ٹzˇrfC|5⫔8b_\pZQ'GO5_p@bc쩯$ <&Xb[$ݛ㲑x#xZDp$)ś)4N2IFҀV Beŏ,Mэ3MN\8PC}!]0Ptٮ닙m?o'5Y UED42C 4IV6+2T_'Gǁuxgeā yr ,3KʵJIrBL-l ;ߘSH;rvC%^aFBcѠhlǍo%-]0D]]R+My-) 8Mit֩w+Sj;&#-Au7K PRQ2|?GDJ| }'@6%f@`Q^g)c6@ErGNQ0x 0#g{D8 3z|7Xt XG XD ¸ك~a}H6GEG7qKi QGb5FOp%( :Ufw6O !ф:~*8l,huR\8o0`H^Q `:# JLEXe!*LmsD(Gf%v izĈ5e)`_GsYtS)rf/Yj|gxȃ AlsP>a BSИ@PS5T699ɚxQpVhk2[!V:& 9y }䐷 蜓hZKY1@|wͩ0 ϐg.%Id4[ ^INVrĜJhJ0mtym@p?8h!E"QGhåƒ%ֈ7y~ɩ~; I%"UpfṀ)Y Yt{kZ|v29규 4呡ЕʡV`K:5Q'!4~6J::jWGФꜮ Rzeb)%ȥ7J! T1Qzɀyr*u gw:ͱJ৫ڈOZ姡G*_*:zGyJ;Z=Lɗ;Pڤ` ƭZ ٫*bY%/Q k*8ڊ/5yG&:yUW ڒʲBy4K3 f={(ȞE ۴Jpf T+(S K;pysatellites-2.1.orig/icones/.svn/format0000444000175000017500000000000211012562310020567 0ustar georgeskgeorgesk8 pysatellites-2.1.orig/icones/.svn/props/0000755000175000017500000000000011012562310020531 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/prop-base/0000755000175000017500000000000011012562310021256 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/prop-base/sat_mini.png.svn-base0000444000175000017500000000006511012562310025303 0ustar georgeskgeorgeskK 13 svn:mime-type V 24 application/octet-stream END pysatellites-2.1.orig/icones/.svn/prop-base/sat_mini.gif.svn-base0000444000175000017500000000006511012562310025264 0ustar georgeskgeorgeskK 13 svn:mime-type V 24 application/octet-stream END pysatellites-2.1.orig/icones/.svn/prop-base/sat.png.svn-base0000444000175000017500000000006511012562310024267 0ustar georgeskgeorgeskK 13 svn:mime-type V 24 application/octet-stream END pysatellites-2.1.orig/icones/.svn/prop-base/sat_mini_boum.png.svn-base0000444000175000017500000000006511012562310026325 0ustar georgeskgeorgeskK 13 svn:mime-type V 24 application/octet-stream END pysatellites-2.1.orig/icones/.svn/prop-base/sat.gif.svn-base0000444000175000017500000000006511012562310024250 0ustar georgeskgeorgeskK 13 svn:mime-type V 24 application/octet-stream END pysatellites-2.1.orig/icones/.svn/tmp/0000755000175000017500000000000011012562310020166 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/tmp/text-base/0000755000175000017500000000000011012562310022062 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/tmp/props/0000755000175000017500000000000011012562310021331 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/tmp/prop-base/0000755000175000017500000000000011012562310022056 5ustar georgeskgeorgeskpysatellites-2.1.orig/icones/.svn/entries0000444000175000017500000000166311012562310020766 0ustar georgeskgeorgesk8 dir 48 svn+ssh://georgesk@svn.tuxfamily.org/svnroot/oppl/pysatellites/trunk/icones svn+ssh://georgesk@svn.tuxfamily.org/svnroot/oppl/pysatellites 2008-04-20T18:05:40.435414Z 41 georgesk svn:special svn:externals svn:needs-lock 1cd0251c-75d9-4da3-83ca-c37868f82735 sat_mini.png file 2008-04-20T17:51:42.000000Z b41ad6ede26cd7f695e1bbf7e8751ba1 2008-04-20T17:57:51.003838Z 40 georgesk has-props sat_mini.gif file 2008-04-12T12:04:26.000000Z cff1a457ffe62dc50f91e4dd267d5fbc 2008-04-12T09:44:36.333907Z 2 djibb has-props sat_mini_boum.png file 2008-04-20T18:04:38.000000Z b7f324d35aa4ecfe5ea4d9f5a9156e76 2008-04-20T18:05:40.435414Z 41 georgesk has-props sat.png file 2008-04-20T17:50:55.000000Z 2dbb2acfca703ac19688217161153d22 2008-04-20T17:57:51.003838Z 40 georgesk has-props sat.gif file 2008-04-12T12:04:26.000000Z 69996a186d884da5b294d373c344b01e 2008-04-12T09:44:36.333907Z 2 djibb has-props pysatellites-2.1.orig/icones/pysatellites.png0000644000175000017500000001155211030464243021744 0ustar georgeskgeorgeskPNG  IHDR@@iqsRGBbKGD pHYs^tIME)+&IDATxieWu{8ӝ{_ք$,(P&e+⤒J!)WW$(*e'ePQd۱K2Xh#@HBiMH=~w<{ù2U$jIvխ;^_k?m?YxhB%29*}-ˏx' _W${OZ^,q0^M+O^3:WbrXpǽvA "WO~7> /_^/8Y_DE'e;}=#>#OW5ȷiǖ_qnڃ6~_'[~"rh}O>bno A [2ܵkx_F57=lnNpBD_벻|zͮ~÷'i JDnW:=퟾,k;fu0%"oV閿w˝^ZVD_;>O??u/=rWʛE}#~S3w>~WrՏX󦕵a=sBα9&Ld^;N}]+{pPJ@ ",[[OoypgIb4B5Ve5JRZB($Ԉ+Y>~|A666߱{{CRm&b6z6ZCU{v'k{/tVQz_S;V* m 1kAS91PQE9[icؾ=s&%AJ'(c>0Y'C rg֒e-zI0m",@'p&UU'h@a屄p J\֚9R,..4tS'N6.z\2fľ^K8P]{r`?6L^yEv0Yv%igET z6t#=K7#_}w|֭?vaq^:uiNWLN=ƙAS_lll>L9T7ū.ן3*0ki'EMn!\^9=)p4bG7ژ&5nww=uec,Jy=t;j٥V{:;/bK3x> ׼GOt"fgp\N-ikaq>Cd$:UblaGIT>30N,i*j_믺ҏc_2|Ew,n(w8_M1q&)Zڝ9F$VݝG1U>-j:,-e1cx*І*/hLQ!'Oq ʲ+8k P BIjD<ՈuA5 ByLgMMUk60\SxgyK A|tsXԕØeA9P:e]9,1 ]ҬcMEYKo.#]3킎uc'b~ gTuIe DQDbLDa$Đ1 ($x$xk Nb:-KC!cfR|MJmePVI#Z;ʋߕ-@&I~[#6SGol#l hoN :a^<8q "t2e2"" x2kE# 1:c0q]EeRAQ3C*Wa}c0[-(')b'T YϹY  GZKF&#r xځ(#KZGAF Lb|*Kʠp0@LU;O4*JB# `A#&jf"m&&,Q5&wEL+BpHX&0¹D" 8W#@ B2iP8O3 h*fFUUD6BlxSkB`&Rk*BP r@${4SD3@)11Fuh(@ &CV;$zg4qP@ӀQͺxTP!$2_SUMNCGIP* v1ImlGy޹F͜ߜyB:Än#&mLd BMGN`Ѣ5>8$F煠i@]$ݤ"bZI3jB'|ak:aRo. Pe{e n:,)+e1.P% %T刢hjJQbJUL'9U1$˒*7d5#LZA[`|:r&"|)x+Py*cьFBR^ɽt޹]*kK[iJQ+T_eEґ$ MQ֤-QIdLTViQVJYEN5V~go~]A笜9õo`4<AauuWE6 pu]# ڼ4M@^"!FFVK?qB^%]Yk-Ռ# IJGhe!ISVwK99r}3N SkO$D6F[\ ?m?mh\o%c7IENDB`pysatellites-2.1.orig/icones/sat_mini_boum.png0000755000175000017500000000213511012562310022041 0ustar georgeskgeorgeskPNG  IHDR6?sRGBPLTE<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤?tRNS@fbKGDH pHYs  tIME&e IDATU10 E+K΀z"Saz#v"Ujl<;q/&bS %29a `)kbI7,[afN~.d Wk~$Q۠ut-a7] qj{vxpINC(hxVWӂT[W{caZW10OeR^;Y[{-Gנe(IENDB`pysatellites-2.1.orig/icones/sat.png0000755000175000017500000000734311012562310020011 0ustar georgeskgeorgeskPNG  IHDR]qwsRGBPLTE<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤dtRNS@fbKGDH pHYs  tIME27Pkj OIDATx՚?oZƙ&[9AQ5tr T/z r E>•u\ "EwMa\B0~wgBpEWu.-OT>TGe;W\jm+ ˭8Zm!%t:>\fūœHZO CGWMU\)`ghao-3zPr(@bQ.(Ԩ@ٗSd(2] %= ]DUP6Օ$]qƺbšNJؾ>ЇW</wsL%pKEz !|pe"?96S "wk -z<) =4%hvTpG&dc*.OJWJw5a){~_ }w!G[.6Z(p;LmeYD˵RavAVtl{vdFRB1:,MKd\}Hńؽ2as &ĊQ96C1y,Ԓ)pa 14+- 99h}b^aA܎w(`^&&Krx|E*w jr P+6 ˫wVYt8yWdgxKfFs:4khvfzQ3YL! %ĊVqo_4k?aY1Htw(mPfnvRų-Y4uÚ8{Ʌ[P9!>MGyƒOv{YPNХa4jINdEJKN̏ofS1m%jVNqm4`5g!P^;p/fK;1moK(m:@r=9 B4{Xp2R{2O7-R! nqn:jgOOqjniw8J~UeNB޼_ځdy2Z3 VPVLűyRWYaV|©F}5{RA!>9u{T/-Ѣ{RU,ۘtQZ9rMVOl!'ՄeȐ59U4Mplb! Q 8x6ɠ~dz|}lʰ 5-[N sw 1B8dsD0. nmU8NVݛ)Ra,hvZm<?Y TBso̅l'u^P"sdIH~Q/&YL~(:>! 3Lu}C3TR^h*eD_JfA\QqzCo0{eL1` LY z.lݿ2:RسogtMJ0,LYt'Wf(=D%Vlat\<,*1Fen63n ͤ3x|? 6B#{4l"ׅEwzW;Wf!t .x grI(m1 m蕋DF ?Xykn5Y:&on'#$ak򅠉@BkY_UGdNl= n\^*!8rg6?V[ iQtZjR-^C'gg55v203 {kom#S! 5 ^%_C(wWؐnKD@3ToG~Gfh0cD:>Pል1G{0M[D0ff(X"FBLFBjZɤЊ E!<dkƉ9!BA~Iv?GJ4|'ƻMD^;P="GN:I=UL&F pѪB;#v:Jǜf K D8j)7M!mVk!c6siwΕfQ:!5~K >'o;@%]mL5PO`Zz9d VNɏ#T aĪ(wg 8"9Iq4\ElO9z_g#?^"<9p4< d"ndW#!"8 ».NßM1#|NœY?`.3#8?#Oi"d{D -Gs=YD粉`J.?樜{DȺl!;$BلD:C l/+! &B֚_ppDo/ZyIENDB`pysatellites-2.1.orig/icones/sat_mini.png0000755000175000017500000000214711012562310021022 0ustar georgeskgeorgeskPNG  IHDR6?sRGBPLTE<<<333333333333+++MMMooo33333333ffffffff̙3̙333f3f3f33fffff3ff3ff33f3f3f3f3̙3f3f̙3f3f3f3fff33̙̙33333333̙f̙3f3̙3f333f33̙3f3f̙333f33f3333333333333̙f̙3f3fff3ff3f̙3f3f̙f3fff3ff3333fffffffffffffffffffffffff3f333ff̙f̙fff̙3f3f3ff3f̙f̙3f33f33333DDD"""^^^ݻ ffffffffffffwwwĪUUU𠠤dtRNS@fbKGDH pHYs  tIME3**v7KIDATu!0>+ N -`" S f~d '*"YYzK `L,)n3 dd5YHRm`[f#H;tT\hHSƑ햑Nc~2"E8CL`.奠3w xY^{{7wwToCdy +x0MnK_cf`IENDB`pysatellites-2.1.orig/astres.py0000755000175000017500000000661311012562310017106 0ustar georgeskgeorgesk# -*- coding: utf-8 -*- """La plupart de ces données ont été adaptées à partir de la version anglaise de Wikipedia : http://en.wikipedia.org """ from flottant import traduit astreNom=[ # nom_local, nom_celestia, masse_kg, rayon_km, commentaire, jour, flipped # flipped fait référence à une propréiété dans le fichier Planet.cpp # de src/libplanet du logiciel xplanet. ["Terre","earth","6x10^24","6400","Planète du système solaire","1","1"], ["Soleil","sun","6x10^31","695000","Étoile du système solaire","26","1"], ["Lune","moon","7.33x10^22","1740","Lune de Terre","27.3216","1"], ["Amalthée","amalthea","2.08x10^18","83.5","Lune de Jupiter","0.49817943","-1"], ["Callisto","callisto","1.076x10^23 ","2410","Lune de Jupiter","16.6890184","-1"], ["Deimos","deimos","1.48x10^15","6.2","Lune de Mars","1.26244","-1"], ["Dione","dione","1.1x10^21","561","Lune de Saturne","2.736915","-1"], ["Encelade","enceladus","1.08x10^20","252","Lune de Saturne","1.370218","-1"], ["Épiméthée","epimetheus","57","5.3x10^17","Lune de Saturne","0.694333517","-1"], ["Europe","europa","4.80x10^22","1569","Lune de Jupiter","3.551181","-1"], ["Ganymède","ganymede","1.4819x10^23","2634","Lune de Jupiter","7.15455296","-1"], ["Hyperion","hyperion","0.558x10^19","280","Lune de Saturne","21.27661","-1"], ["Iapète","iapetus","1.80x10^21","1450","Lune de Saturne","79.3215","-1"], ["Io","io","8.9319x10^22","1821.3","Lune de Jupiter","1.769137786","-1"], ["Janus","janus","1.91x10^18","173","Lune de Saturne","0.694660342","-1"], ["Jupiter","jupiter","1.90x10^27 ","70x10^3","Planète du système solaire","9.925/24","-1"], ["Mars","mars","6.4185x10^23","3390","Planète du système solaire","1.025957","-1"], ["Mercure","mercury","3.3022x10^23","2440","Planète du système solaire","58.646","-1"], ["Mimas","mimas","3.7493x10^19","390","Lune de Saturne","0.9424218 ","-1"], ["Miranda","miranda","6.59x10^19","470","Lune d'Uranus","1.413479","1"], ["Neptune","neptune","1.0243x10^26","24750","Planète du système solaire","0.6713","-1"], ["Obéron","oberon","3.014x10^21","761.4","Lune d'Uranus","13.463234","1"], ["Phobos","phobos","1.07x10^16","11.1","Lune de Mars","0.318 910 23","-1"], ["Pluton","pluto-lok","1.30x10^22","1195","Planète du système solaire","-6.387230","1"], ["Prométhée","prometheus","1.566x10^17","100","Lune de Saturne","0.612990038","-1"], ["Protée","proteus","4.4x10^19","410","Lune de Neptune","1.12231477","-1"], ["Rhéa","rhea","2.3065x10^21","1525","Lune de Saturne","4.518212","-1"], ["Saturne","saturn","5.6846x10^26","60x10^3","Planète du système solaire","0.445","-1"], ["Tethys","tethys","6.174x10^20","1060","Lune de Saturne","1.887802","-1"], ["Titan","titan","1.345x10^23","2576","Lune de Saturne","15.945","-1"], ["Triton","triton","2.14x10^22","1353","Lune de Neptune","-5.877","-1"], ["Umbriel","umbriel","1.2x10^21","1169","Lune d'Uranus","4.144","1"], ["Vénus","venus","4.8685x10^24","6051","Planète du système solaire","-243.0185","1"] ] class Astre: def __init__(self,cle): for a in astreNom: if a[1]==cle: break self.nom=a[0] self.cle=cle self.masse=traduit(a[2]) self.rayon=1000*traduit(a[3]) self.commentaire=a[4] self.rotationSiderale=a[5] #unité jour self.flip=a[6] pysatellites-2.1.orig/methodes.tm0000755000175000017500000001434311012562310017404 0ustar georgeskgeorgesk <\body> ||>> Le logiciel pysatellites sert simuler le lancement de satellites autour de diverses plantes. En France, ce logiciel est utilis dans l'enseignement au niveau du lyce. L'lve est invit choisir une plante, ou prciser les paramtres de rayon et de masse qu'il veut, puis il contrle le point de lancment d'un satellite, sa vitesse radiale et sa vitesse orthoradiale. Quand ce choix est fini, il lance la simulation et voit quelle trajectoire le satellite peut alors suivre. La mthode est une mthode de calcul de proche en proche : des intervalles de temps rguliers, la vitesse et la position du satellite connues sont utilises afin de prdire sa position et sa vitesse un intervalle de temps plus tard. On parle d'intgration numrique, car seule la loi locale qui donne la force d'attraction applique au satellite est prise en considration. Un autre mthode serait possible : dans le cas d'un problme un corps plong dans un potentiel newtonien, les quations de la dynamique du satellite admettent des solutions algbriques que l'on sait dterminer. J'ai utilis un document synthtique publi sur Internet, l'adresse\ Ce document rsume ce qu'on peut retenir comme proprit des coniques (ellipses, parabole, hyperboles), et la solution connue du problme un corps dans un potentiel newtonien. On peut l'utiliser pour calculer sans avoir terminer la simulation divers paramtres. L'un d'entre eux est trs important, il s'agit de la priode du mouvement quand l'nergie mcanique > du satellite est ngative, et que celui-ci dcrit une ellipse dans le puits de potentiel de l'astre qui l'attire. On connat la distance du satellite l'astre de masse . On en dduit facilement son nergie potentielle massique, /m=->, o u.s.i.> est la constante universelle de gravitation. Connaissant sa vitesse radiale >|\>> et sa vitesse orthoradiale |\>>, on dduit son nergie cintique massique, /m=>>^2>+(|\>>>)>. Il suffit d'aditionner les nergies pour parvenir l'nergie mcanique massique, /m=-+>>^2>+(|\>>>)>. Plusieurs cas se prsentent alors : <\enumerate-numeric> /m \ 0> : le satellite reste dans le puits de potentiel de l'astre, sa trajectoire est une ellipse, qu'il parcourt avec une priode . /m = 0> : le satellite n'est pas li, il possde tout juste la vitesse de libration, sa trajectoire est une parabole, sa vitesse s'annule l'infini. /m \ 0> : le satellite n'est pas li, sa vitesse l'infini est non nulle, sa trajectoire est hyperbolique. Dans le premier cas seulement, une priode existe pour le mouvement du satellite, et on la calcule ainsi : le grand axe de l'ellipse se dduit de la constante d'attraction ( par la formule +>>^2>+(|\>>>))>>. Connaissant le grand axe de l'ellipse, on peut alors dterminer la priode du mouvement grce la troisime loi de Kepler, =4\/MG*a>, soit >|>>. Quand la priode du mouvement est connue, on peut prendre comme ordre de grandeur de l'intervalle de temps pour l'intgration, un centime de cette priode. a donne des rsultats satisfaisants pour les mouvement d'excentricit faible : c'est dire que la trajectoire apparat facilement comme ferme l'cran, au pixel prs. Dans le cas d'ellipses fortement excentriques, il faut diminuer le l'intervalle de temps utilis pour l'intgration. <\initial> <\collection> <\references> <\collection> > > > > <\auxiliary> <\collection> <\associate|toc> |math-font-series||1Utilit du logiciel \S pysatellites \T> |.>>>>|> |math-font-series||2Mthode utilise pour la simulation> |.>>>>|> |math-font-series||3La mthode d'intgration de Runge-Kutta> |.>>>>|> |math-font-series||4Dtermination de la priode d'un mouvement elliptique> |.>>>>|> pysatellites-2.1.orig/__init__.py0000755000175000017500000000535411773533136017367 0ustar georgeskgeorgesk#-*- coding: utf-8 -*- licence=""" pysatellites : a program to plot trajectories of satellites Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ licence_fr=""" pysatellites : un programme pour tracer les trajectoires de satellites Copyright (C) 2007-2008 Jean-Baptiste Butet , (C) 2007-2008 Georges Khaznadar Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 3 ou plus de la dite licence. Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. . """ import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from debug import Debug from mainWindow import StartQT4 def usage(): print ("Usage : pysatellites [-h | --help] [-d n | --debug=n] [-f fichier | --fichier=fichier]") sys.exit(0) def run(): app = QApplication(sys.argv) #translation #locale = QLocale.system().name() #qtTranslator = QTranslator() #if qtTranslator.load("qt_" + locale): # app.installTranslator(qtTranslator) #appTranslator = QTranslator() # if appTranslator.load("lang/pyfocus_" + locale): #app.installTranslator(appTranslator) from getopt import getopt optlist, argv=getopt(sys.argv[1:],"d:f:h",["debug=","fichier=","help"]) debugger=Debug(0) for (cle,val) in optlist: if cle=="-d" or cle=="--debug": debugger=Debug(int(val)) if cle=="-h" or cle=="--help": usage() if cle=="-f" or cle=="--fichier": print ("On ne sait pas encore quoi faire de '%s', la fonctionnalité gouvernée par '%s' reste à implémenter." %(val,cle)) windows = StartQT4(None, debugger=debugger, app=app) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run()