keatonb / Pyriod

Python implementation of basic period detection and fitting routines for astronomical time series.
GNU General Public License v3.0
38 stars 7 forks source link

Working with Multiple Sectors at once #16

Closed jzverch closed 9 months ago

jzverch commented 9 months ago

Overview

Hey there! I'm working on a project exploring Fourier transform analysis of TESS data using Pyriod. I'm specifically interested in working with multiple consecutive sectors simultaneously to enhance frequency resolution and identify more usable frequencies. However, I'm facing unknowns with the Pyriod package, and I suspect there might be limitations in working directly with downloaded data. Or another way to accomplish what i want to do, I am new to using the code and appreciate any insight and details that can be given to me.

Help Needed

I'm seeking assistance in understanding how to efficiently work with multiple TESS sectors at once using Pyriod and overcome any potential hurdles. I've included the code snippet below that uses Lightkurve to search and download data for a specific star and Pyriod for Fourier transform analysis. If you have insights or suggestions on if Pyriod can be used this process for multiple consecutive sectors, your expertise would be greatly appreciated!

import lightkurve as lk import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib widget from Pyriod import Pyriod star="TIC 24261146" # substitute ???? for you specific TIC number

pd.options.display.max_rows=100

data=lk.search_lightcurve(star) data

Extract the table from the SearchResult object

table = data.table

Define the columns you want to display

columns_to_display = ['mission', 'year', 'author', 'exptime', 'target_name']

Create a Pandas DataFrame with the selected columns

df = table[columns_to_display].to_pandas()

Display the entire DataFrame

pd.set_option('display.max_rows', None) # Show all rows print(df) lc = data[3].download() lc pyriod = Pyriod(lc, freq_unit="1/d", amp_unit="ppm") pyriod.Pyriod()

Best,

Jonah Vercher

keatonb commented 9 months ago

Hi Jonah,

Pyriod can only work with a single light curve at a time, but you can "stitch" together multiple light curves into a single combined light curve before passing it to Pyriod using lightkurve: https://docs.lightkurve.org/tutorials/2-creating-light-curves/2-1-combining-multiple-quarters.html (tutorial is for Kepler data but process would be the same for TESS)

All the best, Keaton

jzverch commented 9 months ago

Thank you so much Dr. Bell. I appreciate it, your python package is much faster then using Period04, and i am trying to become more familiar with it so i can show more undergraduates how to use it for their Pre whitening research as well.

Best,

JV