Using tesswcs
to find observable targets
tesswcs
has some convenience functions to help you find out which targets are observable with TESS. The get_pixel_locations
functon will accept sky coordinates, and return a table of which sector, camera, CCD, row, and column those targets fall on (if any).
Let's take a look at how to use it.
Example 1: Finding where transiting planets fall on TESS pixels
from tesswcs.locate import get_pixel_locations
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.table import Table
First, we need a target list to check the observability of. For this purpose, I will use the list of confirmed exoplanets. Below I use astroquery to get the coordinates of all the confirmed, transiting exoplanets from the Exoplanet Archive.
from astroquery.ipac.nexsci.nasa_exoplanet_archive import NasaExoplanetArchive
confirmed_exoplanets_table = NasaExoplanetArchive.query_criteria(table="ps", select="pl_name,ra,dec,sy_tmag", where="default_flag=1 AND tran_flag=1")
confirmed_exoplanets_table.sort('sy_tmag')
pl_name | ra | dec | sy_tmag | sky_coord |
---|---|---|---|---|
deg | deg | mag | deg,deg | |
str19 | float64 | float64 | float64 | SkyCoord |
HD 219134 c | 348.3372026 | 57.1696255 | 4.6278 | 348.3372026,57.1696255 |
HD 219134 b | 348.3372026 | 57.1696255 | 4.6278 | 348.3372026,57.1696255 |
HD 136352 b | 230.4401147 | -48.3188174 | 5.0494 | 230.4401147,-48.3188174 |
HD 136352 c | 230.4401147 | -48.3188174 | 5.0494 | 230.4401147,-48.3188174 |
HD 136352 d | 230.4401147 | -48.3188174 | 5.0494 | 230.4401147,-48.3188174 |
pi Men c | 84.2992798 | -80.4646041 | 5.1054 | 84.2992798,-80.4646041 |
... | ... | ... | ... | ... |
WD 1856+534 b | 284.415675 | 53.5090244 | 16.338 | 284.415675,53.5090244 |
Lupus-TR-3 b | 232.5774696 | -42.9799461 | 17.7596 | 232.5774696,-42.9799461 |
HAT-P-63 b | 279.7967696 | -20.0242684 | 19.2571 | 279.7967696,-20.0242684 |
OGLE-TR-56 b | 269.1479583 | -29.5392222 | nan | 269.1479583,-29.5392222 |
SWEEPS-11 b | 269.7583333 | -29.1981944 | nan | 269.7583333,-29.1981944 |
SWEEPS-4 b | 269.7246667 | -29.1890556 | nan | 269.7246667,-29.1890556 |
<SkyCoord (ICRS): (ra, dec) in deg
[(348.3372026, 57.1696255), (348.3372026, 57.1696255),
(230.4401147, -48.3188174), ..., (269.1479583, -29.5392222),
(269.7583333, -29.1981944), (269.7246667, -29.1890556)]>
I can now pass these SkyCoord
s to get_pixel_location
to get a table of the regions those targets fall on. Any targets that do not fall on a pixel will be omitted.
We can use pandas to learn more about this table. For example, how many planets are observable for the first time during cycle 7?
Sector | Camera | CCD | Row | Column | |
---|---|---|---|---|---|
Target Index | |||||
0 | 17 | 2 | 1 | 384.5 | 105.2 |
1 | 17 | 2 | 1 | 384.5 | 105.2 |
2 | 12 | 1 | 1 | 204.0 | 107.7 |
3 | 12 | 1 | 1 | 204.0 | 107.7 |
4 | 12 | 1 | 1 | 204.0 | 107.7 |
... | ... | ... | ... | ... | ... |
4171 | 12 | 1 | 1 | 147.9 | 1114.4 |
4172 | 92 | 1 | 2 | 418.6 | 1154.5 |
4173 | 39 | 1 | 1 | 356.6 | 27.1 |
4174 | 65 | 1 | 1 | 1057.1 | 1334.6 |
4175 | 65 | 1 | 1 | 1055.5 | 1339.7 |
4169 rows × 5 columns
This groupby operation takes the min
across all the columns for cases of the same 'Target Index'
cycle7_mask = (g['Sector'] >= 84) & (g['Sector'] <= 96)
target_index = list(g[cycle7_mask].index)
print(len(target_index))
92
There are 92 confirmed transiting planets that will be observed for the first time in Cycle 7!
pl_name | ra | dec | sy_tmag | sky_coord |
---|---|---|---|---|
deg | deg | mag | deg,deg | |
str19 | float64 | float64 | float64 | SkyCoord |
HD 106315 c | 183.4724742 | -0.3934357 | 8.56338 | 183.4724742,-0.3934357 |
HD 106315 b | 183.4724742 | -0.3934357 | 8.56338 | 183.4724742,-0.3934357 |
Wolf 503 b | 206.8461979 | -6.1393369 | 9.2493 | 206.8461979,-6.1393369 |
HD 137496 b | 231.7420543 | -16.5090014 | 9.29961 | 231.7420543,-16.5090014 |
K2-292 b | 205.3758786 | -9.9460704 | 9.31975 | 205.3758786,-9.9460704 |
K2-233 b | 230.4799011 | -20.2317975 | 9.8125 | 230.4799011,-20.2317975 |
... | ... | ... | ... | ... |
K2-316 c | 233.6247336 | -23.2594663 | 14.2731 | 233.6247336,-23.2594663 |
K2-316 b | 233.6247336 | -23.2594663 | 14.2731 | 233.6247336,-23.2594663 |
K2-52 b | 246.6114157 | -24.9699462 | 14.2904 | 246.6114157,-24.9699462 |
K2-315 b | 228.0210932 | -20.1081634 | 14.3273 | 228.0210932,-20.1081634 |
K2-378 b | 205.1596569 | -11.1172332 | 14.8943 | 205.1596569,-11.1172332 |
HAT-P-63 b | 279.7967696 | -20.0242684 | 19.2571 | 279.7967696,-20.0242684 |
Example 2: Finding whether a transient will be observable with TESS
Sometimes we might find an interesting transient, and we want to know whether it will fall on a TESS pixel so that we can recover the optical time-series when the data is downlinked. For example, GRB 231106A occured in November 2023 and happened to be observable during the TESS survey.
Here we show how we would find out if a transient has been (or will be) observable with TESS.
To do this we will need two things, the coordinate of the object, and the time at which we would like to observe it. Here we'll use the location and detection time of GRB 231106A.
from astropy.time import Time
from astropy.coordinates import SkyCoord
t = Time('2023-11-06T18:13:23Z')
c = SkyCoord(113.4482, 29.2245, unit='degree')
Target Index | Sector | Camera | CCD | Row | Column |
---|---|---|---|---|---|
int64 | int64 | int64 | int64 | float64 | float64 |
0 | 71 | 4 | 1 | 764.6 | 1451.4 |
We can see that this returned a hit, we are able to detect the target during Sector 71, on Camera 4, CCD 1!
In instances where the time passed is recent (or in the future!) and there is no archival TESS WCS to use, tesswcs
will predict the WCS for future TESS pointings.