Cutouts¶
Everything related to cutouts is documented bellow:
- hostphot.cutouts.query_ps1(ra, dec, size=3, filters=None)¶
Query ps1filenames.py service to get a list of images
- Parameters
ra (float) – Right Ascension in degrees.
dec (float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters to use. IfNone
, usesgrizy
.
- Returns
table – Astropy table with the results.
- Return type
astropy Table
- hostphot.cutouts.get_PS1_urls(ra, dec, size=3, filters=None)¶
Get URLs for images obtained with
query_ps1()
.- Parameters
ra (float) – Right Ascension in degrees.
dec (float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters to use. IfNone
, usesgrizy
.
- Returns
url_list – List of URLs for the fits images.
- Return type
list
- hostphot.cutouts.get_PS1_images(ra, dec, size=3, filters=None)¶
Gets PS1 fits images for the given coordinates and filters.
- Parameters
ra (float) – Right Ascension in degrees.
dec (float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters to use. IfNone
, usesgrizy
.
- Returns
fits_files – List of fits images.
- Return type
list
- hostphot.cutouts.get_DES_urls(ra, dec, fov, filters='grizY')¶
Obtains the URLs of the DES images+weights with the largest exposure times in the given filters.
- Parameters
ra (float) – Right ascension in degrees.
dec (float) – Declination in degrees.
fov (float) – Field of view in degrees.
filters (str, default
None
) – Filters to use. IfNone
, usesgrizY
.
- Returns
url_list (list) – List of URLs with DES images.
url_w_list (list) – List of URLs with DES images weights.
- hostphot.cutouts.get_DES_images(ra, dec, size=3, filters=None)¶
Gets DES fits images for the given coordinates and filters.
- Parameters
ra (float) – Right Ascension in degrees.
dec (float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters to use. IfNone
, usesgrizY
.
- Returns
hdu_list – List of fits images.
- Return type
list
- hostphot.cutouts.get_SDSS_images(ra, dec, size=3, filters=None)¶
Downloads a set of SDSS fits images for a given set of coordinates and filters using SkyView.
- Parameters
ra (str or float) – Right ascension in degrees.
dec (str or float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters to use. IfNone
, usesugriz
.
- Returns
hdu_list – List with fits images for the given filters. None is returned if no image is found.
- Return type
list
- hostphot.cutouts.match_wcs(fits_files)¶
Matches the WCS of all the images, taking the first ones as a reference.
- Parameters
fits_files (list) – List of fits files.
- Returns
matched_fits_files – List of fits files with matched WCS.
- Return type
list
- hostphot.cutouts.download_images(name, ra, dec, size=3, filters=None, overwrite=False, survey='PS1', version=None)¶
Download images for a given object in the given filters of a given survey.
- Parameters
name (str) – Name used for tracking the object in your local directory.
ra (float) – Right ascension in degrees.
dec (float) – Declination in degrees.
size (float or ~astropy.units.Quantity, default
3
) – Image size. If a float is given, the units are assumed to be arcmin.filters (str, default
None
) – Filters for the images.overwrite (bool, default
False
) – IfTrue
, the images are overwritten if they already exist.survey (str, default
PS1
) – Survey used to download the images.version (str, default
None
) – Version used by some surveys including multiple surveys. E.g.VHS
for VISTA.
Examples
>>> from hostphot.cutouts import download_images >>> name = 'SN2004eo' >>> host_ra, host_dec = 308.2092, 9.92755 # coords of host galaxy of SN2004eo >>> survey = 'PS1' >>> download_images(name, host_ra, host_dec, survey=survey)
- hostphot.cutouts.pool_download(df=None, name=None, ra=None, dec=None, size=600, filters=None, overwrite=False, survey='PS1', processes=8)¶
Downloads images for multiple objects using parallelisation.
- Parameters
df (DataFrame, default
None
) – DataFrame with the values of the argmuents. If this is given,name
,ra
anddec
should be the names of the columns indf
.name (str or list-like, default
None
) – Name used for tracking the object in your local directory.ra (float or list-like, default
None
) – Right ascension in degrees of the center of the image.dec (float or list-like, default
None
) – Declination in degrees of the center of the image.size (int, default
600
) – Image size in pixels.filters (str, default
None
) – Filters for the images. IfNone
, use all the available filters.overwrite (bool, default
False
) – IfTrue
, the images are overwritten if they already exist.survey (str, default
PS1
) – Survey used to download the imagesprocesses (floar, default
8
) – Number of processes to use for the parallelisation.