Skip to content

Commit b5c3576

Browse files
committed
✨ Activate stellar aberration correctionb
1 parent 8990fe3 commit b5c3576

File tree

6 files changed

+32
-12
lines changed

6 files changed

+32
-12
lines changed

README.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,26 @@ Obtaining pixel coordinates for a specific celestial coordinate:
5858
>>> from astropy.coordinates import SkyCoord
5959
>>> crd = SkyCoord(ra=60, dec=70, unit='deg')
6060
>>> locate(crd)
61-
List of 1 coordinates
62-
↳[TessCoord(sector=19, camera=2, ccd=2, column=355.3, row=1045.9, time=None)]
61+
List of 4 coordinates
62+
↳[TessCoord(sector=19, camera=2, ccd=2, column=355.3, row=1045.9, time=None)
63+
TessCoord(sector=25, camera=4, ccd=4, column=1107.0, row=285.9, time=None)
64+
TessCoord(sector=26, camera=4, ccd=3, column=317.7, row=395.9, time=None)
65+
TessCoord(sector=52, camera=4, ccd=4, column=603.5, row=240.2, time=None)]
6366
6467
6568
You can access the properties of `TessCoord` objects using standard list and attribute syntax:
6669

6770
.. code-block:: python
6871
6972
>>> crdlist = locate("Alpha Cen")
70-
>>> crdlist[0].sector, crdlist[0].camera, crdlist[0].ccd, crdlist[0].column, crdlist[0].row
71-
(11, 2, 2, 1699.0540739785683, 1860.2510951146114)
73+
>>> crdlist[0].sector, crdlist[0].camera, crdlist[0].ccd
74+
(11, 2, 2)
75+
>>> crdlist[0].column, crdlist[0].row
76+
(1699.0540739785683, 1860.2510951146114)
7277
7378
74-
When you have obtained a `TessCoord` object, you can use it to obtain a list of the TESS Full Frame Images (FFIs) which covered the position:
79+
When you have obtained a `TessCoord` object, you can use it to obtain a list of the TESS Full Frame Images (FFIs) which covered the position.
80+
The objects returned are provided by the `tess-cloud <https://github.com/SSDataLab/tess-cloud>`_ package.
7581

7682
.. code-block:: python
7783

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tess-locator"
3-
version = "0.5.0"
3+
version = "0.6.dev"
44
description = "Fast offline queries of TESS FFI positions and filenames."
55
license = "MIT"
66
authors = ["Geert Barentsen <[email protected]>",
@@ -37,10 +37,11 @@ line-profiler = "^3.1.0"
3737
jupyterlab = "^2.2.9"
3838
pytest-xdist = "^2.1.0"
3939
pre-commit = "^2.8.2"
40+
Pygments = "^2.9.0"
4041
mkdocs = "^1.1.2"
4142
mkdocs-material = "^7.1.4"
42-
Pygments = "^2.9.0"
4343
mkdocstrings = "^0.15.0"
44+
pytkdocs = {version = "^0.11.1", extras = ["numpy-style"]}
4445
#tess-cloud = {path = "../tess-cloud", develop = true}
4546

4647
[build-system]

src/tess_locator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33
import tess_stars2px # provided by the `tess-point` package
44

5-
__version__ = "0.5.0"
5+
__version__ = "0.6.dev"
66

77
# Where does this package store its embedded data?
88
PACKAGEDIR: Path = Path(__file__).parent.absolute()

src/tess_locator/locate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ def locate(
1414
target: Union[SkyCoord, str],
1515
time: Union[Time, str, List[str]] = None,
1616
sector: Union[int, List[int]] = None,
17+
aberrate: bool = True
1718
) -> TessCoordList:
19+
"""Locate a target in the TESS FFI data set."""
1820
# Allow the target coordinate to be instantiated from a string
1921
if isinstance(target, str):
2022
target = SkyCoord.from_name(target)
@@ -53,7 +55,7 @@ def locate(
5355
out_row,
5456
scinfo,
5557
) = tess_stars2px_function_entry(
56-
0, ra[idx], dec[idx], trySector=sectors_to_search[idx]
58+
0, ra[idx], dec[idx], trySector=sectors_to_search[idx], aberrate=aberrate
5759
)
5860

5961
for idx_out in range(len(out_sector)):

src/tess_locator/tesscoord.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Defines the TessCoord and TessCoordList classes."""
12
from collections import UserList
23
from typing import Union, Optional
34

@@ -22,6 +23,17 @@ def _optional_time_converter(time) -> Time:
2223

2324
@attr.s(slots=True)
2425
class TessCoord:
26+
"""Class representing a position in a single TESS Full Frame Image.
27+
28+
Args:
29+
msg (str): Human readable string describing the exception.
30+
code (:obj:`int`, optional): Error code.
31+
32+
Attributes:
33+
msg (str): Human readable string describing the exception.
34+
code (int): Exception error code.
35+
36+
"""
2537
sector: int = attr.ib()
2638
camera: int = attr.ib(validator=attr.validators.in_([1, 2, 3, 4]))
2739
ccd: int = attr.ib(validator=attr.validators.in_([1, 2, 3, 4]))

tests/test_locate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
from tess_locator import locate, SECTORS
1515

1616

17-
@pytest.mark.xfail # Frequent failures during ingest of reprocessed data into MAST
17+
@pytest.mark.xfail # TessCut currently claims Pi Men was in Sector 35 (whereas it was just off edge)
1818
def test_pi_men():
1919
"""Tests `locate()` against `astroquery.mast.Tesscut.get_sectors()`"""
2020
# Query using Tesscut
2121
crd = SkyCoord(ra=84.291188, dec=-80.46911982, unit="deg")
2222
mast_result = Tesscut.get_sectors(crd)
23-
mast_result = mast_result[mast_result["sector"] <= SECTORS]
2423
# Query using our tool
2524
our_result = locate(crd)
2625
# Do the sector, camera, and ccd numbers all match?
@@ -104,7 +103,7 @@ def test_locate_time():
104103
def test_locate_roundtrip():
105104
"""Is the conversion SkyCoord -> TessCoord -> SkyCoord consistent?"""
106105
crd1 = SkyCoord.from_name("Proxima Cen")
107-
crd2 = locate(crd1)[0].to_skycoord()
106+
crd2 = locate(crd1, aberrate=False)[0].to_skycoord()
108107
assert approx(crd1.ra.degree) == crd2.ra.degree
109108
assert approx(crd1.dec.degree) == crd2.dec.degree
110109

0 commit comments

Comments
 (0)