tglc 0.6.2__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tglc-0.6.4/PKG-INFO ADDED
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.1
2
+ Name: tglc
3
+ Version: 0.6.4
4
+ Summary: TESS-Gaia Light Curve
5
+ Home-page: https://github.com/TeHanHunter/TESS_Gaia_Light_Curve
6
+ Author: Te Han
7
+ Author-email: tehanhunter@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/x-rst
13
+ License-File: LICENSE
14
+
15
+ ==================================
16
+ Introduction
17
+ ==================================
18
+
19
+ TESS-Gaia Light Curve (`TGLC <https://archive.stsci.edu/hlsp/tglc>`_) is a dataset of TESS full-frame image light curves publicly available via the MAST portal. It is fitted with effective PSF and decontaminated with Gaia DR3 and achieved percent-level photometric precision down to 16th TESS magnitude! It unlocks astrophysics to a vast number of dim stars below 12th TESS magnitude. A package called tglc is pip-installable for customized light curve fits.
20
+
21
+ ==================================
22
+ Usage
23
+ ==================================
24
+ There are four fluxes in each FITS file: aperture flux, PSF flux, calibrated aperture flux, and calibrated PSF flux.
25
+ If you are uncertain which to use:
26
+
27
+ * Calibrated psf flux is better in **deblending** targets. Use this if you need to deblend a target near a variable source. The best deblending can be achieved with tglc package by setting a non-zero prior. It also gives the more accurate **transit depth** in most cases, especially when fitting with an optimized prior.
28
+ * Calibrated aperture flux usually has slightly **higher SNR**. The transit depth (or variation amplitude), however, can be imperfect since the normalization depends on the PSF fitting which is imperfect. This imperfection can be minimized by using a bigger aperture than the default aperture (3*3). One need to use the tglc package and set tglc_lc(save_aper=True) to access the 5*5 aperture. In the presence of a bright but "constant" contamination (several magnitudes brighter), the calibrated aperture flux is better in removing the constant contamination.
29
+ * The aperture flux and PSF flux are not detrended or normalized. Use this if you are doing stellar variability science with long baseline. Or, if the detrending is not optimal (default detrending has a window length of 1 day; see Known Problems below), start with the aperture flux or PSF flux and detrend carefully!
30
+ * **If you are uncertain, start with calibrated aperture flux!**
31
+
32
+ The `tutorial <tutorial/TGLC_tutorial.ipynb>`_ shows the syntaxes and differences among these light curves in several examples.
33
+
34
+ ==================================
35
+ Data Access
36
+ ==================================
37
+ There are three data access methods:
38
+
39
+ * MAST Portal: Easiest for acquiring light curves for a few stars. However, new sectors are updated relatively slowly.
40
+ * MAST bulk download: Best for downloading light curves for all stars (<16 TESS magnitude) in a sectors.
41
+ * tglc package: Capable of producing similar quality light curves for any sector and any star with custom options.
42
+
43
+ MAST Portal/bulk download
44
+ ----------------------------
45
+ The easiest usage requires no package installation. Simply follow the `TGLC HLSP page <https://archive.stsci.edu/hlsp/tglc>`_ to download light curves from MAST or use `MAST Portal <https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html>`_. Light curves are being fitted sector by sector and will be available on MAST gradually. MAST hosts all Gaia DR3 stars down to 16th magnitude. Each .fits file includes PSF and aperture light curves and their calibrated versions.
46
+
47
+ MAST available sectors: `sector worklist <https://docs.google.com/spreadsheets/d/1FhHElWb1wmx9asWiZecAJ2umN0-P_aXn55OBVB34_rg/edit?usp=sharing>`_
48
+
49
+
50
+ tglc package
51
+ ----------------------------
52
+ Users can also fit light curves using the package tglc. Using tglc, one can specify a region, sector(s), and customized aperture shape if needed. It can also allow all field stars to float by assigning Gaussian priors, which can help decontaminate variable field stars. tglc is currently only available for linux. Run::
53
+
54
+ pip install tglc
55
+
56
+ for the latest tglc release. After installation, follow the `tutorial <tutorial/TGLC_tutorial.ipynb>`_ to fit light curves. If there is a problem, please leave a comment in the Issues section to help us improve. Thank you!
57
+
58
+
59
+ ==================================
60
+ Known Problems
61
+ ==================================
62
+ There are several imperfections we noticed in the MAST TGLC light curves and tglc package:
63
+
64
+ * If the star is very dim (~< 15 Tmag) near a variable source, it can make the aperture and/or PSF light curve negative for some cadences. The detrending algorithm could malfunction and result in bad cal_aper_flux and/or cal_psf_flux. This is now fixed for tglc package, but this problem remains for the primary mission light curves published on MAST. Please detrend again if necessary. The extended mission light curves on MAST will not be affected. This is a very rare scenario, but could be important.
65
+
66
+ ==================================
67
+ Reference
68
+ ==================================
69
+ If you find the TGLC light curves or the tglc package useful in your research, please cite `our paper <https://iopscience.iop.org/article/10.3847/1538-3881/acaaa7>`_ published on the Astronomical Journal.
@@ -4,7 +4,6 @@ Introduction
4
4
 
5
5
  TESS-Gaia Light Curve (`TGLC <https://archive.stsci.edu/hlsp/tglc>`_) is a dataset of TESS full-frame image light curves publicly available via the MAST portal. It is fitted with effective PSF and decontaminated with Gaia DR3 and achieved percent-level photometric precision down to 16th TESS magnitude! It unlocks astrophysics to a vast number of dim stars below 12th TESS magnitude. A package called tglc is pip-installable for customized light curve fits.
6
6
 
7
-
8
7
  ==================================
9
8
  Usage
10
9
  ==================================
@@ -6,7 +6,7 @@ with open("README.rst", "r", encoding="utf-8") as fh:
6
6
  long_description = fh.read()
7
7
  setuptools.setup(
8
8
  name="tglc",
9
- version='0.6.2',
9
+ version='0.6.4',
10
10
  author="Te Han",
11
11
  author_email="tehanhunter@gmail.com",
12
12
  description="TESS-Gaia Light Curve",
@@ -0,0 +1,3 @@
1
+ __version__ = "0.6.4"
2
+ __author__ = 'Te Han, Timothy Brandt'
3
+ __credits__ = 'University of California, Santa Barbara'
@@ -203,7 +203,7 @@ class Source(object):
203
203
  self.mask = mask[y:y + size, x:x + size]
204
204
  self.time = np.array(time)
205
205
  median_time = np.median(self.time)
206
- interval = (median_time + 388.5) / 365.25
206
+ interval = (median_time - 388.5) / 365.25
207
207
  # Julian Day Number: 2457000.0 (TBJD=0)
208
208
  # Calendar Date/Time: 2014-12-08 12:00:00 388.5 days before J2016
209
209
 
@@ -260,7 +260,7 @@ class Source(object):
260
260
  attempt = 0
261
261
  while attempt < 5:
262
262
  try:
263
- catalogdata = Gaia.cone_search_async(coord, radius,
263
+ catalogdata = Gaia.cone_search_async(coord, radius=radius,
264
264
  columns=['DESIGNATION', 'phot_g_mean_mag', 'phot_bp_mean_mag',
265
265
  'phot_rp_mean_mag', 'ra', 'dec', 'pmra', 'pmdec']).get_results()
266
266
  return catalogdata
@@ -60,7 +60,7 @@ class Source_cut(object):
60
60
  coord = SkyCoord(ra=ra, dec=dec, unit=(u.degree, u.degree), frame='icrs')
61
61
  radius = u.Quantity((self.size + 6) * 21 * 0.707 / 3600, u.deg)
62
62
  print(f'Target Gaia: {target[0]["designation"]}')
63
- catalogdata = Gaia.cone_search_async(coord, radius,
63
+ catalogdata = Gaia.cone_search_async(coord, radius=radius,
64
64
  columns=['DESIGNATION', 'phot_g_mean_mag', 'phot_bp_mean_mag',
65
65
  'phot_rp_mean_mag', 'ra', 'dec', 'pmra', 'pmdec']).get_results()
66
66
  print(f'Found {len(catalogdata)} Gaia DR3 objects.')
@@ -94,7 +94,6 @@ class Source_cut(object):
94
94
  else:
95
95
  self.select_sector(sector=sector)
96
96
 
97
-
98
97
  def select_sector(self, sector=1):
99
98
  """
100
99
  select sector to use if target is in multi-sectors
@@ -127,7 +126,7 @@ class Source_cut(object):
127
126
  self.flux_err = data_flux_err
128
127
  self.quality = data_quality
129
128
  median_time = np.median(data_time)
130
- interval = (median_time + 388.5) / 365.25
129
+ interval = (median_time - 388.5) / 365.25
131
130
 
132
131
  mask = np.ones(np.shape(data_flux[0]))
133
132
  bad_pixels = np.zeros(np.shape(data_flux[0]))
@@ -30,11 +30,11 @@ def tglc_lc(target='TIC 264468702', local_directory='', size=90, save_aper=True,
30
30
  Generate light curve for a single target.
31
31
 
32
32
  :param target: target identifier
33
- :type target: str, required
33
+ :kind target: str, required
34
34
  :param local_directory: output directory
35
- :type local_directory: str, required
35
+ :kind local_directory: str, required
36
36
  :param size: size of the FFI cut, default size is 90. Recommend large number for better quality. Cannot exceed 100.
37
- :type size: int, optional
37
+ :kind size: int, optional
38
38
  '''
39
39
  os.makedirs(local_directory + f'logs/', exist_ok=True)
40
40
  os.makedirs(local_directory + f'lc/', exist_ok=True)
@@ -161,27 +161,27 @@ def star_spliter(server=1, # or 2
161
161
  return
162
162
 
163
163
 
164
- def plot_lc(local_directory=None, type='cal_aper_flux', xlow=None, xhigh=None, ylow=None, yhigh=None):
164
+ def plot_lc(local_directory=None, kind='cal_aper_flux', xlow=None, xhigh=None, ylow=None, yhigh=None):
165
165
  files = glob(f'{local_directory}lc/*.fits')
166
166
  os.makedirs(f'{local_directory}plots/', exist_ok=True)
167
167
  for i in range(len(files)):
168
168
  with fits.open(files[i], mode='denywrite') as hdul:
169
169
  q = [a and b for a, b in zip(list(hdul[1].data['TESS_flags'] == 0), list(hdul[1].data['TGLC_flags'] == 0))]
170
170
  plt.figure(constrained_layout=False, figsize=(8, 4))
171
- plt.plot(hdul[1].data['time'], hdul[1].data[type], '.', c='silver', label=type)
172
- plt.plot(hdul[1].data['time'][q], hdul[1].data[type][q], '.k', label=f'{type}_flagged')
171
+ plt.plot(hdul[1].data['time'], hdul[1].data[kind], '.', c='silver', label=kind)
172
+ plt.plot(hdul[1].data['time'][q], hdul[1].data[kind][q], '.k', label=f'{kind}_flagged')
173
173
  plt.xlim(xlow, xhigh)
174
174
  plt.ylim(ylow, yhigh)
175
- plt.title(f'TIC_{hdul[0].header["TICID"]}_sector_{hdul[0].header["SECTOR"]:04d}_{type}')
175
+ plt.title(f'TIC_{hdul[0].header["TICID"]}_sector_{hdul[0].header["SECTOR"]:04d}_{kind}')
176
176
  plt.legend()
177
177
  # plt.show()
178
178
  plt.savefig(
179
- f'{local_directory}plots/TIC_{hdul[0].header["TICID"]}_sector_{hdul[0].header["SECTOR"]:04d}_{type}.png',
179
+ f'{local_directory}plots/TIC_{hdul[0].header["TICID"]}_sector_{hdul[0].header["SECTOR"]:04d}_{kind}.png',
180
180
  dpi=300)
181
181
  plt.close()
182
182
 
183
183
 
184
- def plot_aperture(local_directory=None, type='cal_aper_flux'):
184
+ def plot_aperture(local_directory=None, kind='cal_aper_flux'):
185
185
  files = glob(f'{local_directory}*.fits')
186
186
  os.makedirs(f'{local_directory}plots/', exist_ok=True)
187
187
  portion = [0.9361215204370542, 0.9320709087810205]
@@ -192,8 +192,8 @@ def plot_aperture(local_directory=None, type='cal_aper_flux'):
192
192
  print(files[i], portion[i])
193
193
  q = [a and b for a, b in zip(list(hdul[1].data['TESS_flags'] == 0), list(hdul[1].data['TGLC_flags'] == 0))]
194
194
  plt.figure(constrained_layout=False, figsize=(8, 4))
195
- plt.plot(hdul[1].data['time'] % 3.79262026, hdul[1].data[type], '.', c='silver', label=type)
196
- plt.plot(hdul[1].data['time'][q] % 3.79262026, hdul[1].data[type][q], '.k', label=f'{type}_flagged')
195
+ plt.plot(hdul[1].data['time'] % 3.79262026, hdul[1].data[kind], '.', c='silver', label=kind)
196
+ plt.plot(hdul[1].data['time'][q] % 3.79262026, hdul[1].data[kind][q], '.k', label=f'{kind}_flagged')
197
197
  aperture_bar = 709.5512462444653 * portion[i]
198
198
  aper_lc = np.nansum(hdul[0].data, axis=(1, 2))
199
199
  local_bg = np.nanmedian(aper_lc) - aperture_bar
@@ -226,7 +226,7 @@ def plot_aperture(local_directory=None, type='cal_aper_flux'):
226
226
  np.savetxt(f'{local_directory}TESS_TOI-5344_5_5_aper.csv', data, delimiter=',')
227
227
 
228
228
 
229
- def plot_pf_lc(local_directory=None, period=None, mid_transit_tbjd=None, type='cal_aper_flux'):
229
+ def plot_pf_lc(local_directory=None, period=None, mid_transit_tbjd=None, kind='cal_aper_flux'):
230
230
  files = glob(f'{local_directory}*.fits')
231
231
  os.makedirs(f'{local_directory}plots/', exist_ok=True)
232
232
  fig = plt.figure(figsize=(13, 5))
@@ -238,27 +238,27 @@ def plot_pf_lc(local_directory=None, period=None, mid_transit_tbjd=None, type='c
238
238
  with fits.open(files[j], mode='denywrite') as hdul:
239
239
  q = [a and b for a, b in
240
240
  zip(list(hdul[1].data['TESS_flags'] == 0), list(hdul[1].data['TGLC_flags'] == 0))]
241
- # q = [a and b for a, b in zip(q, list(hdul[1].data[type] > 0.85))]
241
+ # q = [a and b for a, b in zip(q, list(hdul[1].data[kind] > 0.85))]
242
242
  # if hdul[0].header['sector'] == 15:
243
243
  # q = [a and b for a, b in zip(q, list(hdul[1].data['time'] < 1736))]
244
244
  if len(hdul[1].data['cal_aper_flux']) == len(hdul[1].data['time']):
245
245
  if hdul[0].header["SECTOR"] <= 26:
246
246
  t = hdul[1].data['time'][q]
247
- f = hdul[1].data[type][q]
247
+ f = hdul[1].data[kind][q]
248
248
  elif hdul[0].header["SECTOR"] <= 55:
249
249
  t = np.mean(hdul[1].data['time'][q][:len(hdul[1].data['time'][q]) // 3 * 3].reshape(-1, 3), axis=1)
250
250
  f = np.mean(
251
- hdul[1].data[type][q][:len(hdul[1].data[type][q]) // 3 * 3].reshape(-1, 3), axis=1)
251
+ hdul[1].data[kind][q][:len(hdul[1].data[kind][q]) // 3 * 3].reshape(-1, 3), axis=1)
252
252
  else:
253
253
  t = np.mean(hdul[1].data['time'][q][:len(hdul[1].data['time'][q]) // 9 * 9].reshape(-1, 9), axis=1)
254
254
  f = np.mean(
255
- hdul[1].data[type][q][:len(hdul[1].data[type][q]) // 9 * 9].reshape(-1, 9), axis=1)
255
+ hdul[1].data[kind][q][:len(hdul[1].data[kind][q]) // 9 * 9].reshape(-1, 9), axis=1)
256
256
  t_all = np.append(t_all, t)
257
257
  f_all = np.append(f_all, f)
258
258
  f_err_all = np.append(f_err_all, np.array([hdul[1].header['CAPE_ERR']] * len(t)))
259
259
 
260
- # plt.plot(hdul[1].data['time'] % period / period, hdul[1].data[type], '.', c='silver', ms=3)
261
- plt.errorbar(t % period / period, f, hdul[1].header['CAPE_ERR'], c='silver', ls='', elinewidth=1.5,
260
+ # plt.plot(hdul[1].data['time'] % period / period, hdul[1].data[kind], '.', c='silver', ms=3)
261
+ plt.errorbar(t % period / period, f, hdul[1].header['CAPE_ERR'], c='silver', ls='', elinewidth=0.1,
262
262
  marker='.', ms=3, zorder=2)
263
263
  # time_out, meas_out, meas_err_out = timebin(time=t % period, meas=f,
264
264
  # meas_err=np.array([hdul[1].header['CAPE_ERR']] * len(t)),
@@ -267,7 +267,7 @@ def plot_pf_lc(local_directory=None, period=None, mid_transit_tbjd=None, type='c
267
267
  # marker='.', ms=8, zorder=3, label=f'Sector {hdul[0].header["sector"]}')
268
268
  else:
269
269
  not_plotted_num += 1
270
- title = f'TIC_{hdul[0].header["TICID"]} with {len(files) - not_plotted_num} sector(s) of data, {type}'
270
+ title = f'TIC_{hdul[0].header["TICID"]} with {len(files) - not_plotted_num} sector(s) of data, {kind}'
271
271
  # PDCSAP_files = glob('/home/tehan/Documents/GEMS/TIC 172370679/PDCSAP/*.txt')
272
272
  # for i in range(len(files)):
273
273
  # PDCSAP = ascii.read(PDCSAP_files[i])
@@ -281,11 +281,11 @@ def plot_pf_lc(local_directory=None, period=None, mid_transit_tbjd=None, type='c
281
281
  plt.errorbar(np.array(time_out) / period, meas_out, meas_err_out, c=f'r', ls='', elinewidth=1.5,
282
282
  marker='.', ms=8, zorder=3, label=f'All sectors')
283
283
 
284
- plt.ylim(0.87, 1.05)
284
+ plt.ylim(0.998, 1.001)
285
285
  # plt.xlim(0.3, 0.43)
286
286
  plt.legend()
287
287
  plt.title(title)
288
- plt.xlim(mid_transit_tbjd % period - 0.1 * period, mid_transit_tbjd % period + 0.1 * period)
288
+ # plt.xlim(mid_transit_tbjd % period - 0.1 * period, mid_transit_tbjd % period + 0.1 * period)
289
289
  # plt.ylim(0.9, 1.1)
290
290
  # plt.hlines(y=0.92, xmin=0, xmax=1, ls='dotted', colors='k')
291
291
  # plt.hlines(y=0.93, xmin=0, xmax=1, ls='dotted', colors='k')
@@ -355,7 +355,7 @@ def plot_contamination(local_directory=None, gaia_dr3=None):
355
355
  ax0.text(source.gaia[f'sector_{sector}_x'][nearby_stars[l]] - 0.1,
356
356
  source.gaia[f'sector_{sector}_y'][nearby_stars[l]] + 0.3,
357
357
  f'TIC {int(source.tic["TIC"][index])}', rotation=90)
358
- except TypeError:
358
+ except kindError:
359
359
  ax0.text(source.gaia[f'sector_{sector}_x'][nearby_stars[l]] - 0.1,
360
360
  source.gaia[f'sector_{sector}_y'][nearby_stars[l]] + 0.2,
361
361
  f'{source.gaia[f"DESIGNATION"][nearby_stars[l]]}', rotation=90)
@@ -451,32 +451,21 @@ def get_tglc_lc(tics=None, method='query', server=1, directory=None, prior=None)
451
451
  tglc_lc(target=target, local_directory=local_directory, size=90, save_aper=True, limit_mag=16,
452
452
  get_all_lc=False, first_sector_only=False, last_sector_only=False, sector=None, prior=prior,
453
453
  transient=None)
454
- plot_lc(local_directory=f'{directory}TIC {tics[i]}/', type='cal_aper_flux')
454
+ plot_lc(local_directory=f'{directory}TIC {tics[i]}/', kind='cal_aper_flux')
455
455
  if method == 'search':
456
456
  star_spliter(server=server, tics=tics, local_directory=directory)
457
457
 
458
458
 
459
459
  if __name__ == '__main__':
460
460
  tics = [16005254]
461
- directory = f'/home/tehan/Documents/tglc/'
462
- # directory = f'/home/tehan/data/cosmos/GEMS/'
461
+ directory = f'/home/tehan/data/'
463
462
  os.makedirs(directory, exist_ok=True)
464
463
  get_tglc_lc(tics=tics, method='query', server=1, directory=directory)
465
- plot_lc(local_directory=f'/home/tehan/Documents/tglc/TIC 16005254/', type='cal_aper_flux')
466
- plot_contamination(local_directory=f'{directory}TIC {tics[0]}/', gaia_dr3=5751990597042725632)
464
+ # plot_lc(local_directory=f'{directory}TIC {tics[0]}/', kind='cal_aper_flux')
465
+ # plot_lc(local_directory=f'/home/tehan/Documents/tglc/TIC 16005254/', kind='cal_aper_flux', ylow=0.9, yhigh=1.1)
466
+ # plot_contamination(local_directory=f'{directory}TIC {tics[0]}/', gaia_dr3=5751990597042725632)
467
467
  # plot_epsf(local_directory=f'{directory}TIC {tics[0]}/')
468
468
  # plot_pf_lc(local_directory=f'{directory}TIC {tics[0]}/lc/', period=0.71912603, mid_transit_tbjd=2790.58344,
469
- # type='cal_psf_flux')
470
- # plot_pf_lc(local_directory=f'{directory}TIC {tics[0]}/lc/', period=0.71912603, mid_transit_tbjd=2790.58344,
471
- # type='cal_aper_flux')
472
-
473
- # target = f'266.489125, -33.8428'
474
- # directory = f'/home/tehan/data/cosmos/michelle/'
475
- # local_directory = f'{directory}{target}/'
476
- # os.makedirs(local_directory, exist_ok=True)
477
- # tglc_lc(target=target, local_directory=local_directory, size=50, save_aper=True, limit_mag=17,
478
- # get_all_lc=False, first_sector_only=False, last_sector_only=False, sector=39, prior=None,
479
- # transient=['266.489125, -33.8428', 266.489125, -33.8428])
480
- # plot_lc(local_directory=f'{local_directory}', type='cal_aper_flux')
481
- # plot_lc(local_directory=f'{local_directory}', yhigh=150, type='aperture_flux')
482
- # plot_contamination(local_directory=f'{local_directory}', gaia_dr3=4041831235071242624)
469
+ # kind='cal_psf_flux')
470
+ # plot_pf_lc(local_directory=f'{directory}TIC {tics[0]}/lc/', period=0.23818244, mid_transit_tbjd=1738.71248,
471
+ # kind='cal_aper_flux')
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.1
2
+ Name: tglc
3
+ Version: 0.6.4
4
+ Summary: TESS-Gaia Light Curve
5
+ Home-page: https://github.com/TeHanHunter/TESS_Gaia_Light_Curve
6
+ Author: Te Han
7
+ Author-email: tehanhunter@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/x-rst
13
+ License-File: LICENSE
14
+
15
+ ==================================
16
+ Introduction
17
+ ==================================
18
+
19
+ TESS-Gaia Light Curve (`TGLC <https://archive.stsci.edu/hlsp/tglc>`_) is a dataset of TESS full-frame image light curves publicly available via the MAST portal. It is fitted with effective PSF and decontaminated with Gaia DR3 and achieved percent-level photometric precision down to 16th TESS magnitude! It unlocks astrophysics to a vast number of dim stars below 12th TESS magnitude. A package called tglc is pip-installable for customized light curve fits.
20
+
21
+ ==================================
22
+ Usage
23
+ ==================================
24
+ There are four fluxes in each FITS file: aperture flux, PSF flux, calibrated aperture flux, and calibrated PSF flux.
25
+ If you are uncertain which to use:
26
+
27
+ * Calibrated psf flux is better in **deblending** targets. Use this if you need to deblend a target near a variable source. The best deblending can be achieved with tglc package by setting a non-zero prior. It also gives the more accurate **transit depth** in most cases, especially when fitting with an optimized prior.
28
+ * Calibrated aperture flux usually has slightly **higher SNR**. The transit depth (or variation amplitude), however, can be imperfect since the normalization depends on the PSF fitting which is imperfect. This imperfection can be minimized by using a bigger aperture than the default aperture (3*3). One need to use the tglc package and set tglc_lc(save_aper=True) to access the 5*5 aperture. In the presence of a bright but "constant" contamination (several magnitudes brighter), the calibrated aperture flux is better in removing the constant contamination.
29
+ * The aperture flux and PSF flux are not detrended or normalized. Use this if you are doing stellar variability science with long baseline. Or, if the detrending is not optimal (default detrending has a window length of 1 day; see Known Problems below), start with the aperture flux or PSF flux and detrend carefully!
30
+ * **If you are uncertain, start with calibrated aperture flux!**
31
+
32
+ The `tutorial <tutorial/TGLC_tutorial.ipynb>`_ shows the syntaxes and differences among these light curves in several examples.
33
+
34
+ ==================================
35
+ Data Access
36
+ ==================================
37
+ There are three data access methods:
38
+
39
+ * MAST Portal: Easiest for acquiring light curves for a few stars. However, new sectors are updated relatively slowly.
40
+ * MAST bulk download: Best for downloading light curves for all stars (<16 TESS magnitude) in a sectors.
41
+ * tglc package: Capable of producing similar quality light curves for any sector and any star with custom options.
42
+
43
+ MAST Portal/bulk download
44
+ ----------------------------
45
+ The easiest usage requires no package installation. Simply follow the `TGLC HLSP page <https://archive.stsci.edu/hlsp/tglc>`_ to download light curves from MAST or use `MAST Portal <https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html>`_. Light curves are being fitted sector by sector and will be available on MAST gradually. MAST hosts all Gaia DR3 stars down to 16th magnitude. Each .fits file includes PSF and aperture light curves and their calibrated versions.
46
+
47
+ MAST available sectors: `sector worklist <https://docs.google.com/spreadsheets/d/1FhHElWb1wmx9asWiZecAJ2umN0-P_aXn55OBVB34_rg/edit?usp=sharing>`_
48
+
49
+
50
+ tglc package
51
+ ----------------------------
52
+ Users can also fit light curves using the package tglc. Using tglc, one can specify a region, sector(s), and customized aperture shape if needed. It can also allow all field stars to float by assigning Gaussian priors, which can help decontaminate variable field stars. tglc is currently only available for linux. Run::
53
+
54
+ pip install tglc
55
+
56
+ for the latest tglc release. After installation, follow the `tutorial <tutorial/TGLC_tutorial.ipynb>`_ to fit light curves. If there is a problem, please leave a comment in the Issues section to help us improve. Thank you!
57
+
58
+
59
+ ==================================
60
+ Known Problems
61
+ ==================================
62
+ There are several imperfections we noticed in the MAST TGLC light curves and tglc package:
63
+
64
+ * If the star is very dim (~< 15 Tmag) near a variable source, it can make the aperture and/or PSF light curve negative for some cadences. The detrending algorithm could malfunction and result in bad cal_aper_flux and/or cal_psf_flux. This is now fixed for tglc package, but this problem remains for the primary mission light curves published on MAST. Please detrend again if necessary. The extended mission light curves on MAST will not be affected. This is a very rare scenario, but could be important.
65
+
66
+ ==================================
67
+ Reference
68
+ ==================================
69
+ If you find the TGLC light curves or the tglc package useful in your research, please cite `our paper <https://iopscience.iop.org/article/10.3847/1538-3881/acaaa7>`_ published on the Astronomical Journal.
tglc-0.6.2/PKG-INFO DELETED
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tglc
3
- Version: 0.6.2
4
- Summary: TESS-Gaia Light Curve
5
- Home-page: https://github.com/TeHanHunter/TESS_Gaia_Light_Curve
6
- Author: Te Han
7
- Author-email: tehanhunter@gmail.com
8
- License: UNKNOWN
9
- Description: ==================================
10
- Introduction
11
- ==================================
12
-
13
- TESS-Gaia Light Curve (`TGLC <https://archive.stsci.edu/hlsp/tglc>`_) is a dataset of TESS full-frame image light curves publicly available via the MAST portal. It is fitted with effective PSF and decontaminated with Gaia DR3 and achieved percent-level photometric precision down to 16th TESS magnitude! It unlocks astrophysics to a vast number of dim stars below 12th TESS magnitude. A package called tglc is pip-installable for customized light curve fits.
14
-
15
-
16
- ==================================
17
- Usage
18
- ==================================
19
- There are four fluxes in each FITS file: aperture flux, PSF flux, calibrated aperture flux, and calibrated PSF flux.
20
- If you are uncertain which to use:
21
-
22
- * Calibrated psf flux is better in **deblending** targets. Use this if you need to deblend a target near a variable source. The best deblending can be achieved with tglc package by setting a non-zero prior. It also gives the more accurate **transit depth** in most cases, especially when fitting with an optimized prior.
23
- * Calibrated aperture flux usually has slightly **higher SNR**. The transit depth (or variation amplitude), however, can be imperfect since the normalization depends on the PSF fitting which is imperfect. This imperfection can be minimized by using a bigger aperture than the default aperture (3*3). One need to use the tglc package and set tglc_lc(save_aper=True) to access the 5*5 aperture. In the presence of a bright but "constant" contamination (several magnitudes brighter), the calibrated aperture flux is better in removing the constant contamination.
24
- * The aperture flux and PSF flux are not detrended or normalized. Use this if you are doing stellar variability science with long baseline. Or, if the detrending is not optimal (default detrending has a window length of 1 day; see Known Problems below), start with the aperture flux or PSF flux and detrend carefully!
25
- * **If you are uncertain, start with calibrated aperture flux!**
26
-
27
- The `tutorial <tutorial/TGLC_tutorial.ipynb>`_ shows the syntaxes and differences among these light curves in several examples.
28
-
29
- ==================================
30
- Data Access
31
- ==================================
32
- There are three data access methods:
33
-
34
- * MAST Portal: Easiest for acquiring light curves for a few stars. However, new sectors are updated relatively slowly.
35
- * MAST bulk download: Best for downloading light curves for all stars (<16 TESS magnitude) in a sectors.
36
- * tglc package: Capable of producing similar quality light curves for any sector and any star with custom options.
37
-
38
- MAST Portal/bulk download
39
- ----------------------------
40
- The easiest usage requires no package installation. Simply follow the `TGLC HLSP page <https://archive.stsci.edu/hlsp/tglc>`_ to download light curves from MAST or use `MAST Portal <https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html>`_. Light curves are being fitted sector by sector and will be available on MAST gradually. MAST hosts all Gaia DR3 stars down to 16th magnitude. Each .fits file includes PSF and aperture light curves and their calibrated versions.
41
-
42
- MAST available sectors: `sector worklist <https://docs.google.com/spreadsheets/d/1FhHElWb1wmx9asWiZecAJ2umN0-P_aXn55OBVB34_rg/edit?usp=sharing>`_
43
-
44
-
45
- tglc package
46
- ----------------------------
47
- Users can also fit light curves using the package tglc. Using tglc, one can specify a region, sector(s), and customized aperture shape if needed. It can also allow all field stars to float by assigning Gaussian priors, which can help decontaminate variable field stars. tglc is currently only available for linux. Run::
48
-
49
- pip install tglc
50
-
51
- for the latest tglc release. After installation, follow the `tutorial <tutorial/TGLC_tutorial.ipynb>`_ to fit light curves. If there is a problem, please leave a comment in the Issues section to help us improve. Thank you!
52
-
53
-
54
- ==================================
55
- Known Problems
56
- ==================================
57
- There are several imperfections we noticed in the MAST TGLC light curves and tglc package:
58
-
59
- * If the star is very dim (~< 15 Tmag) near a variable source, it can make the aperture and/or PSF light curve negative for some cadences. The detrending algorithm could malfunction and result in bad cal_aper_flux and/or cal_psf_flux. This is now fixed for tglc package, but this problem remains for the primary mission light curves published on MAST. Please detrend again if necessary. The extended mission light curves on MAST will not be affected. This is a very rare scenario, but could be important.
60
-
61
- ==================================
62
- Reference
63
- ==================================
64
- If you find the TGLC light curves or the tglc package useful in your research, please cite `our paper <https://iopscience.iop.org/article/10.3847/1538-3881/acaaa7>`_ published on the Astronomical Journal.
65
-
66
- Platform: UNKNOWN
67
- Classifier: Programming Language :: Python :: 3
68
- Classifier: License :: OSI Approved :: MIT License
69
- Classifier: Operating System :: OS Independent
70
- Requires-Python: >=3.8
71
- Description-Content-Type: text/x-rst
@@ -1,3 +0,0 @@
1
- __version__ = "0.6.2"
2
- __author__ = 'Te Han, Timothy Brandt'
3
- __credits__ = 'University of California, Santa Barbara'
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tglc
3
- Version: 0.6.2
4
- Summary: TESS-Gaia Light Curve
5
- Home-page: https://github.com/TeHanHunter/TESS_Gaia_Light_Curve
6
- Author: Te Han
7
- Author-email: tehanhunter@gmail.com
8
- License: UNKNOWN
9
- Description: ==================================
10
- Introduction
11
- ==================================
12
-
13
- TESS-Gaia Light Curve (`TGLC <https://archive.stsci.edu/hlsp/tglc>`_) is a dataset of TESS full-frame image light curves publicly available via the MAST portal. It is fitted with effective PSF and decontaminated with Gaia DR3 and achieved percent-level photometric precision down to 16th TESS magnitude! It unlocks astrophysics to a vast number of dim stars below 12th TESS magnitude. A package called tglc is pip-installable for customized light curve fits.
14
-
15
-
16
- ==================================
17
- Usage
18
- ==================================
19
- There are four fluxes in each FITS file: aperture flux, PSF flux, calibrated aperture flux, and calibrated PSF flux.
20
- If you are uncertain which to use:
21
-
22
- * Calibrated psf flux is better in **deblending** targets. Use this if you need to deblend a target near a variable source. The best deblending can be achieved with tglc package by setting a non-zero prior. It also gives the more accurate **transit depth** in most cases, especially when fitting with an optimized prior.
23
- * Calibrated aperture flux usually has slightly **higher SNR**. The transit depth (or variation amplitude), however, can be imperfect since the normalization depends on the PSF fitting which is imperfect. This imperfection can be minimized by using a bigger aperture than the default aperture (3*3). One need to use the tglc package and set tglc_lc(save_aper=True) to access the 5*5 aperture. In the presence of a bright but "constant" contamination (several magnitudes brighter), the calibrated aperture flux is better in removing the constant contamination.
24
- * The aperture flux and PSF flux are not detrended or normalized. Use this if you are doing stellar variability science with long baseline. Or, if the detrending is not optimal (default detrending has a window length of 1 day; see Known Problems below), start with the aperture flux or PSF flux and detrend carefully!
25
- * **If you are uncertain, start with calibrated aperture flux!**
26
-
27
- The `tutorial <tutorial/TGLC_tutorial.ipynb>`_ shows the syntaxes and differences among these light curves in several examples.
28
-
29
- ==================================
30
- Data Access
31
- ==================================
32
- There are three data access methods:
33
-
34
- * MAST Portal: Easiest for acquiring light curves for a few stars. However, new sectors are updated relatively slowly.
35
- * MAST bulk download: Best for downloading light curves for all stars (<16 TESS magnitude) in a sectors.
36
- * tglc package: Capable of producing similar quality light curves for any sector and any star with custom options.
37
-
38
- MAST Portal/bulk download
39
- ----------------------------
40
- The easiest usage requires no package installation. Simply follow the `TGLC HLSP page <https://archive.stsci.edu/hlsp/tglc>`_ to download light curves from MAST or use `MAST Portal <https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html>`_. Light curves are being fitted sector by sector and will be available on MAST gradually. MAST hosts all Gaia DR3 stars down to 16th magnitude. Each .fits file includes PSF and aperture light curves and their calibrated versions.
41
-
42
- MAST available sectors: `sector worklist <https://docs.google.com/spreadsheets/d/1FhHElWb1wmx9asWiZecAJ2umN0-P_aXn55OBVB34_rg/edit?usp=sharing>`_
43
-
44
-
45
- tglc package
46
- ----------------------------
47
- Users can also fit light curves using the package tglc. Using tglc, one can specify a region, sector(s), and customized aperture shape if needed. It can also allow all field stars to float by assigning Gaussian priors, which can help decontaminate variable field stars. tglc is currently only available for linux. Run::
48
-
49
- pip install tglc
50
-
51
- for the latest tglc release. After installation, follow the `tutorial <tutorial/TGLC_tutorial.ipynb>`_ to fit light curves. If there is a problem, please leave a comment in the Issues section to help us improve. Thank you!
52
-
53
-
54
- ==================================
55
- Known Problems
56
- ==================================
57
- There are several imperfections we noticed in the MAST TGLC light curves and tglc package:
58
-
59
- * If the star is very dim (~< 15 Tmag) near a variable source, it can make the aperture and/or PSF light curve negative for some cadences. The detrending algorithm could malfunction and result in bad cal_aper_flux and/or cal_psf_flux. This is now fixed for tglc package, but this problem remains for the primary mission light curves published on MAST. Please detrend again if necessary. The extended mission light curves on MAST will not be affected. This is a very rare scenario, but could be important.
60
-
61
- ==================================
62
- Reference
63
- ==================================
64
- If you find the TGLC light curves or the tglc package useful in your research, please cite `our paper <https://iopscience.iop.org/article/10.3847/1538-3881/acaaa7>`_ published on the Astronomical Journal.
65
-
66
- Platform: UNKNOWN
67
- Classifier: Programming Language :: Python :: 3
68
- Classifier: License :: OSI Approved :: MIT License
69
- Classifier: Operating System :: OS Independent
70
- Requires-Python: >=3.8
71
- Description-Content-Type: text/x-rst
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes