astrobase.services.skyview module

This gets cutout images from the Digitized Sky Survey using the NASA GSFC SkyView server.

astrobase.services.skyview.get_stamp(ra, decl, survey='DSS2 Red', scaling='Linear', sizepix=300, forcefetch=False, cachedir='~/.astrobase/stamp-cache', timeout=45.0, retry_failed=True, verbose=True, jitter=5.0)[source]

This gets a FITS cutout from the NASA GSFC SkyView service.

This downloads stamps in FITS format from the NASA SkyView service:

https://skyview.gsfc.nasa.gov/current/cgi/query.pl

Parameters:
  • ra,decl (float) – These are decimal equatorial coordinates for the cutout center.
  • survey (str) – The survey name to get the stamp from. This is one of the values in the ‘SkyView Surveys’ option boxes on the SkyView webpage. Currently, we’ve only tested using ‘DSS2 Red’ as the value for this kwarg, but the other ones should work in principle.
  • scaling (str) – This is the pixel value scaling function to use.
  • sizepix (int) – The width and height of the cutout are specified by this value.
  • forcefetch (bool) – If True, will disregard any existing cached copies of the stamp already downloaded corresponding to the requested center coordinates and redownload the FITS from the SkyView service.
  • cachedir (str) – This is the path to the astrobase cache directory. All downloaded FITS stamps are stored here as .fits.gz files so we can immediately respond with the cached copy when a request is made for a coordinate center that’s already been downloaded.
  • timeout (float) – Sets the timeout in seconds to wait for a response from the NASA SkyView service.
  • retry_failed (bool) – If the initial request to SkyView fails, and this is True, will retry until it succeeds.
  • verbose (bool) – If True, indicates progress.
  • jitter (float) – This is used to control the scale of the random wait in seconds before starting the query. Useful in parallelized situations.
Returns:

A dict of the following form is returned:

{
    'params':{input ra, decl and kwargs used},
    'provenance':'cached' or 'new download',
    'fitsfile':FITS file to which the cutout was saved on disk
}

Return type:

dict