0 votes
338 views

I am trying to downloads cutouts from DES DR1 using the example code from the notebook  https://datalab.noao.edu/desdr1/analysis/DwarfGalaxyDESDR1_20171101.ipynb 

While this works for some coordinates, it fails for others. For example, it fails for ra=7.7923125, dec=-41.3655, where the image cutout service at https://datalab.noao.edu/sia.php clearly shows that there is a galaxy.

by | 338 views

1 Answer

+1 vote
Thank you for reaching out.

It looks like you are using an outdated notebook -- apologies that this is still in the documentation. We are continuously developing and improving our notebooks, and ask that users update their notebooks frequently. To get the latest set, please open in the Jupyter dashboard a new terminal window (top right, button "New", then "Terminal".) In the terminal, please type

getlatest <dirname>

where <dirname> is the name of your target directory, e.g. AUG16.

Then go back to the dashboard, click on the new directory (e.g. AUG16), where you will find the latest notebooks. In 03_ScienceExamples/DwarfGalaxies/ you will find the current DesDr1 notebook. With this notebook I tried your ra&dec coordinates, and have gotten images in several bands.

I hope this helps. Please let us know if you experience further trouble.

And we will make sure to update our User Manual very soon.

Best regards,
Robert
by datalab (20.7k points)
Thank you very much for the quick reply. However, this does not seems to work. The code in the new notebook appears identical to the old one. The code snippet below fails to produce a cutout:

from pyvo.dal import sia
import numpy as np
DEF_ACCESS_URL = "https://datalab.noao.edu/sia/des_dr1"
svc = sia.SIAService(DEF_ACCESS_URL)
fov=0.01
ra=7.7923125
dec=-41.3655
def download_deepest_images(ra,dec,fov=0.01,bands=list('gri')):
    imgTable = svc.search((ra,dec), (fov/np.cos(dec*np.pi/180), fov), verbosity=2).to_table() #.votable #.get_first_table()
    print("The full image list contains {:d} entries.".format(len(imgTable)))
    sel0 = (imgTable['proctype'] == b'Stack') & (imgTable['prodtype']==b'image') # basic selection
    images = []
    for band in bands:
        print("Band {:s}: ".format(band), end='')
        sel = sel0 & (imgTable['obs_bandpass'] == band.encode()) # add 'band' to selection
        Table = imgTable[sel] # select
        row = Table[np.argmax(Table['exptime'].data.data.astype('float'))] # pick image with longest exposure time
        url = row['access_url'] # get the download URL
        print('downloading deepest stacked image...')
        img = io.fits.getdata(utils.data.download_file(url.decode(),cache=True,show_progress=False,timeout=120)) # .decode() b/c in Python 3 url is of "byte" type and getdata() expects "string" type
        images.append(img)
    print("Downloaded {:d} images.".format(len(images)))
    return images
img = download_deepest_images(ra,dec,fov=0.01,bands=['r'])
sia.SIAService(DEF_ACCESS_URL) for DES DR1 cutout fails to find data

416 questions

434 answers

440 comments

636 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories