pax_global_header00006660000000000000000000000064135304605460014520gustar00rootroot0000000000000052 comment=f7beff2fffa87f93f4c343e80ef38f1f2267117b pysatellites-2.6/000077500000000000000000000000001353046054600141115ustar00rootroot00000000000000pysatellites-2.6/.gitignore000066400000000000000000000000421353046054600160750ustar00rootroot00000000000000*~ __pycache__/ build/ *.pyc UI_* pysatellites-2.6/AUTHORS000066400000000000000000000001571353046054600151640ustar00rootroot00000000000000Jean-Baptiste BUTET Bastien Georges Khaznadar pysatellites-2.6/COPYING000066400000000000000000001043741353046054600151550ustar00rootroot00000000000000 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.6/Changelog000066400000000000000000000040611353046054600157240ustar00rootroot00000000000000JB : 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.6/LISEZMOI000066400000000000000000000020051353046054600152640ustar00rootroot00000000000000Le 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.6/Makefile000066400000000000000000000021771353046054600155600ustar00rootroot00000000000000DESTDIR = STELLARIUM_TEXTURES = /usr/share/stellarium/textures 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 -rf __pycache__ rm -f UI_* rm -rf build user-interface: UI_pysat.py UI_graphe.py UI_%.py: %.ui pyuic5 $< -o $@ install: all mkdir -p $(DESTDIR)/usr/bin install -m 755 pysatellites $(DESTDIR)/usr/bin mkdir -p $(DESTDIR)/usr/share/applications install -m 644 pysatellites.desktop $(DESTDIR)/usr/share/applications mkdir -p $(DESTDIR)/usr/share/pysatellites install -m 644 *.py $(DESTDIR)/usr/share/pysatellites cp -a icones $(DESTDIR)/usr/share/pysatellites # install images from stellarium-data; # stellarium-data is not necessary later. mkdir -p $(DESTDIR)/usr/share/pysatellites/images for d in $(STELLARIUM_TEXTURES); do \ for f in $$(ls $$d/*.png); do \ g=$(DESTDIR)/usr/share/pysatellites/images/$$(echo $$(basename $$f)| sed -e 's/png/jpg/'); \ convert $$f $$g; \ done; \ done .PHONY = user-interface install clean install-textures all install-for-debian pysatellites-2.6/astres.py000066400000000000000000000066201353046054600157700ustar00rootroot00000000000000# -*- 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_stellarium, 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-clouds","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","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.6/authors000066400000000000000000000001571353046054600155240ustar00rootroot00000000000000Jean-Baptiste BUTET Bastien Georges Khaznadar pysatellites-2.6/copying000066400000000000000000001043741353046054600155150ustar00rootroot00000000000000 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.6/debug.py000066400000000000000000000003131353046054600155460ustar00rootroot00000000000000# -*- 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.6/flottant.py000066400000000000000000000023511353046054600163170ustar00rootroot00000000000000# -*- 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.6/graphe.ui000066400000000000000000000031761353046054600157250ustar00rootroot00000000000000 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.6/icones/000077500000000000000000000000001353046054600153715ustar00rootroot00000000000000pysatellites-2.6/icones/pysatellites.png000066400000000000000000000115521353046054600206250ustar00rootroot00000000000000PNG  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.6/icones/sat.gif000066400000000000000000000105521353046054600166520ustar00rootroot00000000000000GIF89a]<<<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.6/icones/sat.png000066400000000000000000000073431353046054600166750ustar00rootroot00000000000000PNG  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.6/icones/sat_mini.gif000066400000000000000000000020701353046054600176620ustar00rootroot00000000000000GIF89a<<<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.6/icones/sat_mini_boum.png000066400000000000000000000021351353046054600207250ustar00rootroot00000000000000PNG  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.6/lisezmoi000066400000000000000000000020051353046054600156640ustar00rootroot00000000000000Le 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.6/mainWindow.py000066400000000000000000000173141353046054600166050ustar00rootroot00000000000000#-*- 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 PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets 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 as flottant from debug import Debug class StartQT5(QMainWindow): def __init__(self, parent, rep=None , debugger=Debug(1), 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("6x10^24") self.ui.rayon_astre.setText("6400") 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(self.tr(a[0])) self.ui.astreCombo.setEditable(False) self.ui.astreCombo.setCurrentIndex(0) self.astreCourant="earth" self.choisi_astre(0) def connexions_signaux(self): self.ui.Bouton_Lancer.clicked.connect(self.trajectoire.lance) self.ui.Button_efface.clicked.connect(self.efface_trajectoire) self.ui.bouton_video.clicked.connect(self.cinema) self.ui.altitude_objet.editingFinished.connect(self.placeDepart) self.ui.astreCombo.currentIndexChanged.connect(self.choisi_astre) self.ui.radioButton_Frenet.toggled.connect(self.choisi_coordoonees) timer = QTimer(self); timer.timeout.connect(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=self.tr("Calcul de la vidéo") legende=self.tr("Avancement ...") echap=self.tr("Arrêt") 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(self.tr("Vitesse selon Ox")) self.ui.label_V2.setText(self.tr("Vitesse selon Oy")) elif self.ui.radioButton_Cartesiennes.isChecked()==False : self.ui.label_V1.setText(self.tr("Vitesse Tangentielle")) self.ui.label_V2.setText(self.tr("Vitesse Normale")) 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(self.tr(masse_astre)) self.ui.rayon_astre.setText(self.tr(rayon_astre)) 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(self.tr(mt)) self.ui.rTerre.setText(self.tr(rt)) self.ui.auSujetAstre.setText(self.tr(a[4])) self.placeDepart() self.trajectoire.update() return self.debug(0,"Astre inconnu : %s" %astre) pysatellites-2.6/manpage.xml000066400000000000000000000102431353046054600162430ustar00rootroot00000000000000 .
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.6/matplotlib_widget.py000066400000000000000000000047741353046054600202110ustar00rootroot00000000000000# 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 numpy import arange, sin, pi from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore 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, QSizePolicy.Expanding, 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(self.tr(self.titre)) 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.6/methodes.tm000066400000000000000000000143431353046054600162700ustar00rootroot00000000000000 <\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.6/point.py000066400000000000000000000036641353046054600156250ustar00rootroot00000000000000#-*- coding: utf-8 -*- from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore 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.6/pysat.ui000066400000000000000000000365071353046054600156230ustar00rootroot00000000000000 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.6/pysatellites000077500000000000000000000001001353046054600165500ustar00rootroot00000000000000#!/bin/sh exec python3 /usr/share/pysatellites/pysatellites.py pysatellites-2.6/pysatellites.1000066400000000000000000000030411353046054600167130ustar00rootroot00000000000000.\" 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.6/pysatellites.desktop000066400000000000000000000004071353046054600202270ustar00rootroot00000000000000[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.6/pysatellites.py000066400000000000000000000053621353046054600172130ustar00rootroot00000000000000licence=""" 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 PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from debug import Debug from mainWindow import StartQT5 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 = StartQT5(None, debugger=debugger, app=app) windows.show() sys.exit(app.exec_()) if __name__ == "__main__": run() pysatellites-2.6/rectangle_sensible.py000066400000000000000000000061131353046054600203140ustar00rootroot00000000000000# -*- coding: utf-8 -*- from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.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.6/repertoire.py000066400000000000000000000017501353046054600166460ustar00rootroot00000000000000# -*- 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 [self.chemin0, "/usr/share/pysatellites"]: if os.path.exists(d+'/images/earth-clouds.jpg'): return d print ("erreur : pas de répertoire des planètes") print ("=== Il manque les textures de Xplanet-images ===") 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.6/traj_satellite.py000066400000000000000000000370501353046054600174760ustar00rootroot00000000000000# -*- 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 PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from point import Point import os, tempfile, time from matplotlib_widget import MyMplCanvas import flottant as 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=self.tr("Ce n'est pas un satellite") q=self.tr("L'énergie mécanique initiale est positive, l'objet lancé échappera à l'attraction de l'astre. Voulez-vous tracer une partie de la trajectoire ?") ret=QMessageBox.question (self, t, q) if ret==QMessageBox.Yes: 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=self.tr("Changement d'échelle") q=self.tr("Un dépassement a été détecté. Voulez-vous changer d'échelle ?") ret=QMessageBox.question (self, t, q) if ret==QMessageBox.Yes: 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.6/video.py000066400000000000000000000066111353046054600155750ustar00rootroot00000000000000# -*- 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 PyQt5.QtGui import * from PyQt5.QtWidgets import * from threading import * from debug import Debug import flottant as 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 -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