<jupyter_start><jupyter_text>Exercises for image visualization Feel free to pick and choose from these.Some exercises make use of code in the notebook. Other exercises will require a GUI interaction.   1. matplotlib: Contours from another image, and secondary axes Using matplotlib and astropy:* display the file `.data/w5.fits` as a bitmap with log stretch and min-max scaling* overlay the data in image extension 1 of `./data/0259p6031_1342192088_SpirePhoto_L20_PMP350_SPG14.0.fits.fits.gz` as white contours with levels drawn at [0.7, 1.4, 3] image units (Jy/beam)* display coordinate axes and grid (green, alpha=1) in (RA, Dec)  * overlay a coordinate grid (cyan, alpha=1) and axis labels in Galactic longitude and latitude<jupyter_code>import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
from astropy.visualization import (MinMaxInterval,
                                  LogStretch,
                                  ImageNormalize)
%matplotlib inline<jupyter_output><empty_output><jupyter_text>2. RGB-3-color images Using astropy and reproject (installable with `pip install reproject`), follow [these instructions](http://docs.astropy.org/en/stable/visualization/lupton_rgb.html) in the Astropy documentation to make color RGB images. Compare the second one to Figure 1 of [Lupton et al 2004](https://arxiv.org/abs/astro-ph/0312483).<jupyter_code>import numpy as np
from astropy.visualization import make_lupton_rgb
from astropy.io import fits
from reproject import reproject_interp
# Read in the three images downloaded from here:
g = fits.open('http://dr13.sdss.org/sas/dr13/eboss/photoObj/frames/301/1737/5/frame-g-001737-5-0039.fits.bz2')[0]
r = fits.open('http://dr13.sdss.org/sas/dr13/eboss/photoObj/frames/301/1737/5/frame-r-001737-5-0039.fits.bz2')[0]
i = fits.open('http://dr13.sdss.org/sas/dr13/eboss/photoObj/frames/301/1737/5/frame-i-001737-5-0039.fits.bz2')[0]<jupyter_output><empty_output><jupyter_text>3. RGB colors of Herschel-SPIRE images Reproject the 250 um image of W5 in `./data/0259p6031_1342192088_SpirePhoto_L20_PMP250_SPG14.0.fits.gz` (extension 1) and the 350 micron image in `./data/0259p6031_1342192088_SpirePhoto_L20_PMP350_SPG14.0.fits.gz` onto the 500 micron image in that directory, and try the same 3-color procedures.<jupyter_code>w5_250 = fits.open('./data/0259p6031_1342192088_SpirePhoto_L20_PMP250_SPG14.0.fits.gz')[1]
w5_350 = fits.open('./data/0259p6031_1342192088_SpirePhoto_L20_PMP350_SPG14.0.fits.gz')[1]
w5_500 = fits.open('./data/0259p6031_1342192088_SpirePhoto_L20_PMP500_SPG14.0.fits.gz')[1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10336906584992343, 'fraction_numerical': 0.10834609494640123, 'mean_word_length': 4.871910112359551, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '619222', 'license': 'MIT', 'n_tokens_mistral': 1110, 'n_tokens_neox': 914, 'n_words': 224, 'path': 'Sessions/Session02/Day5/ImageVizExercises.ipynb', 'repo_name': 'ka-rocha/LSSTC-DSFP-Sessions', 'size': '2612'}