<jupyter_start><jupyter_text>Sample: display on-sky footprints of Case 9Footprints of Case 9 Challenge 00 are illustrated.<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pickle as pkl
import warpfield as w
from astropy.coordinates import SkyCoord, Longitude, Latitude, Angle
from astropy.time import Time
from astropy.table import QTable, unique
import astropy.units as u
from warpfield.DUMMY import get_jasmine<jupyter_output><empty_output><jupyter_text>The sources and telescope pointings are retrieved from the data tables.Since the `case9_challenge_00.txt` table contains duplicated sources, the sources are sifted by the `unique()` function on `catalog_id`.<jupyter_code>catalog = unique(QTable.read('../challenge/case9/case9_challenge_00.txt', format='ascii.ipac'),'catalog_id')
pointing = QTable.read('../challenge/case9/case9_challenge_00_pointing.txt', format='ascii.ipac')
source = SkyCoord(ra=catalog['ra'], dec=catalog['dec'])<jupyter_output><empty_output><jupyter_text>The center of the field of view is defined to illustrate the distribution of the sources. Note that the `mean()` method works only when the pointings do not corss the meridian.<jupyter_code>center = pointing.to_pandas().mean()
fov_center = SkyCoord(center.ra*u.deg,center.dec*u.deg).galactic
ax = w.display_sources(fov_center, source, marker='.', title='Case 9 sources')<jupyter_output><empty_output><jupyter_text>Construct the `telescope` instances from the pointing table.The `overlay_footprints()` method illustrates the telescope footprint on the given axis.The sources are illustrated in the _Galactic_ coordinates, whle the telescope is defined in the _ICRS_ coordinates.Thus, you have to set `frame='galactic'` to obtain the footprint in the _Galactic_ coordinates.<jupyter_code>fov = [get_jasmine(SkyCoord(rec['ra'],rec['dec']),Angle(rec['pa'])) for rec in pointing]
ax = w.display_sources(fov_center, source, marker='.', title='Case 9 sources')
for n,tel in enumerate(fov):
    tel.overlay_footprints(ax, frame='galactic', 
        color=f'C{n+1}', lw=2, label=f'Footprint of Pointing {n}')
ax.legend(bbox_to_anchor=[1,1], loc='upper left', frameon=False)
plt.show()
fig = plt.figure(figsize=(12,12))
axes = fig.subplots(2,2).flatten()
for n,ax in enumerate(axes):
    fov[n].display_focal_plane(source, axis=ax)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11531986531986532, 'fraction_numerical': 0.011363636363636364, 'mean_word_length': 7.140410958904109, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '430539', 'license': 'MIT', 'n_tokens_mistral': 803, 'n_tokens_neox': 753, 'n_words': 214, 'path': 'notebook/sample_01_on-sky_footprints.ipynb', 'repo_name': 'xr0038/jasmine_warpfield', 'size': '2376'}