Metadata-Version: 2.1
Name: hypatie
Version: 2.1.2
Summary: A python package for astronomy
Home-page: https://github.com/behrouzz/hypatie
Author: Behrouz Safari
Author-email: behrouz.safari@gmail.com
License: MIT
Description: **Author:** [Behrouz Safari](https://behrouzz.github.io/)<br/>
        **License:** [MIT](https://opensource.org/licenses/MIT)<br/>
        
        # hypatie
        *A python package for astronomy*
        
        
        ## Installation
        
        You can install the latest version of *hypatie* from [PyPI](https://pypi.org/project/hypatie/):
        
            pip install hypatie
        
        The only requirements are *numpy* and *matplotlib*.
        
        
        ## Quick start
        
        Let's get the positions of the sun between two times:
        
        ```python
        import hypatie as hp
        
        t1 = '2021-03-20 08:00:00'
        t2 = '2021-03-20 10:00:00'
        ```
        
        If you want the apparent RA and DEC of the Sun with respect to Earth's center (geocentric):
        
        ```python
        obs = hp.Observer('sun', t1, t2, step=5)
        ```
        
        Now you can access the time intervals with *.time* attribute:
        
        ```python
        print(obs.time)
        
        [datetime.datetime(2021, 3, 20, 8, 0)
         datetime.datetime(2021, 3, 20, 8, 24)
         datetime.datetime(2021, 3, 20, 8, 48)
         datetime.datetime(2021, 3, 20, 9, 12)
         datetime.datetime(2021, 3, 20, 9, 36)
         datetime.datetime(2021, 3, 20, 10, 0)]
        ```
        
        To acces the position you can use *obs.pos*, *obs.ra*, or *obs.dec*:
        
        ```python
        print(obs.pos)
        
        [[ 3.59938235e+02 -2.66803120e-02]
         [ 3.59953431e+02 -2.00920520e-02]
         [ 3.59968627e+02 -1.35038600e-02]
         [ 3.59983823e+02 -6.91573600e-03]
         [ 3.59999018e+02 -3.27680000e-04]
         [ 1.42132560e-02  6.26030600e-03]]
        ```
        
        The first column in the above array is RA and the second column is DEC.
        
        It is possible to get the apparent RA & DEC of a targer with respect to a specified location on the surface of a body.
        For example, if you want to get the apparent RA & DEC of the Sun for the Eiffel Tower :
        
        ```python
        obs = hp.Observer('sun', t1, t2, step=5, center='2.2945,48.8584,300@399')
        ```
        
        Note that 2.2945 is the longtitude, 48.8584 is the latitude and 300 (meters) is the elevation of the Eiffel Tower.
        We have specified '@399' at the end which means that this coordinates is situated on the Earth (399 is the Earth's code).                                                                                           
        
        You can request the cartesian positions (x,y,z) of a target with *Vector* class.
        
        ```python
        vec = hp.Vector('sun', t1, t2, step=5)
        ```
        
        As with the *Observer* class, there are two attributes *.time* and *.pos* for *Vector* class.
        Note that when creating a Vector class, you have *.x*, *.y* and *.z* attributes instead of *.ra* and *.dec*.
        
        For both *Vector* and *Observer* classes you can pass a single time to get position/state of a body at a single time:
        ```python
        vec = hp.Vector('sun', t1)
        ```
        
        Both *Vector* and *Observer* classes have *.plot()* method.
        ```python
        # plot polar coordinates
        obs.plot()
        # plot cartesian coordinates
        vec.plot()
        ```
        
        ## Example: animating James Webb Space Telescope
        
        In addition to *.plot()* method of *Vector* and *Observer* classes, there's a *play()* function that you can pass it a list of Vector objects as well as some other lists as shown in the example below:
        
        ```python
        import hypatie as hp
        import matplotlib.pyplot as plt
        
        t1 = '2018-10-01 14:18:00'
        t2 = '2024-12-31 12:18:00'
        
        # get positions with respect to the barycenter of earth-moon
        earth = hp.Vector('399', t1, t2, center='500@3', step=1000)
        moon = hp.Vector('301', t1, t2, center='500@3', step=1000)
        jwst = hp.Vector('-170', t1, t2, center='500@3', step=1000)
        
        bodies = [earth, moon, jwst]
        names = ['Earth', 'Moon', 'James Webb']
        colors = ['b','g','r']
        sizes = [20, 8, 3]
        
        # play the animation
        anim = hp.play(bodies, names, colors, sizes)
        plt.show()
        ```
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.4
Description-Content-Type: text/markdown
