RGBMaker package

rgbmaker.fetch

rgbmaker.fetch.query(name='', position='', radius=0.12, archives=1, imagesopt=2, kind='base64', spidx_file=None, px=480, annot=True)[source]
from rgbmaker.fetch import query
query(name='Avi', position='3C 33.1', radius=0.12, kind='plot')
VLA FIRST (1.4 GHz) not found 
_images/rgbmaker_0_2.png
('success',
 [{'img1': 'data:image/png;base64,plotted'}],
 'completed in 2.161. ',
 [{'survey_err': [], 'exception': ["object of type 'int' has no len()"]},
  {'VLA FIRST (1.4 GHz)': 'value ranges from 0.0000 to 0.0000'},
  {'NVSS': 'value ranges from 0.0000 to 0.0000'},
  {'TGSS ADR1': 'value ranges from 0.0000 to 0.0000'},
  {'Target center': '01h09m42.22232028s +73d11m52.80272285s'}])

Parameters

name:

(Optional) (default=Anonymous) (string)

Your name will be displayed on the image enabling mentors, professors, fellow students to be able to recognize your work. Credit is important!

position:

(Required)

The object name or the coordinates of the object in the FK5 (J2000) system. Ex: “14 09 48.86 -03 02 32.6”, M87, NGC1243, without quotes.

radius:

(Required) (default = 0.12) (float)

The size of the image in degrees, this size will be used for the field of view in the resultant image. For reference, in the night sky, the moon is about 0.52 degrees across.

imagesopt:

(default=2)(string)(values=1,2,3)

This dropdown gives you a choice of the composite images you want to create.

IOU ROR Optical (option = 1)

This option returns four images.

1. There are two ROR <https://radathomeindia.org/rgbmaker-info#what-is-iou-ror-and-rgb>_ (Radio (TGSS ADR1) - Optical (DSS2Red) - Radio (NVSS)) images. One with TGSS Contours and another with NVSS Contours.

2. The third image is an IOU <https://radathomeindia.org/rgbmaker-info#what-is-iou-ror-and-rgb>_ (Infrared (WISE 22) - Optical (DSS2 Red) - Ultraviolet (Galex Near UV)) with TGSS Contours.

  1. The final RGB image is an optical image with (DSS2IR - DSS2Red - DSS2Blue) with TGGSS Contours.

Composite Contours on DSS2R (option = 2)

This option returns two images.

1. The first is a ROR <https://radathomeindia.org/rgbmaker-info#what-is-iou-ror-and-rgb>_ Image with TGSS contours. The various symbol seen on the image is the catalog data of the respective survey.

2. The second image is a composite image with DSS2Red background and contours of various radio surveys like TGSS, NVSS, and VLA First (if available).

archives:

(default=1)(string)

This dropdown currently offers access to the NVAS image archive. Selecting this option will return the top 5 results from NVAS (if exists). These can be downloaded as .imfits files (open with DS9) by using save as an option when right-clicked.

kind:

(default=’base64’) choose from base64, plot, png, jpg to show base64 of resultant image, plot on output, save png/jpg files

spidx_file:

(Default=None) enter path to spidx.fits file that contains spectral index data (see example 1).

px:

(default=480) change pixel value for the final resulatant image.

annot:

(default=True) remove any annotation by setting this to False.

rgbmaker.imgplt

rgbmaker.imgplt.linear(inputArray, scale_min=None, scale_max=None)[source]

Performs linear scaling of the input numpy array.

inputArray:

numpy array image data array

scale_min:

float minimum data value

scale_max:

float maximum data value

return:

numpy array image data array

rgbmaker.imgplt.log(inputArray, scale_min=None, scale_max=None, factor=2.0)[source]

Performs log10 scaling of the input numpy array.

inputArray:

numpy array image data array

scale_min:

float minimum data value

scale_max:

float maximum data value

factor:

float logarithm multiplication factor.

return:

numpy array image data array

rgbmaker.imgplt.normals(o)[source]

normalizing before scaling

Input

o:

(2D array) input survey

Returns

(2D array):

dimension same as input survey

rgbmaker.imgplt.overlayc(r, g, b, c, lvl, cmin)[source]

Returns RGB stacked image and contour levels to be overlayed.

Input

r/g/b:

(2-D array)

survey 2-D array input data

c:

(2-D array)

survey data for contour

lvl:

(int)

number of levels to draw

cmin:

(float) minimum value selected for the contour

Returns

Img:

(np array) dimension: (px,px,3)

lvlc:

(list) dimension: None or of length len(lvl)

rgbmaker.imgplt.overlayo(ri, gi, bi, kind='IOU')[source]

Returns RGB stacked image.

Input

ri/gi/bi:

(2-D array) survey 2-D array data in

kind:

(string) either IOU or Optical

Returns

Img:

(nd array) dimension: (px,px,3)

scaling:
  • IOU - sqrt(w22), sqrt(dss2r), log(gnuv)(5 to 100% & factor =3.15)

  • Optical - sqrt, sqrt, sqrt (min to max)

rgbmaker.imgplt.pl_RGB(ax, img, title, name, annot=True)[source]

Inputs

rows:

(int) Total number of rows.

columns:

(int) Total number of columns.

i:

(int) current number of the cell.

wcs:

(astropy wcs) world coordinate system fetched from header of fits

img:

(np array) dimension = (px,px,3)

fig:

<maplotlib.pyplot.figure>

name:

(string) input name to be show on figure

Returns

adds plot to the figure.

rgbmaker.imgplt.pl_RGBC(rows, columns, i, wcs, svy, lvlc, img, fig, name, pkind='ror', annot=True)[source]

Inputs

rows:

(int) Total number of rows.

columns:

(int) Total number of columns.

i:

(int) current number of the cell.

wcs:

(astropy wcs) world coordinate system fetched from header of fits

svy:

(np array) 2-D array survey for contours.

lvlc:

(list) list of float

img:

(np array) dimension = (px,px,3)

fig:

<maplotlib.pyplot.figure>

name:

(string) input name to be show on figure

pkind:

(str) ror/iou; default=’ror’

Returns

plots the ror/iou figure.

rgbmaker.imgplt.pl_powerlawsi(S, S_e, freq=[150, 1420], kind='plot', label='output')[source]

plot powerlaw of spectralindex

Inputs

S:

Total flux of TGSS and NVSS resp (list)

S_e:

error on Total flux of TGSS and NVSS resp (list)

freq:

frequency of TGSS and NVSS resp (list) (default = [150, 1420] )

kind:
(str) choose from ‘base64’, ‘plot’, ‘jpg’,’png’
  • ‘base64’ : base64 encoded

  • ‘plot’ : outputs plot in window or in your jupyter notebook

  • ‘jpg’ : saves jpg image output in output/

  • ‘png’ : saves png image output in output/

Example

>>> S_e = [42.6, 2.6]
>>> S = [424.0, 60.0]
>>> pl_si(S,S_e)
rgbmaker.imgplt.save_fig(plt, fig, kind='base64', output='output.jpg')[source]
rgbmaker.imgplt.sqrt(inputArray, scale_min=None, scale_max=None)[source]

Performs sqrt scaling of the input numpy array.

inputArray:

numpy array image data array

scale_min:

float minimum data value

scale_max:

float maximum data value

return:

numpy array image data array

rgbmaker.imgplt.to_pixel(unit_inarcsec, r, px=480)[source]

Convert arcsec into pixel.

input:
unit_inarcsec

input magnitude (unitless) data in arcsec

r

length of square image in deg

px

total pixels in one length

Returns:

input data converted to be used onto pixel length rounded upto 2 decimal places.

rgbmaker.tgss_spidx

rgbmaker.tgss_spidx.find_spidx(spidx_file, c, r)[source]
>>> file_path = 'spidxcat_v1.1b.fits'
>>> c = coordinates.SkyCoord.from_name('3C 33.1', frame='fk5')
>>> find_spidx(file_path, c)
>>> [212.52272467 212.43975207 212.47209909 212.46530053 212.39858977
    212.40165324],[-3.11523434 -3.03256748 -3.07505213 -3.0517433  -2.9848956  -2.96384673],
    [-0.842 -0.488 -0.872 -0.308 -0.615 -0.471]

Parameters

spidx_file:

spidx fits file (approx 111 MB) with Fitsrec type table in hdul[1]

c:

Astropy SkyCoord type RA, DEC (astropy unit - degrees)

radius (r):

Astropy unit in degree for the sky angular size.

Returns

xi, yi, spidx:

RA(unitless), DEC(unitless) and corrosponding Spectral Index values that can be plotted on plot using wcs.world_to_pixel()

rgbmaker.wrightCC

rgbmaker.wrightCC.cosmo_calc(z, H0=69.6, WM=0.286, WV=None, univ=2)[source]

Cosmology calculator aka Ned Wright www.astro.ucla.edu/~wright

Input values

redshift, Ho, Omega_m, Omega_vac

ouput values

age at z, distance in Mpc, kpc/arcsec, apparent to abs mag conversion

Options

-h:

for help message

-v:

for verbose response

H0 = 75:

Hubble constant

WM = 0.3:

Omega(matter)