Open gloglo17 opened 1 year ago
No, I don't think there's anything in Skyfield that would understand a star with variable magnitude or be able to accurately create its light curve. A quick Google search for "python variable star magnitude" brings up packages that let you do light-curve analysis if you have been regularly observing a star, but the first page of results, at least, doesn't seem to include anything that goes in the other direction, and predicts future magnitudes.
I'll mark this issue as a "feature request" in case anyone can find prior work that could be adapted to become Skyfield code. For example, does something like Stellarium support Algol and make it different brightnesses on different nights? A quick search I just did wasn't encouraging, but someone else might be able to find working code for variable stars.
In ancient Egypt, they had a calendar of lucky and unlucky days, which alternated roughly every 2.85 days. According to researchers, this may have been derived from the orbital plane of Algol (2.867 days). It would be very interesting to have a function to calculate those variable magnitudes to be able to check if there is something to it :))
I've tried this code but obviously it doesn't show the dip at all.
from skyfield.api import Star, load
from skyfield.data import hipparcos
from datetime import timedelta
import math
# Load the JPL ephemeris DE421 (covers 1900-2050).
planets = load('de421.bsp')
earth = planets['earth']
# load Hipparcos ephemeris
with load.open(hipparcos.URL) as f:
df = hipparcos.load_dataframe(f)
# Create a timescale
ts = load.timescale()
now = ts.now()
# load Algol from Hipparcos
algol = Star.from_dataframe(df.loc[14576])
absolute_magnitude = -0.07
for x in range(100):
time = now + timedelta(hours=x)
astrometric = earth.at(time).observe(algol)
ra, dec, distance = astrometric.radec(epoch=time)
apparent_magnitude = absolute_magnitude + (5 * math.log10((distance.au/206264.80749673))) - 5
print(apparent_magnitude)
Maybe the following info can help:
THE FIRST COMPREHENSIVE PHOTOMETRIC STUDY OF THE ALGOL-TYPE SYSTEM CL AURIGAE
Observational data for variable stars can be obtained from several astronomical databases. Here are a few sources where you might find such data:
American Association of Variable Star Observers (AAVSO): The AAVSO maintains a database of variable star observations by its member observers. You can download this data from their website (https://www.aavso.org/).
The International Variable Star Index (VSX): The VSX is another resource for finding data on variable stars. The AAVSO also maintains it.
NASA's Exoplanet Archive: While its primary purpose is to catalogue exoplanets, the archive also contains light curves for many stars observed by missions such as Kepler and TESS. You can access this at (https://exoplanetarchive.ipac.caltech.edu/).
The Open Exoplanet Catalogue: This catalogue contains data for all discovered exoplanets but also includes light curves for several variable stars (https://github.com/OpenExoplanetCatalogue/open_exoplanet_catalogue).
On the other hand, To calculate the magnitude of a variable star for a specific date and time, you first need to have a light curve for that star, which shows its brightness (or magnitude) changes over time.
Once you have the light curve data, you can use interpolation to estimate the star's magnitude at any given time.
If you have a lightcurve dataset, this can be done using Pandas
and Scipy
.
Wikipedia: "Algol's apparent magnitude is usually near-constant at 2.1, but regularly dips to 3.4 every 2.86 days during the roughly 10-hour-long partial eclipses."
Is there a way how to get the apparent magnitude of a specific star for a given moment and location? It would be really helpful.