<jupyter_start><jupyter_text>Run these cells just once<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)

from IPython.display import Markdown as md

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

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

# 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


repo = 's3://butler-us-central1-dp01'  
collection='2.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>Find object based on sensor ID and visit<jupyter_code># Note that the keys are slightly different for DC2/LSSTCam
# You can view all the keys by creating the butler and calling:
#   print(butler.getKeys('calexp'))

visit_id = 192350
band_name='i'


detector=[128,135,136,137,144,89,96,97,98,105,86,93,94,95,102,83,90,91,92,99,44,51,52,53,60]

for x in range(0, 25):
    dataname = {'visit': visit_id, 'detector': detector[x], 'band': band_name}
    print(dataname)
    calexp = butler.get('calexp', **dataname)
    # create a matplotlib.pyplot figure
   
    plt.figure()
    #fig = plt.figure(figsize=(10,8)) 
    # get an alias to the lsst.afw.display.Display() method
    display = afwDisplay.Display()
    # set the image stretch algorithm and range
    display.scale('asinh', 'zscale')
    # load the image into the display
    display.mtv(calexp.image)
    # show the corresponding pyplot figure
    plt.show()
    
    #plt.figure()
    # Set the figure's projection to be the WCS of the calexp
   # plt.subplot(projection=WCS(calexp.getWcs().getFitsMetadata()))
    # Display the calexp image data array using the gray colormap (cmap)
    #  and use approximately the same min and max scale values as above
   # plt.imshow(calexp.image.array, cmap='gray', vmin=-200.0, vmax=400, origin='lower')
    # Add solid white grid lines
   # plt.grid(color='white', ls='solid')
    # Label axes
   # plt.xlabel('Right Ascension')
   # plt.ylabel('Declination')
    
  
    

# Note: because the combination of visit+detector already uniquely identifies
# the exposure, specifying "band" above is unnecessary.



# Retrieve the data using the `butler` instance and its function `get()`
#calexp = butler.get('calexp', **dataId1)<jupyter_output>{'visit': 192350, 'detector': 128, 'band': 'i'}
{'fraction_non_alphanumeric': 0.10514752040175769, 'fraction_numerical': 0.04174513496547395, 'mean_word_length': 4.285240464344942, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '288235', 'license': 'MIT', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1074, 'n_words': 297, 'path': 'notebooks/DP0/square_degree.ipynb', 'repo_name': 'mpwiesner/KDC', 'size': '3186'}