<jupyter_start><jupyter_text>Tutorial: retrieve Gaia EDR3 sourcesThis notebook illustrates a method to retrieve sources from the Gaia EDR3 catalog.The sources within 1 degree around $(\mathrm{ra}, \mathrm{dec}) = (269.27, -18.99)$ are extracted.The retrived sources are stored as a pickle dump file.<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pickle as pkl
import warpfield as w<jupyter_output><empty_output><jupyter_text>The center of the search region is specified by a `SkyCoord` instance.The radius of the search region is given by an `Angle` instance.<jupyter_code>from astropy.coordinates import SkyCoord, Longitude, Latitude, Angle
import astropy.units as u
lon = Longitude(269.267, unit=u.degree)
lat = Latitude(-18.985, unit=u.degree)
radius = Angle(1.0*u.degree)
pointing = SkyCoord(lon, lat, frame='icrs')<jupyter_output><empty_output><jupyter_text>The Gaia EDR3 sources are fetched via `retrieve_gaia_sources`.The first and second arguments are the central position and the radius of the search region.The sources with `parallax_over_error` larger than 10 are retrieved.This possibly takes a few minute to retrieve the sources.<jupyter_code>gaia_sources = w.retrieve_gaia_sources(pointing, radius)<jupyter_output>INFO: Query finished. [astroquery.utils.tap.core]<jupyter_text>About 18000 sources are retrieved.<jupyter_code>print(len(gaia_sources))<jupyter_output>17835<jupyter_text>The sources are given as a `SkyCoord` instance. `ra`, `dec`, `pm_ra_cosdec`, and `pm_dec` are imported from the Gaia EDR3 catalog. `distance` is given by a reciprocal of `parallax`.<jupyter_code>print(gaia_sources)<jupyter_output><SkyCoord (ICRS): (ra, dec, distance) in (deg, deg, pc)
    [(269.98167082, -18.57869516, 1224.69071274),
     (269.97802152, -18.57559889,  324.47533736),
     (269.9835042 , -18.56314468, 1386.3884802 ), ...,
     (268.95304902, -19.79798206, 1453.99297353),
     (268.94090109, -19.80146811, 1743.04794159),
     (268.94291844, -19.79621657,  961.61213642)]
 (pm_ra_cosdec, pm_dec) in mas / yr
    [( -3.47320156, -6.59719102), (-21.33238793, 19.44839316),
     (  2.41198999, -0.88761999), ..., ( -0.14121417,  4.28021171),
     ( -0.65096113, -8.71104282), ( -1.00190969,  0.6318477 )]><jupyter_text>Save the retrieved catalog as `gaia_edr3.pkl`.<jupyter_code>with open('gaia_edr3.pkl','wb') as f:
    pkl.dump(gaia_sources, f)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12202136400986031, 'fraction_numerical': 0.14133114215283485, 'mean_word_length': 5.341145833333333, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '507058', 'license': 'MIT', 'n_tokens_mistral': 1105, 'n_tokens_neox': 892, 'n_words': 227, 'path': 'notebook/tutorial_01_retrieve_gaia_edr3_catalog.ipynb', 'repo_name': 'xr0038/jasmine_warpfield', 'size': '2434'}