Quickstart Tutorial¶
First install the etta package (see installation instructions). Then import the package.
[1]:
import etta
All PHP wrappers in etta follow a similar pattern of usage: * Call the wrapper with the arguments taken in by the PHP function. * By default, a pandas.DataFrame object will be returned. If you would like the result to be saved to a file instead, specify the output format (csv, pipe-delimited or text) using the output keyword argument and the filepath using the path keyword argument in your
function call.
As an example, we will fetch data about TOI 127 from the TOI table using download_toi. By default, the data will be returned as a pandas object.
[2]:
etta.download_toi(toi=127)
Fetching data from https://exofop.ipac.caltech.edu/tess/download_toi.php?output=pipe&toi=127
[2]:
| TIC ID | Previous CTOI | Master | SG1A | SG1B | SG2 | SG3 | SG4 | SG5 | ACWG ESM | ... | Stellar log(g) (cm/s^2) err | Stellar Radius (R_Sun) | Stellar Radius (R_Sun) err | Stellar Metallicity | Stellar Metallicity err | Sectors | Date TOI Alerted (UTC) | Date TOI Updated (UTC) | Date Modified | Comments | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TOI | |||||||||||||||||||||
| 127.01 | 234523599 | NaN | 5 | 5 | 5 | 5 | 4 | 5 | 5 | 39.1 | ... | NaN | 0.445372 | 0.01356 | NaN | NaN | 1,2,28,29 | 2018-09-05 | 2020-11-06 | 2021-06-01 12:02:45 | HATS-71 b |
1 rows × 57 columns
We can also download the data onto a file, specifying the output format to be pipe-delimited (output='pipe').
[3]:
etta.download_toi(toi=127, output='pipe', path='.')
Fetching data from https://exofop.ipac.caltech.edu/tess/download_toi.php?output=pipe&toi=127
Result written to /home/jenny/TSP/.env/test-package/exofop-tess-api/docs/source/getting-started/download_toi.php?output=pipe&toi=127
It’s as easy as that!
Additional examples¶
Download all imaging observation summaries as a pandas.DataFrame object. Find and display the rows in the dataframe where the TIC ID is 468472950.
[4]:
df = etta.download_imaging()
df.loc[df['TIC ID'] == 468472950]
Fetching data from https://exofop.ipac.caltech.edu/tess/download_imaging.php?output=pipe
[4]:
| TIC ID | TIC | TOI | Telescope | Instrument | Filter | Image Type | Pixel Scale | PSF | Contrast | Obs Date | User | Group | Tag | Notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 16255 | 468472950 | NaN | TOI 1395 | Gemini (8 m) | NIRI | Brgamma | AO | 0.0219 | NaN | NaN | 2019-11-13 | matthews | tfopwg | 7652 | 2 visual companions: sep=0.250arcsec, pa=194.9... |
| 16256 | 468472950 | NaN | TOI 1395 | Gemini (8 m) | NIRI | K | AO | 0.0200 | NaN | NaN | 2019-11-14 | crossfield | NaN | 7518 | Quicklook: close double, 0.25arcsec SSW |
Download all spectroscopic observation summaries for tag 1494 and save to a named file. Read the resulting file. Create pandas.DataFrame object from file.
[5]:
etta.download_tag_spect(tag=1494, output='pipe', path='tag-spect-example')
with open('tag-spect-example', 'r') as file:
# Read and print the file contents (removing trailing newlines)
print('\nFILE CONTENTS:')
print(file.read().rstrip())
# Create pandas.DataFrame object from file
import pandas as pd
pd.read_csv('tag-spect-example', sep='|')
Fetching data from https://exofop.ipac.caltech.edu/tess/download_tag_spect.php?tag=1494&output=pipe
Result written to /home/jenny/TSP/.env/test-package/exofop-tess-api/docs/source/getting-started/tag-spect-example
FILE CONTENTS:
TIC ID|TIC|TOI|Telescope|Instrument|Spectral resolution|Wavelength coverage|SNR/resolution|SNR wavelength|Appropriate to PRV|Obs Date|User|Group|Tag|Notes
231702397|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
259377017|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
259962054|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
262530407|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 nm|||N|2018-12-22|feinstein||1494|
272086159|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
305048087|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|Observed at high air mass
307210830|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|Observations continued into twilight
415969908|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
439456714|||Magellan (Baade) (6.5 m)|FIRE|6000|0.82 to 2.51 microns|||N|2018-12-22|feinstein||1494|
[5]:
| TIC ID | TIC | TOI | Telescope | Instrument | Spectral resolution | Wavelength coverage | SNR/resolution | SNR wavelength | Appropriate to PRV | Obs Date | User | Group | Tag | Notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 231702397 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 1 | 259377017 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 2 | 259962054 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 3 | 262530407 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 nm | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 4 | 272086159 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 5 | 305048087 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | Observed at high air mass |
| 6 | 307210830 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | Observations continued into twilight |
| 7 | 415969908 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
| 8 | 439456714 | NaN | NaN | Magellan (Baade) (6.5 m) | FIRE | 6000 | 0.82 to 2.51 microns | NaN | NaN | N | 2018-12-22 | feinstein | NaN | 1494 | NaN |
Download all observing notes with tag ID 3059, and display rows modified since May 1st 2021.
[6]:
df = etta.download_obsnotes(tag=3059)
df.loc[df['Lastmod'] > '2021-05-01']
Fetching data from https://exofop.ipac.caltech.edu/tess/download_obsnotes.php?output=pipe&tag=3059
[6]:
| ID | TIC ID | Username | Groupname | TAG ID | Lastmod | notes | |
|---|---|---|---|---|---|---|---|
| 0 | 22625 | 293527670 | mlund | tfopwg | 3059 | 2021-07-01 12:02:16 | TOI2323.01:4-sigma odd-even; but perhaps b/c i... |
| 1 | 22624 | 301160638 | mlund | tfopwg | 3059 | 2021-07-01 12:02:16 | TOI3487.01:[P=16.008852] found in faint-star Q... |
| 2 | 22621 | 78775584 | mlund | tfopwg | 3059 | 2021-06-30 12:02:02 | TOI2811.01:evolved host star; Aviad Panahi, Ts... |
| 3 | 22620 | 130981260 | mlund | tfopwg | 3059 | 2021-06-30 12:02:02 | TOI4177.01:slight period shift between Y1 and ... |
| 4 | 22619 | 58533991 | mlund | tfopwg | 3059 | 2021-06-30 12:02:02 | TOI4176.01:large planet candidate; additional ... |
| ... | ... | ... | ... | ... | ... | ... | ... |
| 321 | 22028 | 270604417 | mlund | tfopwg | 3059 | 2021-05-15 12:01:24 | TOI2543.01:[P=7.54321, uT0=0.002117] ~7.5 day ... |
| 322 | 22029 | 417676622 | mlund | tfopwg | 3059 | 2021-05-15 12:01:24 | TOI1290.01:Kepler-68 b; Master Disp: KP, Phot ... |
| 323 | 22026 | 180991313 | mlund | tfopwg | 3059 | 2021-05-15 12:01:23 | TOI2330.01:WASP 128b - 37 Mjup; Master Disp: ... |
| 324 | 22025 | 8400842 | mlund | tfopwg | 3059 | 2021-05-15 12:01:23 | TOI1676.01:XO-3b; Master Disp: KP, Phot Disp:... |
| 325 | 22027 | 155001079 | mlund | tfopwg | 3059 | 2021-05-15 12:01:23 | TOI2434.01:DaveL: The first TRES Observation r... |
326 rows × 7 columns
Download targets near TIC 278683839, sorted by separation.
[7]:
etta.download_nearbytarget(278683839, sort='separation')
Fetching data from https://exofop.ipac.caltech.edu/tess/download_nearbytarget.php?output=pipe&sort=separation&id=278683839
[7]:
| TOI | RA | Dec | TESS Mag | GAIA DR2 | GAIA Mag | Distance(pc) | Distance Err (pc) | PM RA (mas/yr) | PM RA Err (mas/yr) | PM Dec (mas/yr) | PM Dec Err (mas/yr) | Separation (arcsec) | Position Angle (deg E. of N.) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TIC ID | ||||||||||||||
| 278683839 | NaN | 06:36:52.66 | -58:01:36.78 | 17.7210 | 5.484358e+18 | 18.372500 | 1857.6300 | 549.5850 | -1.261630 | 0.291142 | 6.94524 | 0.385658 | 0.00 | 0.00 |
| 737400069 | NaN | 06:36:54.39 | -58:01:37.07 | 19.8590 | 5.484346e+18 | 20.561400 | 1109.1800 | 735.3020 | 1.230050 | 1.389270 | 5.76244 | 2.026930 | 13.62 | 91.24 |
| 737400524 | NaN | 06:36:51.54 | -58:01:24.13 | 18.8582 | 5.484358e+18 | 19.908300 | 1299.8900 | 716.4240 | -0.253550 | 0.811719 | -4.00525 | 1.221810 | 15.70 | 324.88 |
| 278683836 | NaN | 06:36:51.71 | -58:01:57.62 | 16.4952 | 5.484346e+18 | 17.171800 | 1787.8900 | 244.3150 | 1.148980 | 0.137737 | 5.87397 | 0.174472 | 22.05 | 199.82 |
| 278683837 | NaN | 06:36:49.09 | -58:01:55.35 | 16.3578 | 5.484358e+18 | 17.011800 | 1328.4900 | 135.2700 | 1.630270 | 0.127436 | 17.44110 | 0.170934 | 33.95 | 236.80 |
| 278683840 | NaN | 06:36:57.57 | -58:01:29.64 | 16.2782 | 5.484346e+18 | 17.494600 | 335.0200 | 10.8830 | 4.711510 | 0.185457 | -23.28290 | 0.212447 | 39.51 | 79.63 |
| 278683835 | NaN | 06:36:57.46 | -58:02:03.66 | 16.7609 | 5.484346e+18 | 17.304900 | 2609.0000 | 529.3100 | -1.273080 | 0.149156 | 5.12392 | 0.192750 | 46.41 | 125.19 |
| 278683844 | 119.0 | 06:36:57.22 | -58:00:58.15 | 9.2789 | 5.484358e+18 | 9.820911 | 66.6187 | 0.1003 | 51.496900 | 0.041663 | -205.60000 | 0.049415 | 52.99 | 43.18 |
| 737400067 | NaN | 06:36:56.28 | -58:02:23.79 | 17.4752 | 5.484346e+18 | 17.965500 | 3566.4900 | 964.7700 | 1.390850 | 0.220959 | 6.87784 | 0.307795 | 54.85 | 148.57 |
| 278683834 | NaN | 06:36:49.29 | -58:02:25.18 | 15.6266 | 5.484346e+18 | 16.664200 | 416.1930 | 8.9760 | 5.831520 | 0.101817 | 6.28829 | 0.135095 | 55.23 | 208.92 |
| 278683838 | NaN | 06:36:59.79 | -58:01:43.29 | 18.2350 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 56.86 | 96.55 |
| 737400070 | NaN | 06:36:59.79 | -58:01:43.28 | 18.5228 | 5.484346e+18 | 19.598900 | 795.8020 | 340.1850 | -8.540880 | 0.679449 | 6.04446 | 1.012590 | 56.86 | 96.55 |
| 278683846 | NaN | 06:36:51.39 | -58:00:39.96 | 15.9036 | 5.484358e+18 | 16.419300 | 1866.5800 | 168.6950 | -0.712302 | 0.091340 | 7.04877 | 0.114378 | 57.91 | 349.94 |
| 278683842 | NaN | 06:36:46.01 | -58:01:09.26 | 13.1419 | 5.484358e+18 | 13.611800 | 770.4610 | 9.3605 | 6.401700 | 0.031504 | 9.66757 | 0.036210 | 59.80 | 297.51 |