diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 05d8e25..8a0f4e7 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest name: flake8 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 73ac774..1182d61 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest name: mypy steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install dependencies diff --git a/README.rst b/README.rst index 2455a3d..dc5956e 100644 --- a/README.rst +++ b/README.rst @@ -34,19 +34,19 @@ of a known minor planet, and obtain the result as a Pandas DataFrame. The output >>> from tess_ephem import ephem >>> ephem("Sedna") - sector camera ccd column row tdb-ut pixels_per_hour ra dec vmag hmag sun_distance obs_distance phase_angle - time - 2458438.5 5 1 4 1543.104021 1102.948351 69.182738 0.074363 57.11724 7.64961 20.803 1.49 84.947515 83.981039 0.1450 - 2458439.5 5 1 4 1544.978969 1103.000701 69.182758 0.075353 57.10692 7.64724 20.802 1.49 84.946739 83.978850 0.1423 - 2458440.5 5 1 4 1546.866007 1103.027415 69.182777 0.075362 57.09651 7.64500 20.801 1.49 84.945964 83.977315 0.1403 - 2458441.5 5 1 4 1548.750885 1103.040242 69.182797 0.075132 57.08610 7.64284 20.801 1.49 84.945188 83.976314 0.1394 - 2458442.5 5 1 4 1550.627199 1103.044020 69.182818 0.074800 57.07573 7.64074 20.801 1.49 84.944412 83.975782 0.1394 - ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... - 2460254.5 71 2 4 1984.578578 1003.555888 69.182570 0.072528 60.21660 8.36089 20.750 1.49 83.592715 82.661747 0.2395 - 2460255.5 71 2 4 1984.808484 1001.737047 69.182584 0.072889 60.20673 8.35803 20.749 1.49 83.591992 82.656583 0.2304 - 2460256.5 71 2 4 1985.037223 999.911091 69.182599 0.073002 60.19682 8.35517 20.747 1.49 83.591270 82.651896 0.2214 - 2460257.5 71 2 4 1985.258387 998.084718 69.182615 0.072664 60.18690 8.35235 20.745 1.49 83.590547 82.647726 0.2127 - 2460258.5 71 2 4 1985.460633 996.280013 69.182631 0.071257 60.17708 8.34965 20.744 1.49 83.589824 82.644125 0.2044 + sector camera ccd column row tdb-ut ... dec vmag hmag sun_distance obs_distance sto_angle + time ... + 2458438.5 5 1 4 1543.104021 1102.948351 69.182738 ... 7.64961 20.803 1.49 84.947536 83.981060 0.1466 + 2458439.5 5 1 4 1544.978969 1103.000701 69.182758 ... 7.64724 20.802 1.49 84.946760 83.978870 0.1435 + 2458440.5 5 1 4 1546.866007 1103.027415 69.182777 ... 7.64500 20.801 1.49 84.945985 83.977335 0.1412 + 2458441.5 5 1 4 1548.750885 1103.040242 69.182797 ... 7.64284 20.801 1.49 84.945209 83.976334 0.1397 + 2458442.5 5 1 4 1550.627199 1103.044020 69.182818 ... 7.64074 20.801 1.49 84.944433 83.975802 0.1393 + ... ... ... ... ... ... ... ... ... ... ... ... ... ... + 2460254.5 71 2 4 1984.578578 1003.555888 69.182570 ... 8.36089 20.750 1.49 83.592740 82.661771 0.2440 + 2460255.5 71 2 4 1984.808484 1001.737047 69.182584 ... 8.35803 20.749 1.49 83.592017 82.656607 0.2347 + 2460256.5 71 2 4 1985.037223 999.911091 69.182599 ... 8.35517 20.747 1.49 83.591294 82.651920 0.2257 + 2460257.5 71 2 4 1985.258387 998.084718 69.182615 ... 8.35235 20.745 1.49 83.590572 82.647750 0.2168 + 2460258.5 71 2 4 1985.462457 996.279638 69.182631 ... 8.34964 20.744 1.49 83.589849 82.644149 0.2083 [75 rows x 14 columns] @@ -59,16 +59,16 @@ by passing the ``time`` parameter: .. code-block:: python >>> ephem("Sedna", time="2018-11-21 17:35:00") - sector camera ccd column row tdb-ut pixels_per_hour ra dec vmag hmag sun_distance obs_distance phase_angle - time - 2018-11-21 17:35:00.000 5 1 4 1553.858404 1103.035027 69.182854 0.074053 57.05786 7.63721 20.802 1.49 84.943069 83.975873 0.1419 + sector camera ccd column row tdb-ut ... dec vmag hmag sun_distance obs_distance sto_angle + time ... + 2018-11-21 17:35:00.000 5 1 4 1553.858404 1103.035027 69.182854 ... 7.63721 20.802 1.49 84.94309 83.975894 0.1409 >>> from astropy.time import Time >>> ephem("Sedna", time=Time([2458441.5,2460258.5], format='jd')) - sector camera ccd column row tdb-ut pixels_per_hour ra dec vmag hmag sun_distance obs_distance phase_angle - time - 2458441.5 5 1 4 1548.750885 1103.040242 69.182797 0.075132 57.08610 7.64284 20.801 1.49 84.945188 83.976314 0.1394 - 2460258.5 71 2 4 1985.460633 996.280013 69.182631 0.071257 60.17708 8.34965 20.744 1.49 83.589824 82.644125 0.2044 + sector camera ccd column row tdb-ut ... dec vmag hmag sun_distance obs_distance sto_angle + time ... + 2458441.5 5 1 4 1548.750885 1103.040242 69.182797 ... 7.64284 20.801 1.49 84.945209 83.976334 0.1397 + 2460258.5 71 2 4 1985.462457 996.279638 69.182631 ... 8.34964 20.744 1.49 83.589849 82.644149 0.2083 Orbital elements can be obtained by passing the ``orbital_elements=True`` parameter. The function returns the average orbital elements of the target during the queried time. Perihelion distance is in AU and orbital inclination is in degrees. @@ -77,7 +77,7 @@ Orbital elements can be obtained by passing the ``orbital_elements=True`` parame >>> df_ephem, orbital_elements = ephem("Sedna", time="2018-11-21 17:35:00", orbital_elements=True) >>> orbital_elements - {'perihelion_distance': 76.13300496827914, 'eccentricity': 0.8413468330602263, 'orbital_inclination': 11.929585189509927} + {'perihelion_distance': 76.13306961191206, 'eccentricity': 0.8413469227223953, 'orbital_inclination': 11.929585162007143} You can alternatively obtain the ephemeris during a specific sector by passing @@ -86,51 +86,53 @@ the ``sector`` parameter: .. code-block:: python >>> ephem("Sedna", sector=70) - sector camera ccd column row tdb-ut pixels_per_hour ra dec vmag hmag sun_distance obs_distance phase_angle - time - 2460208.5 70 4 2 1965.994639 1827.049672 69.182409 0.025550 60.53693 8.49483 20.815 1.49 83.625984 83.171959 0.6161 - 2460209.5 70 4 2 1966.304467 1826.442414 69.182402 0.029493 60.53386 8.49248 20.814 1.49 83.625260 83.156129 0.6112 - 2460210.5 70 4 2 1966.639579 1825.743198 69.182395 0.032766 60.53030 8.48989 20.813 1.49 83.624537 83.140186 0.6058 - 2460211.5 70 4 2 1966.995717 1824.975902 69.182389 0.035144 60.52638 8.48711 20.812 1.49 83.623813 83.124437 0.6001 - 2460212.5 70 4 2 1967.363962 1824.160062 69.182382 0.037045 60.52220 8.48421 20.811 1.49 83.623090 83.108950 0.5940 - 2460213.5 70 4 2 1967.743247 1823.299432 69.182377 0.038666 60.51778 8.48120 20.810 1.49 83.622366 83.093746 0.5878 - 2460214.5 70 4 2 1968.127856 1822.402268 69.182372 0.040092 60.51316 8.47812 20.809 1.49 83.621642 83.078838 0.5813 - 2460215.5 70 4 2 1968.516359 1821.470633 69.182367 0.041354 60.50835 8.47498 20.808 1.49 83.620919 83.064240 0.5747 - 2460216.5 70 4 2 1968.909479 1820.507912 69.182363 0.042441 60.50337 8.47178 20.806 1.49 83.620195 83.049971 0.5680 - 2460217.5 70 4 2 1969.301139 1819.520671 69.182359 0.043287 60.49825 8.46856 20.805 1.49 83.619472 83.036058 0.5611 - 2460218.5 70 4 2 1969.690629 1818.514364 69.182355 0.043699 60.49302 8.46533 20.804 1.49 83.618748 83.022538 0.5541 - 2460219.5 70 4 2 1970.070096 1817.504775 69.182353 0.043112 60.48776 8.46215 20.803 1.49 83.618025 83.009457 0.5471 - 2460220.5 70 4 2 1970.413447 1816.527398 69.182350 0.040265 60.48264 8.45920 20.802 1.49 83.617302 82.996750 0.5403 - 2460221.5 70 4 2 1970.685594 1815.593040 69.182349 0.039919 60.47768 8.45668 20.800 1.49 83.616578 82.983656 0.5337 - 2460222.5 70 4 2 1970.945096 1814.590453 69.182347 0.043872 60.47232 8.45415 20.799 1.49 83.615855 82.969867 0.5266 - 2460223.5 70 4 2 1971.226319 1813.505439 69.182347 0.046801 60.46652 8.45141 20.798 1.49 83.615131 82.956089 0.5192 - 2460224.5 70 4 2 1971.528584 1812.361144 69.182347 0.048934 60.46041 8.44849 20.796 1.49 83.614408 82.942565 0.5115 - 2460225.5 70 4 2 1971.840095 1811.172397 69.182347 0.050643 60.45406 8.44547 20.795 1.49 83.613685 82.929353 0.5035 - 2460226.5 70 4 2 1972.160145 1809.944650 69.182348 0.052095 60.44750 8.44236 20.794 1.49 83.612961 82.916471 0.4954 - 2460227.5 70 4 2 1972.484084 1808.682404 69.182350 0.053363 60.44075 8.43919 20.792 1.49 83.612238 82.903932 0.4871 - 2460228.5 70 4 2 1972.811565 1807.392809 69.182352 0.054473 60.43385 8.43597 20.791 1.49 83.611515 82.891750 0.4787 - 2460229.5 70 4 2 1973.139007 1806.076605 69.182354 0.055414 60.42680 8.43272 20.790 1.49 83.610791 82.879944 0.4701 - 2460230.5 70 4 2 1973.467494 1804.738876 69.182358 0.056123 60.41963 8.42944 20.788 1.49 83.610068 82.868542 0.4615 - 2460231.5 70 4 2 1973.791305 1803.387890 69.182361 0.056414 60.41238 8.42617 20.787 1.49 83.609345 82.857585 0.4528 - 2460232.5 70 4 2 1974.102222 1802.037747 69.182365 0.055711 60.40512 8.42297 20.785 1.49 83.608622 82.847125 0.4442 + sector camera ccd column row tdb-ut ... dec vmag hmag sun_distance obs_distance sto_angle + time ... + 2460208.5 70 4 2 1965.994639 1827.049672 69.182409 ... 8.49483 20.815 1.49 83.626009 83.171983 0.6184 + 2460209.5 70 4 2 1966.304467 1826.442414 69.182402 ... 8.49248 20.814 1.49 83.625285 83.156153 0.6137 + 2460210.5 70 4 2 1966.639579 1825.743198 69.182395 ... 8.48989 20.813 1.49 83.624561 83.140210 0.6085 + 2460211.5 70 4 2 1966.995717 1824.975902 69.182389 ... 8.48711 20.812 1.49 83.623838 83.124461 0.6029 + 2460212.5 70 4 2 1967.363962 1824.160062 69.182383 ... 8.48421 20.811 1.49 83.623114 83.108974 0.5970 + 2460213.5 70 4 2 1967.743247 1823.299432 69.182377 ... 8.48120 20.810 1.49 83.622391 83.093770 0.5908 + 2460214.5 70 4 2 1968.127856 1822.402268 69.182372 ... 8.47812 20.809 1.49 83.621667 83.078862 0.5845 + 2460215.5 70 4 2 1968.516359 1821.470633 69.182367 ... 8.47498 20.808 1.49 83.620944 83.064264 0.5779 + 2460216.5 70 4 2 1968.909479 1820.507912 69.182363 ... 8.47178 20.806 1.49 83.620220 83.049995 0.5712 + 2460217.5 70 4 2 1969.301139 1819.520671 69.182359 ... 8.46856 20.805 1.49 83.619497 83.036082 0.5644 + 2460218.5 70 4 2 1969.690629 1818.514364 69.182355 ... 8.46533 20.804 1.49 83.618773 83.022562 0.5575 + 2460219.5 70 4 2 1970.070096 1817.504775 69.182353 ... 8.46215 20.803 1.49 83.618050 83.009481 0.5504 + 2460220.5 70 4 2 1970.413447 1816.527398 69.182350 ... 8.45920 20.802 1.49 83.617326 82.996774 0.5435 + 2460221.5 70 4 2 1970.685594 1815.593040 69.182349 ... 8.45668 20.800 1.49 83.616603 82.983681 0.5369 + 2460222.5 70 4 2 1970.945096 1814.590453 69.182347 ... 8.45415 20.799 1.49 83.615879 82.969891 0.5301 + 2460223.5 70 4 2 1971.228110 1813.505068 69.182347 ... 8.45140 20.798 1.49 83.615156 82.956113 0.5228 + 2460224.5 70 4 2 1971.528584 1812.361144 69.182347 ... 8.44849 20.796 1.49 83.614433 82.942589 0.5152 + 2460225.5 70 4 2 1971.840095 1811.172397 69.182347 ... 8.44547 20.795 1.49 83.613709 82.929377 0.5074 + 2460226.5 70 4 2 1972.160145 1809.944650 69.182348 ... 8.44236 20.794 1.49 83.612986 82.916495 0.4993 + 2460227.5 70 4 2 1972.484084 1808.682404 69.182350 ... 8.43919 20.792 1.49 83.612263 82.903956 0.4911 + 2460228.5 70 4 2 1972.811565 1807.392809 69.182352 ... 8.43597 20.791 1.49 83.611539 82.891774 0.4827 + 2460229.5 70 4 2 1973.139007 1806.076605 69.182354 ... 8.43272 20.790 1.49 83.610816 82.879968 0.4742 + 2460230.5 70 4 2 1973.467494 1804.738876 69.182358 ... 8.42944 20.788 1.49 83.610093 82.868566 0.4657 + 2460231.5 70 4 2 1973.791305 1803.387890 69.182361 ... 8.42617 20.787 1.49 83.609370 82.857609 0.4570 + 2460232.5 70 4 2 1974.102222 1802.037747 69.182365 ... 8.42297 20.785 1.49 83.608646 82.847150 0.4483 When passing the ``sector`` parameter, the ``time_step`` is by default 1 day. This can be changed as follows: +.. code-block:: python + >>> ephem("Sedna", sector=70, time_step=0.1) - sector camera ccd column row tdb-ut pixels_per_hour ra dec vmag hmag sun_distance obs_distance phase_angle - time - 2460207.6 70 4 2 1965.698467 1827.543203 69.182416 0.026894 60.539373 8.496977 20.815973 1.49 83.626635 83.185495 0.620233 - 2460207.7 70 4 2 1965.734658 1827.487317 69.182415 0.026487 60.539100 8.496720 20.816002 1.49 83.626563 83.184025 0.619771 - 2460207.8 70 4 2 1965.769986 1827.432018 69.182415 0.026102 60.538829 8.496468 20.816045 1.49 83.626491 83.182549 0.619312 - 2460207.9 70 4 2 1965.804410 1827.377187 69.182414 0.025764 60.538559 8.496221 20.816058 1.49 83.626418 83.181067 0.618856 - 2460208.0 70 4 2 1965.837889 1827.322705 69.182413 0.025498 60.538290 8.495980 20.816000 1.49 83.626346 83.179575 0.618400 - ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... - 2460233.0 70 4 2 1974.248380 1801.371667 69.182368 0.054524 60.401530 8.421430 20.785000 1.49 83.608260 82.842086 0.439900 - 2460233.1 70 4 2 1974.275695 1801.240320 69.182368 0.054170 60.400820 8.421134 20.784886 1.49 83.608188 82.841090 0.439050 - 2460233.2 70 4 2 1974.302128 1801.109815 69.182369 0.053786 60.400114 8.420844 20.784707 1.49 83.608115 82.840098 0.438204 - 2460233.3 70 4 2 1974.327659 1800.980176 69.182369 0.053386 60.399412 8.420560 20.784486 1.49 83.608043 82.839105 0.437364 - 2460233.4 70 4 2 1974.352268 1800.851430 69.182370 0.052985 60.398714 8.420282 20.784243 1.49 83.607971 82.838112 0.436529 + sector camera ccd column row tdb-ut ... dec vmag hmag sun_distance obs_distance sto_angle + time ... + 2460207.6 70 4 2 1965.698467 1827.543203 69.182416 ... 8.496977 20.815973 1.49 83.626660 83.185519 0.622423 + 2460207.7 70 4 2 1965.734658 1827.487317 69.182415 ... 8.496720 20.816002 1.49 83.626588 83.184049 0.621956 + 2460207.8 70 4 2 1965.769986 1827.432018 69.182415 ... 8.496468 20.816045 1.49 83.626515 83.182573 0.621497 + 2460207.9 70 4 2 1965.804411 1827.377187 69.182414 ... 8.496221 20.816058 1.49 83.626443 83.181091 0.621046 + 2460208.0 70 4 2 1965.837889 1827.322705 69.182413 ... 8.495980 20.816000 1.49 83.626370 83.179599 0.620600 + ... ... ... ... ... ... ... ... ... ... ... ... ... ... + 2460233.0 70 4 2 1974.248380 1801.371667 69.182368 ... 8.421430 20.785000 1.49 83.608285 82.842110 0.444000 + 2460233.1 70 4 2 1974.275695 1801.240320 69.182368 ... 8.421134 20.784886 1.49 83.608212 82.841115 0.443137 + 2460233.2 70 4 2 1974.302128 1801.109815 69.182369 ... 8.420844 20.784707 1.49 83.608140 82.840122 0.442275 + 2460233.3 70 4 2 1974.327659 1800.980176 69.182369 ... 8.420560 20.784486 1.49 83.608068 82.839129 0.441414 + 2460233.4 70 4 2 1974.352268 1800.851430 69.182370 ... 8.420282 20.784243 1.49 83.607995 82.838136 0.440555 [259 rows x 14 columns] diff --git a/pyproject.toml b/pyproject.toml index 64521bd..f6f8ca4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tess-ephem" -version = "0.6.3" +version = "0.6.4" description = "Where are Solar System objects located in TESS FFI data?" license = "MIT" authors = ["Geert Barentsen ", diff --git a/src/tess_ephem/__init__.py b/src/tess_ephem/__init__.py index 234020f..11dfb7b 100644 --- a/src/tess_ephem/__init__.py +++ b/src/tess_ephem/__init__.py @@ -6,5 +6,5 @@ from .ephem import TessEphem, ephem # noqa: E402 -__version__ = "0.6.3" +__version__ = "0.6.4" __all__ = ["ephem", "TessEphem"] diff --git a/src/tess_ephem/ephem.py b/src/tess_ephem/ephem.py index abd325d..ed99efe 100644 --- a/src/tess_ephem/ephem.py +++ b/src/tess_ephem/ephem.py @@ -69,8 +69,8 @@ def __init__( self._deltaf = CubicSpline(eph["datetime_jd"], eph["delta"]) # Delta-T (TDB - UT) self._deltat = CubicSpline(eph["datetime_jd"], eph["TDB-UT"]) - # Phase angle - self._phif = CubicSpline(eph["datetime_jd"], eph["alpha_true"]) + # Sun-Target-Observer (~phase) angle + self._alphaf = CubicSpline(eph["datetime_jd"], eph["alpha"]) # Motion expressed in TESS pixels per hour motion = ( np.hypot(eph["RA_rate"].quantity, eph["DEC_rate"].quantity) @@ -105,7 +105,7 @@ def predict_sky(self, time: Time) -> DataFrame: H = np.full(len(time.jd), np.nan) r = self._rf(time.jd) delta = self._deltaf(time.jd) - phi = self._phif(time.jd) + sto_angle = self._alphaf(time.jd) motion = self._motionf(time.jd) deltat = self._deltat(time.jd) return DataFrame( @@ -119,7 +119,7 @@ def predict_sky(self, time: Time) -> DataFrame: "hmag": H, "sun_distance": r, "obs_distance": delta, - "phase_angle": phi, + "sto_angle": sto_angle, } ) @@ -288,7 +288,7 @@ def _get_horizons_ephem( step: str = "12H", id_type: str = "smallbody", location: str = "@TESS", - quantities: str = "1,3,9,19,20,30,43", + quantities: str = "1,3,9,19,20,24,30", ): """Returns JPL Horizons ephemeris. diff --git a/tests/test_ephem.py b/tests/test_ephem.py index 20c4990..e02223c 100644 --- a/tests/test_ephem.py +++ b/tests/test_ephem.py @@ -49,7 +49,7 @@ def test_predict(): # 2. using tessrip to get average WCS from sector/camera/ccd # 3. converting RA,Dec to col,row with wcs_world2pix() assert np.round(pixel_locations.iloc[0]["row"], 1) == 1107.6 - assert np.round(pixel_locations.iloc[0]["column"], 1) == 1087.8 + assert np.round(pixel_locations.iloc[0]["column"], 1) == 1087.9 def test_orbital_elements():