Analisis Astronomico de las Pleyades
Consulta datos de Gaia y construye un Diagrama Color-Magnitud con Python.
Introduction
30 Second Summary
Cuando miras un cumulo estelar en el cielo nocturno, en realidad estas viendo una mezcla de estrellas que pertenecen al cumulo y estrellas de fondo que no tienen nada que ver. Separar unas de otras es uno de los primeros desafios reales en astronomia observacional.
En este proyecto, vas a consultar datos reales del satelite Gaia desde Python, construir un Diagrama Color-Magnitud de las Pleyades y descubrir por que los datos crudos no bastan para revelar la estructura real del cumulo.
What You'll Build
Un notebook de Jupyter terminado que descarga datos estelares del archivo de Gaia, filtra los miembros del cumulo por su movimiento compartido a traves del espacio y produce un Diagrama Color-Magnitud limpio y publicable de las Pleyades.
By the end of this project, you'll have:
- Consultas a la base de datos de Gaia directamente desde Python usando astroquery para obtener datos de 2000+ estrellas reales.
- Un diagrama "sucio" que demuestra por que limpiar datos no es suficiente cuando el problema real es separar poblaciones estelares distintas.
- Un CMD profesional de las Pleyades que muestra claramente la secuencia principal, construido filtrando estrellas por su movimiento propio.
- Secret Mission: Repite el analisis completo con un segundo cumulo (las Hiades) y compara ambos CMDs lado a lado.
Are there any prerequisites?
Este proyecto asume que ya tienes Python instalado, VS Code con Jupyter Notebook configurado, y pandas y matplotlib instalados. Si ya puedes crear una celda en un notebook, importar pandas y hacer un grafico basico, estas listo para empezar.
Before We Start
Before we dive into code, let's lock in what you're about to build and why it matters. You're going to analyze real stellar data from the Pleiades cluster, and understanding the goal upfront will help every step make sense.
Set Up Your Environment
Before you start querying real astronomical data, you need to confirm that all your Python libraries can work together. astroquery connects Python to the Gaia satellite database, and pandas plus matplotlib handle the data and visualization.
In this step, you will write your first notebook cell to import everything and confirm the connection works.
In this step, get ready to:
- Import astroquery, pandas, and matplotlib in your notebook.
- Verify the imports run without errors and print a confirmation message.
Import your libraries and verify the connection
astroquery is a Python package that lets you query astronomical databases directly from code. Its Gaia module connects to the European Space Agency's Gaia archive, which contains measurements of over a billion stars.
- In your analisis.ipynb notebook (already open in VS Code), click into the first empty cell.
- Type the following code to import your three libraries and print a confirmation:
# Celda 1: Setup e imports
from astroquery.gaia import Gaia
import pandas as pd
import matplotlib.pyplot as plt
print("Conexion lista")
What does this code do?
- from astroquery.gaia import Gaia loads the Gaia module, which knows how to talk to the ESA archive using a protocol called TAP.
- import pandas as pd gives you DataFrames for organizing the star data into rows and columns.
- import matplotlib.pyplot as plt provides the plotting functions you will use to build your diagrams.
- print("Conexion lista") prints a simple message proving all three imports succeeded without errors.
Before you run this cell, what do you expect to see if all three libraries are installed correctly?
- Run the cell by pressing Shift+Enter.
You should see the text Conexion lista printed below the cell with no error messages.
Seeing a ModuleNotFoundError?
If the error mentions astroquery, the package did not install correctly. Return to your terminal and run python -m pip install astroquery again, then restart the Jupyter kernel before re-running the cell.
If the error mentions pandas or matplotlib, install the missing package with python -m pip install pandas matplotlib and restart the kernel.
help me fix my astroquery import error in Jupyter
✔️ Awesome, I've got everything!
Great. Double check you have saved the notebook.
ⓧ I'd like to double check the full code
Your first cell should contain exactly this code:
# Celda 1: Setup e imports
from astroquery.gaia import Gaia
import pandas as pd
import matplotlib.pyplot as plt
print("Conexion lista")
Your environment is ready and Python can reach the Gaia archive. Next up, you will write your first query to download real star data from the Pleiades region.
Query Gaia and Explore the Data
Your connection to Gaia is confirmed. Now you need actual star data to work with.
This is the first step of any data project: getting the information. You will query the Gaia archive for stars in the Pleiades region and load them into a DataFrame you can explore with pandas.
In this step, get ready to:
- Write an ADQL query that pulls star data from the Gaia DR3 archive.
- Explore the resulting DataFrame to understand what each column represents.
- Save the data locally so you never depend on the network connection again.
Write and execute the ADQL query
ADQL (Astronomical Data Query Language) is like SQL but designed for astronomical databases. You will use it to ask Gaia for every star within a 2-degree radius of the Pleiades center.
- In analisis.ipynb, create a new cell below Cell 1 and paste the following code to query Gaia and explore the results:
# Celda 2: Consultar Gaia
Gaia.ROW_LIMIT = 3000
query = """
SELECT ra, dec, parallax, pmra, pmdec,
phot_g_mean_mag, phot_bp_mean_mag, phot_rp_mean_mag
FROM gaiadr3.gaia_source
WHERE CONTAINS(POINT('ICRS', ra, dec),
CIRCLE('ICRS', 56.75, 24.12, 2)) = 1
AND phot_g_mean_mag IS NOT NULL
AND phot_bp_mean_mag IS NOT NULL
AND phot_rp_mean_mag IS NOT NULL
"""
job = Gaia.launch_job(query)
results = job.get_results()
df = results.to_pandas()
print(df.shape)
print(df.head())
print(df.describe())
What does this code do?
Gaia.ROW_LIMIT = 3000 raises the default row cap (which is only 50) so you get enough stars back from the query.
The query string uses ADQL to select 8 columns of data from the gaiadr3.gaia_source table. The CONTAINS(POINT, CIRCLE) clause performs a cone search: all stars within 2 degrees of RA=56.75, Dec=24.12 (the Pleiades center). The IS NOT NULL filters ensure every star has valid brightness measurements in all three bands.
Gaia.launch_job(query) sends the query to the Gaia server and waits for results. Then .to_pandas() converts the result into a pandas DataFrame you can work with. The three print() calls show you the shape, first rows, and summary statistics of your data.
- Before you run the cell, predict: how many rows do you think Gaia will return for a 2-degree radius of sky?
- Run the cell by pressing Shift+Enter. The query will take a few seconds while Gaia processes your request.
You should see df.shape reporting approximately 2000 rows and 8 columns. That is 2000+ real stars from the Gaia satellite.
Why does the query take a few seconds?
Your computer is sending this query across the internet to the European Space Agency's Gaia archive. The server searches through billions of star records and sends matching rows back. A short wait is normal.
Seeing a connection error or timeout?
Make sure you have an active internet connection. The query contacts the Gaia archive server at ESA.
If you see a timeout, try running the cell again. The server may be temporarily busy.
If df.shape shows (0, 8), the query ran but returned no results. Double-check the coordinates in your query match 56.75, 24.12 exactly.
Help me debug my Gaia connection error.
Understand what each column means
Your output from df.head() shows the first 5 rows of data. Each column represents a different measurement that the Gaia satellite took for each star.
What does each column mean?
- ra and dec are the star's position on the sky (like longitude and latitude).
- parallax tells you how far away the star is (measured in milliarcseconds).
- pmra and pmdec are the star's proper motion: how fast it appears to move across the sky each year (in mas/yr).
- phot_g_mean_mag, phot_bp_mean_mag, and phot_rp_mean_mag are brightness measurements in three color bands (green, blue, red).
- You can also run df.columns in a new cell to see all column names listed together.
Save the data locally
Now that you have your data, save it to a CSV file. This way you will not need an internet connection every time you want to continue working.
- Create a new cell below and save the DataFrame by running:
# Celda 3: Guardar datos localmente
df.to_csv("pleyades_raw.csv", index=False)
What does this code do?
df.to_csv("pleyades_raw.csv", index=False) writes your entire DataFrame to a CSV file called pleyades_raw.csv inside your pleyades folder. The index=False argument prevents pandas from adding an extra numbered column.
- Run the cell with Shift+Enter.
- Confirm the file was created by checking the Explorer sidebar in VS Code. You should see pleyades_raw.csv appear alongside analisis.ipynb.
Don't see the CSV file?
Make sure you ran the save cell without errors. If you see a NameError, the df variable does not exist. Run the query cell (Celda 2) again first.
Help me figure out why my CSV file was not saved.
✔️ Awesome, I've got everything!
Great. Double check you have saved your notebook with Cmd+S (macOS) or Ctrl+S (Windows).
ⓧ I'd like to double check the full code
Here is everything your notebook should contain up to this point. Make sure each cell matches:
Cell 1:
# Celda 1: Setup e imports
from astroquery.gaia import Gaia
import pandas as pd
import matplotlib.pyplot as plt
print("Conexion lista")
Cell 2:
# Celda 2: Consultar Gaia
Gaia.ROW_LIMIT = 3000
query = """
SELECT ra, dec, parallax, pmra, pmdec,
phot_g_mean_mag, phot_bp_mean_mag, phot_rp_mean_mag
FROM gaiadr3.gaia_source
WHERE CONTAINS(POINT('ICRS', ra, dec),
CIRCLE('ICRS', 56.75, 24.12, 2)) = 1
AND phot_g_mean_mag IS NOT NULL
AND phot_bp_mean_mag IS NOT NULL
AND phot_rp_mean_mag IS NOT NULL
"""
job = Gaia.launch_job(query)
results = job.get_results()
df = results.to_pandas()
print(df.shape)
print(df.head())
print(df.describe())
Cell 3:
# Celda 3: Guardar datos localmente
df.to_csv("pleyades_raw.csv", index=False)
You now have 2000+ real stars from the Gaia satellite loaded and saved. Next up, you will try to build your first Color-Magnitude Diagram and discover why raw data is not enough.
Create Your First (Messy) CMD
In the last step, you downloaded 2000+ stars from the Gaia archive and saved them locally. Now it's time to actually visualize that data.
A Color-Magnitude Diagram (CMD) is the fundamental tool for studying stellar populations. It plots each star's color against its brightness to reveal structure. Your goal is to build one for the Pleiades. But what happens when you plot ALL the data without any filtering?
In this step, get ready to:
- Calculate the "color" of each star from its magnitudes.
- Create your first CMD scatter plot.
- Observe why unfiltered data produces a useless diagram.
Calculate color and plot the CMD
In astronomy, a star's "color" is the difference between its brightness measured in two wavelength bands. A star that is brighter in blue light (BP) than red light (RP) has a small color value and is hot. A star brighter in red has a large color value and is cool.
- Create a new cell in your notebook (Celda 4) and paste the following code:
# Celda 4: Primer CMD (sucio)
df["color"] = df["phot_bp_mean_mag"] - df["phot_rp_mean_mag"]
plt.figure(figsize=(8, 10))
plt.scatter(df["color"], df["phot_g_mean_mag"], s=1, color="gray", alpha=0.5)
plt.gca().invert_yaxis()
plt.xlabel("Color (BP - RP)")
plt.ylabel("Magnitud G")
plt.title("CMD - Todos los datos (sin filtrar)")
plt.show()
What does this code do?
- df["color"] = df["phot_bp_mean_mag"] - df["phot_rp_mean_mag"] creates a new column by subtracting the red magnitude from the blue magnitude. A smaller value means a hotter, bluer star.
- plt.scatter() plots each star as a tiny gray dot with color on the x-axis and brightness (magnitude G) on the y-axis.
- invert_yaxis() flips the y-axis because in astronomy, smaller magnitude numbers mean brighter stars. The brightest stars appear at the top.
Before you run this cell, think: you have 2000+ stars from a 2-degree cone around the Pleiades. Do you expect all of them to belong to the cluster, or could most of them be unrelated background stars?
- Run the cell.
You should see a scatter plot with thousands of gray dots spread across the entire diagram with no clear pattern or structure.
Don't see a plot?
- Make sure you ran Cell 2 (the Gaia query) first so that df exists in memory.
- Check that import matplotlib.pyplot as plt ran successfully in Cell 1.
- If you restarted your kernel, re-run all previous cells from the top before running this one.
Why isn't my scatter plot appearing in Jupyter?
Understand why the CMD is a mess
The diagram looks like a random cloud of points. There is no clear "main sequence" line curving from top-left to bottom-right.
Why does the CMD look so disordered?
Most of the stars in this region of the sky do NOT belong to the Pleiades. They are field stars at completely different distances from Earth.
When you mix stars from many different populations and distances into one CMD, the structure of any single cluster gets buried in noise. To reveal the Pleiades, you need to separate cluster members from the background. That is the problem you will solve over the next two steps.
✔️ Awesome, I've got everything!
Great. Make sure your notebook is saved before moving on.
ⓧ I'd like to double check the full code
Your notebook should now have 4 cells. Scroll through and confirm each one is present in order:
- Cell 1: Imports and print("Conexion lista").
- Cell 2: The ADQL query, Gaia.launch_job(query), and the df.shape/df.head()/df.describe() exploration.
- Cell 3: df.to_csv("pleyades_raw.csv", index=False).
- Cell 4 (new this step): Color calculation and the scatter plot CMD with title CMD - Todos los datos (sin filtrar).
Your CMD is a mess. Your first instinct might be that the data is "dirty" and needs cleaning. In the next step, you will try that approach and discover something surprising.
Clean the Data (and Discover the Real Problem)
Your CMD from the last step is a mess of scattered points with no recognizable structure. Your first instinct is probably to think the data is "dirty." Maybe there are missing values or physically impossible measurements throwing everything off.
In this step, you will clean the data by removing problematic rows and remake the CMD. If your hypothesis is correct, the cleaned plot should reveal the main sequence of the Pleiades.
In this step, get ready to:
- Remove rows with null and physically invalid values from the DataFrame.
- Regenerate the CMD with the cleaned data and compare it to the unfiltered version.
Remove rows with null and negative values
Some rows in your DataFrame have null values for parallax, pmra, or pmdec. Others have negative parallax values, which don't make physical sense (parallax represents distance).
- Create a new cell (Celda 5) in your notebook and clean the DataFrame by running this code:
# Celda 5: Limpiar datos
df_clean = df.dropna(subset=["parallax", "pmra", "pmdec"])
df_clean = df_clean[df_clean["parallax"] > 0]
What does this code do?
- dropna(subset=[...]) removes any row where parallax, pmra, or pmdec is null. You need these three columns for proper analysis, so rows missing them are useless.
- The second line keeps only rows where parallax > 0. A negative parallax is a measurement artifact, not a real distance.
Regenerate the CMD with clean data
Now that the problematic rows are gone, you can recalculate the color column for the cleaned data and remake the CMD. If data quality was the issue, this plot should look much better than the last one.
- Create a new cell (Celda 6) and regenerate the CMD by running this code:
# Celda 6: CMD con datos limpios (sigue sucio)
df_clean["color"] = df_clean["phot_bp_mean_mag"] - df_clean["phot_rp_mean_mag"]
plt.figure(figsize=(8, 10))
plt.scatter(df_clean["color"], df_clean["phot_g_mean_mag"], s=1, color="gray", alpha=0.5)
plt.gca().invert_yaxis()
plt.xlabel("Color (BP - RP)")
plt.ylabel("Magnitud G")
plt.title("CMD - Datos limpios (sin nulos)")
plt.show()
Before you run this cell, take a moment to predict: do you think the CMD will now show a clean main sequence?
- Run the cell and observe the result.
The CMD still looks disordered. There is no clear main sequence, even with clean data.
Why didn't cleaning fix the CMD?
Removing nulls and invalid values solves technical data quality problems. But the real problem here is conceptual.
The vast majority of stars in this region of the sky do NOT belong to the Pleiades. They are background and foreground stars at completely different distances, moving in different directions. You are mixing multiple stellar populations into one plot, so no single sequence emerges.
To reveal the Pleiades, you need a way to separate cluster members from field stars. That requires using proper motion data.
CMD looks identical to the previous step?
- That is expected. Our original query already filtered for non-null magnitudes, so most rows were already clean. The point is that cleaning alone does not solve a conceptual problem.
- Make sure your title says "CMD - Datos limpios (sin nulos)" so you can tell the two plots apart.
If you are stuck, ask for help understanding why your CMD is still messy.
✔️ Awesome, I've got everything!
Great. Make sure both Celda 5 and Celda 6 are saved in your notebook.
ⓧ I'd like to double check the full code
Your notebook should now have these cells in order:
- Celda 1: Setup e imports (from astroquery.gaia import Gaia, pandas, matplotlib, print).
- Celda 2: Consultar Gaia (query + df = results.to_pandas() + prints).
- Celda 3: Guardar datos localmente (df.to_csv).
- Celda 4: Primer CMD sucio (color column + scatter plot with title "CMD - Todos los datos (sin filtrar)").
- Celda 5: Limpiar datos (df.dropna + parallax > 0 filter into df_clean).
- Celda 6: CMD con datos limpios (recalculate color on df_clean + scatter plot with title "CMD - Datos limpios (sin nulos)").
Scroll through your notebook and confirm each cell is present in this order.
Now you know the real problem: your data contains thousands of field stars mixed with a few hundred Pleiades members. Next up, you will use proper motion to identify which stars actually belong to the cluster and finally reveal the main sequence.
Isolate the Cluster with Proper Motion
In the previous step, you proved that cleaning nulls and bad values didn't fix the CMD. The diagram still looks like a mess because most of the stars in the region are not part of the Pleyades. They are random field stars at different distances, all mixed together.
Here is the key insight: stars in a cluster travel together through space with similar velocities. By plotting their proper motion (pmra vs pmdec), you can spot the cluster as a tight group separated from the scattered cloud of field stars. Filtering by that group gives you only cluster members, and your CMD will finally reveal a clean main sequence.
In this step, get ready to:
- Plot a proper motion diagram to visually locate the Pleyades cluster.
- Filter cluster members using a circular cut in proper motion space.
- Produce the final, clean Diagrama Color-Magnitud of the Pleyades.
Plot the proper motion diagram
Every star in your dataset has two proper motion values: pmra (motion in right ascension) and pmdec (motion in declination), measured in milliarcseconds per year. When you scatter these two values against each other, cluster members form a visible clump because they share similar velocities.
- Create a new cell in your notebook (Celda 7) and plot the proper motion diagram by running this code:
# Celda 7: Diagrama de movimiento propio
plt.figure(figsize=(8, 8))
plt.scatter(df_clean["pmra"], df_clean["pmdec"], s=1, color="gray", alpha=0.3)
plt.xlabel("Movimiento propio en RA (mas/yr)")
plt.ylabel("Movimiento propio en Dec (mas/yr)")
plt.title("Diagrama de Movimiento Propio")
plt.xlim(-10, 40)
plt.ylim(-60, 10)
plt.show()
What does this code do?
This plots every star's velocity on the sky. The xlim and ylim zoom into the region where the Pleyades live, so you can clearly see the cluster's compact group against the scattered field stars.
- Run the cell. You should see a scatter plot with a diffuse cloud of gray points (field stars) and one obvious, tight clump near pmra ~ 20, pmdec ~ -45.
- That tight clump is the Pleyades. All those stars move together because they are gravitationally bound.
Don't see a clear clump?
Make sure you are plotting df_clean (the version with nulls removed), not the original df. Also check that your xlim and ylim match the values above so the plot is zoomed into the right region.
Help me debug my proper motion diagram
Filter the cluster members
Now that you can see where the Pleyades sit in proper motion space, you can draw a circle around them and keep only the stars inside. This is equivalent to saying: keep only stars whose velocity matches the cluster's velocity within a tolerance.
- Create a new cell (Celda 8) and run this code to filter members within 5 mas/yr of the cluster center:
# Celda 8: Filtrar miembros del cumulo
pmra_center = 20.0
pmdec_center = -45.5
radius = 5.0
distance = ((df_clean["pmra"] - pmra_center)**2 + (df_clean["pmdec"] - pmdec_center)**2)**0.5
df_cluster = df_clean[distance < radius].copy()
print(f"Estrellas miembros del cumulo: {len(df_cluster)}")
What does this code do?
You define the center of the cluster's proper motion (pmra_center = 20.0, pmdec_center = -45.5) and a radius of 5.0 mas/yr.
The distance formula calculates how far each star's velocity is from the cluster center using Euclidean distance. Any star within the radius is kept as a cluster member. The .copy() ensures you get an independent DataFrame rather than a view of df_clean.
- Run the cell. You should see a message like Estrellas miembros del cumulo: followed by a number (typically a few hundred stars, depending on your query results).
Why these specific values?
The Pleyades' average proper motion is approximately pmra ~ 20 mas/yr and pmdec ~ -45.5 mas/yr, well-documented from Gaia measurements. A 5 mas/yr radius is wide enough to capture most members while excluding the majority of field stars.
Getting zero or very few stars?
Double-check that pmra_center is 20.0 and pmdec_center is -45.5 (negative). A missing minus sign shifts the circle to the wrong part of proper motion space.
Help me debug my proper motion filter
Produce the final CMD of the Pleyades
This is the payoff. With only cluster members remaining, the CMD should finally reveal the characteristic curve of a stellar population: the main sequence.
Before you run this next cell, think: what do you expect the CMD to look like now that you have removed all the field stars?
- Create a new cell (Celda 9) and run this code to produce and save the final CMD:
# Celda 9: CMD final limpio
df_cluster["color"] = df_cluster["phot_bp_mean_mag"] - df_cluster["phot_rp_mean_mag"]
plt.figure(figsize=(8, 10))
plt.scatter(df_cluster["color"], df_cluster["phot_g_mean_mag"], s=5, color="navy", alpha=0.7)
plt.gca().invert_yaxis()
plt.xlabel("Color (BP - RP)")
plt.ylabel("Magnitud G (aparente)")
plt.title("Diagrama Color-Magnitud de las Pleyades (M45)")
plt.tight_layout()
plt.savefig("cmd_pleyades.png", dpi=150)
plt.show()
What does this code do?
First it recalculates the color column for the filtered cluster members. Then it creates a scatter plot with larger point size (s=5) and navy color to highlight the cluster stars.
The y-axis is inverted because in astronomy, brighter stars have lower magnitude numbers. Finally, savefig saves the plot as cmd_pleyades.png so you have a publication-ready image file.
- Run the cell.
You should see a well-defined main sequence: a smooth curve running from the upper-left (bright, blue stars) down to the lower-right (faint, red stars). Compare this to the messy scatter from Steps 3 and 4. This is the Pleyades.
CMD still looks scattered?
Confirm you are plotting df_cluster (the filtered DataFrame), not df_clean or df. Also verify that your filtering cell ran successfully and printed a non-zero star count.
Help me fix my final CMD
- Verify that cmd_pleyades.png was saved in your pleyades folder by running:
ls
You should see cmd_pleyades.png alongside pleyades_raw.csv and analisis.ipynb.
✔️ Awesome, I've got everything!
Great. Double check you have saved your notebook with all nine cells.
ⓧ I'd like to double check the full code
Your notebook should contain the following cells in order. Scroll through your notebook and confirm each one is present:
- Celda 1: Setup e imports (from astroquery.gaia import Gaia, pandas, matplotlib, print).
- Celda 2: Consultar Gaia (query + launch_job + to_pandas).
- Celda 3: Guardar datos (to_csv).
- Celda 4: Primer CMD sucio (color calculation + scatter + invert_yaxis).
- Celda 5: Limpiar datos (dropna + parallax filter).
- Celda 6: CMD con datos limpios (same scatter, still messy).
- Celda 7: Diagrama de movimiento propio (pmra vs pmdec scatter with xlim/ylim).
- Celda 8: Filtrar miembros del cumulo (pmra_center, pmdec_center, radius, distance, df_cluster).
- Celda 9: CMD final limpio (navy scatter + savefig).
You just went from a useless cloud of points to a publication-ready Diagrama Color-Magnitud. The difference was not about cleaning bad data. It was about understanding the physics: cluster stars share a common motion, and that motion is your filter.
Next up: put your skills to the test by repeating this entire analysis on a different cluster in the Secret Mission.
Secret mission
Compara las Pleyades con las Hiades
Ya dominas el proceso completo para un cumulo. Ahora aplica todo de forma independiente con las Hiades, un cumulo mucho mas viejo, y compara ambas poblaciones estelares lado a lado.
Clean Up Your Resources
Clean Up Your Resources
This project runs entirely locally and queries a free public database (Gaia), so there are no ongoing costs. Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
Resources you used:
- The pleyades folder on your Desktop (contains analisis.ipynb, pleyades_raw.csv, cmd_pleyades.png, comparacion_cumulos.png).
- The astroquery Python package installed via pip.
Keep everything running
No action needed. Choose this if you plan to extend your analysis to more clusters or refine your filtering parameters.
- Your pleyades folder stays on your Desktop with all notebooks and images intact.
- The astroquery package remains installed in your Python environment.
Pause - I'll come back to this later
Since everything is local files and an installed package, there is nothing to pause. Your notebook and data files stay on disk until you delete them manually.
- Close VS Code to free up memory.
- Your pleyades folder and installed packages remain available whenever you return.
Delete - I don't want to use this again
Remove all project files and the installed package to start fresh.
- Delete the project folder by running this command in your terminal (macOS/Linux):
rm -rf ~/Desktop/pleyades
On Windows, run:
rmdir /s /q %USERPROFILE%\Desktop\pleyades
- Uninstall astroquery by running:
python -m pip uninstall astroquery
- Confirm removal by typing y when prompted.
That's a Wrap!
That's a Wrap!
Nice work. You just built a complete astronomical analysis pipeline that takes raw satellite data and produces a professional Color-Magnitude Diagram of the Pleiades star cluster.
You've learned how to:
- Query the Gaia archive directly from Python using astroquery and ADQL, turning a database of billions of stars into a usable DataFrame.
- Discover that data cleaning alone does not solve a conceptual problem. Separating cluster members from field stars requires understanding the physics of proper motion.
- Produce a publishable Diagrama Color-Magnitud of the Pleiades by filtering stars based on their shared movement through space.
- Secret Mission: Repeat the full analysis independently with the Hyades and compare two stellar populations of different ages side by side.
Ready to quiz yourself?