<jupyter_start><jupyter_text>This notebook produces a single image if you enter RA and DEC<jupyter_code>import numpy
print( 'numpy version: ', numpy.__version__ )

import matplotlib
print( 'matplotlib version: ', matplotlib.__version__ )
import lsst.daf.butler as dafButler
# What version of the LSST Science Pipelnes are we using?
! echo $IMAGE_DESCRIPTION
! eups list -s | grep lsst_distrib

import pandas
pandas.set_option('display.max_rows', 1000)

# allow for matplotlib to create inline plots in our notebook
%matplotlib inline
import matplotlib.pyplot as plt      # imports matplotlib.pyplot as plt
import warnings                      # imports the warnings library

from astropy.wcs import WCS          # imports astropy's World Coordinate System function WCS

from IPython.display import Markdown as md

# from rubin_jupyter_utils.lab.notebook import get_catalog, retrieve_query    
from rubin_jupyter_utils.lab.notebook import get_tap_service, retrieve_query    

import lsst.afw.display as afwDisplay
afwDisplay.setDefaultBackend('matplotlib') 

repo = 's3://butler-us-central1-dp01'  
collection='2.2i/runs/DP0.1'
#collection='1.2i/runs/DP0.1'

# Deprecated
# service = get_catalog()
service = get_tap_service()
butler = dafButler.Butler(repo,collections=collection)<jupyter_output>numpy version:  1.20.2
matplotlib version:  3.4.2
Recommended (Weekly 2021_25)
lsst_distrib          21.0.0-3-gc37e2ab+2186fb90a2 	w_2021_25 current setup<jupyter_text>Put RA and DEC here:<jupyter_code>ra = 67.0 
dec = -42.5
filter_id = 'g'<jupyter_output><empty_output><jupyter_text>This will produce the output image<jupyter_code>import lsst.geom
#my_spherePoint = lsst.geom.SpherePoint(55.745834*lsst.geom.degrees, -32.269167*lsst.geom.degrees)
my_spherePoint = lsst.geom.SpherePoint(ra*lsst.geom.degrees, dec*lsst.geom.degrees)
print(my_spherePoint)

skymap = butler.get('skyMap')
my_tract = skymap.findTract(my_spherePoint)
my_patch = my_tract.findPatch(my_spherePoint)
my_patch_id = my_tract.getSequentialPatchIndex(my_patch)
tract1 = str(my_tract)
tract2 = str(my_patch_id)
tract1_ok = tract1[13:17]
print(tract1_ok)

#dataId = """{'band': """+"""'"""+filter_id+"""','tract': """+tract1_ok+""", 'patch':"""+tract2+"""}"""

dataId = {'band': filter_id, 'tract': int(tract1_ok), 'patch':int(tract2)}


print('my_tract = ', my_tract)
print('my_patch = ', my_patch)
print('my_patch_id = ',my_patch_id)
print(dataId)<jupyter_output>(67.0000000000, -42.5000000000)
3083
my_tract =  TractInfo(id=3083)
my_patch =  PatchInfo(index=(5, 3))
my_patch_id =  26
{'band': 'g', 'tract': 3083, 'patch': 26}<jupyter_text>This calls the Butler to get the coadded data corresponding to the tract and patch we asked for above<jupyter_code>#dataId = {'band': 'i', 'tract': 4641, 'patch':37}
my_deepCoadd = butler.get('deepCoadd',dataId=dataId)<jupyter_output><empty_output><jupyter_text>This makes a plot of the coadded data.<jupyter_code>fig = plt.figure(figsize=(10,8))      # create a matplotlib.pyplot figure
afw_display = afwDisplay.Display(1)   # create an alias for the lsst.afw.display.Display() method
afw_display.scale('asinh', 'zscale')  # set the algorithm and scale for the pixel shading
afw_display.mtv(my_deepCoadd.image)   # display the image data you retrieved with the butler
plt.gca().axis('off')                 # turn off the x and y axes labels<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12052117263843648, 'fraction_numerical': 0.040568551969203434, 'mean_word_length': 5.662721893491124, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '481303', 'license': 'MIT', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1241, 'n_words': 276, 'path': 'notebooks/DP0/single_image.ipynb', 'repo_name': 'mpwiesner/KDC', 'size': '3377'}