SCORPIO API¶
Sky COllector of galaxy Pairs and Image Output (Scorpio).
Is a tool to quick generate images of galaxy pairs, using data from different surveys.
-
scorpio.
SURVEYS
= {'2MASS': {'default': ['-H', '-K'], 'filters': ['-J', '-H', '-K']}, 'SDSS': {'default': ['g', 'i'], 'filters': ['u', 'g', 'r', 'i', 'z']}, 'WISE': {'default': [' 4.6', ' 12'], 'filters': [' 3.4', ' 4.6', ' 12', ' 22']}}¶ SURVEYS
-
scorpio.
COSMOLOGY
= FlatLambdaCDM(name="Planck18", H0=67.7 km / (Mpc s), Om0=0.31, Tcmb0=2.725 K, Neff=3.05, m_nu=[0. 0. 0.06] eV, Ob0=0.049)¶ The default cosmology.
-
scorpio.
DOWNLOAD_COORDINATE_SYSTEM
= 'J2000'¶ The default coordinate system.
-
scorpio.
DOWNLOAD_SHOW_PROGRESS
= True¶ If a progress indicator will be showed when a file is downloaded.
-
scorpio.
PLOT_DEFAULT_SIZE
= (8, 8)¶ The default plot size for scorpio
-
exception
scorpio.
NoFilterToStackError
[source]¶ Bases:
ValueError
Error generated when data of stack galaxies is empty.
-
exception
scorpio.
NoSurveyInListToStackError
[source]¶ Bases:
ValueError
Error generated when survey of stack galaxies not in our list.
-
exception
scorpio.
InvalidCosmologyError
[source]¶ Bases:
TypeError
Error generated when cosmology is an invalid astropy cosmology.
-
class
scorpio.
GPInteraction
(ra1, dec1, z1, ra2, dec2, z2, survey, resolution, cosmology, mtx_, header_, dist_physic_, dist_pix_, pos1_, pos2_)[source]¶ Bases:
object
Representation of two interacting galaxies.
- Parameters
ra1 (float) – Right ascension of primary galaxy in degrees.
dec1 (float) – Declination of primary galaxy in degrees.
z1 (float) – Redshift of secondary galaxy.
ra2 (float) – Right ascension of secondary galaxy in degrees.
dec2 (float) – Declination of secondary galaxy in degrees.
z2 (float) – Redshift of secondary galaxy.
resolution (int) – Size resolution value in pixels, by default it is 1000.
survey (string) – Survey for query and download data, by default it is “SDSS”.
filters (list of strings) – Filters for respective survey, by default it is [“g”, “i”] for “SDSS”.
-
mtx_
¶ The image of the two galaxies interacting.
-
header_
¶ header information of image fits file.
-
dist_physic_
¶ Estimation of physical distance to the observer in kpc, from a given cosmology
-
dist_pix_
¶ Physical distance as pixels in the image.
-
pos1_
¶ RA, DEC, Z as pixels of the first galaxy.
-
pos2_
¶ RA, DEC, Z as pixels of the second galaxy.
-
plot
(ax=None, cmap='magma', center_color='cyan', center=True, scale=True, fmt='.4g', llimit=None, heatmap_kws=None, center_kws=None, center_text_kws=None, scalebar_kws=None, scalebar_text_kws=None, scalebar_bg_kws=None)[source]¶ Receives data from other functions to generate and export a image.
- Parameters
ax (Axes) – Complete information of the properties to generate the image, by default it is None.
cmap (
str
, optional) – Name of the color map to be used (https://matplotlib.org/users/colormaps.html). If is None, the default colors of the matplotlib.pyplot.plot function is used, and if, and is a callable is used as colormap generator.center_color (
str
, optional) – The color for the marker of the galaxy centers.center (
bool
, optional.) – Whether to draw the galaxy center markers.scale (
bool
, optional.) – Whether to draw the scale bar.fmt (
str
, optional) – String formatting code to use in the coordinates.llimit (
float
, optional.) – The lowest value to show in the plot. If some value is <= llimit then it was remplaced with llimit. By default this value is setted as 0.0005 times the maximun value of the image.heatmap_kws (
dict
orNone
, optional) – Keyword arguments forseaborn.heatmap()
. This routine is the one that draws the image of the interaction.cbar_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.figure.Figure.colorbar()
.center_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.pyplot.Axes.plot()
. This routine is the one that draws the markers for the centers of the two galaxies.center_text_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.pyplot.Axes.text()
. This routine is the one that draws the names of the markers of the galactic centers.scalebar_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.pyplot.Axes.hlines()
. This routine is what draws the scale bar.scalebar_text_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.pyplot.Axes.text()
. This routine is what draws the scale bar text.scalebar_bg_kws (
dict
orNone
, optional) – Keyword arguments formatplotlib.pyplot.Axes.broken_barh()
. This routine is what draws the scale bar background color.
- Returns
The axis where the method draws.
- Return type
matplotlib.pyplot.Axis
-
scorpio.
download_data
(pos, survey, filters, pxl)[source]¶ Proxy to astroquery SkyviewService.
This functions is mostly for internal use.
- Parameters
pos (SkyCoord) – Determines the center of the field to be retrieved.
survey (str) – The data to download the survey.
filters (list) – Specific astronomical filters of the data.
pxl – Selects the pixel dimensions of the image to be produced.
- Returns
- Return type
A list of ~astropy.io.fits.HDUList objects.
-
scorpio.
stack_pair
(ra1, dec1, ra2, dec2, resolution=1000, survey='SDSS', filters=None)[source]¶ Generate a individual image from RA, DEC data of galaxy pair.
- Parameters
ra1 (float) – Right ascension of primary galaxy in degrees.
dec1 (float) – Declination of primary galaxy in degrees.
ra2 (float) – Right ascension of secondary galaxy in degrees.
dec2 (float) – Declination of secondary galaxy in degrees.
resolution (int) – Size resolution value in pixels, by default it is 1000.
survey (string) – Survey for query and download data, by default it is “SDSS”.
filters (list of strings) – Filters for respective survey, by default it is [“g”, “i”] for “SDSS”.
- Returns
g1g2 (array_like) – Array with the stacked information of the galaxies in the survey and the selected filters.
header (string) – Header from the primary galaxy .fits file.
-
scorpio.
distances
(ra1, dec1, ra2, dec2, z1, z2, header, cosmology=None)[source]¶ Receives the RA, DEC, redshift parameters for the two galaxies.
As well as header information for the primary galaxy and cosmology within the options provided by Astropy.
Calculate the physical and pixel distances of the two galaxies necessary for their location in the final image.
- Parameters
ra1 (float) – Right ascension of primary galaxy in degrees.
dec1 (float) – Declination of primary galaxy in degrees.
z1 (float) – Redshift of secondary galaxy.
ra2 (float) – Right ascension of secondary galaxy in degrees.
dec2 (float) – Declination of secondary galaxy in degrees.
z2 (float) – Redshift of secondary galaxy.
header (string) – Header from the primary galaxy .fits file.
survey (string) – Survey for query and download data, by default it is “SDSS”.
cosmology (optional) – Instance of class
astropy.cosmology.FLRW
. Defaults to astropy’s default cosmology (Planck18 since v4.2).
- Returns
dist_physic (float) – physical distance between the pair in kpc.
dist_pix (float) – physical distance to pixels in the image.
c1, c2 (array_like) – Arrays with coordinates of both galaxies in pixels.
-
scorpio.
gpair
(ra1, dec1, ra2, dec2, z1, z2, survey='SDSS', filters=None, resolution=1000, cosmology=None)[source]¶ Receives the RA, DEC, redshift parameters for the two galaxies.
As well as the resolution in pixels, survey and filters. Returns the necessary characteristics to generate the final image.
- Parameters
ra1 (float) – Right ascension of primary galaxy in degrees.
dec1 (float) – Declination of primary galaxy in degrees.
z1 (float) – Redshift of secondary galaxy.
ra2 (float) – Right ascension of secondary galaxy in degrees.
dec2 (float) – Declination of secondary galaxy in degrees.
z2 (float) – Redshift of secondary galaxy.
survey (string, optional (default='SDSS')) – Survey for query and download data.
filters (list of strings) – Filters for respective survey, by default it is [“g”, “i”] for “SDSS”.
resolution (int, optional (default=1000)) – Size resolution value in pixels.
cosmology (optional) – Instance of class
astropy.cosmology.FLRW
. Defaults to astropy’s default cosmology (Planck18 since v4.2).
- Returns
An object with information about the two interacting galaxies.
- Return type
Notes
For a complete list of astropy predefined cosmologies see: https://docs.astropy.org/en/latest/cosmology/index.html#built-in-cosmologies