RGB Images

hostphot.rgb_images.asinh(inputArray, scale_min=None, scale_max=None, non_linear=2.0)

Performs asinh() scaling of the input numpy array.

Parameters:
  • inputArray (numpy array) – Image data array.

  • scale_min (float, default None) – Minimum data value.

  • scale_max (float, default None) – Maximum data value.

  • non_linear (float, default 2.0) – Non-linearity factor.

Returns:

imageData – Scaled image data array.

Return type:

numpy array

hostphot.rgb_images.create_RGB_image(outfile=None, survey='PS1', filters='zir', images_dir='', scaling='linear', scaling_params=None)

Creates an RGB image.

Parameters:
  • outfile (str, default None) – Output file name. If None, no output is saved.

  • survey (str, default PS1) – Survey used for the filters.

  • filters (str, defaul zir) – Filters used to create the RGB image (in that order). Must be three filters.

  • images_dir (str, default ‘’) – Directory where to find the images.

  • scaling (str) – Type of scaling. Choose between linear, sqrt, log and asinh.

  • scaling_params (dict) – Dictionary with the parameters for the scaling function. If None, use the default values.

Examples

>>> # Example of scaling_params:
>>> scaling_params = {'R':{'min':r_med/100, 'max':r_med*30},
                                  'G':{'min':g_med/1000, 'max':g_med*150},
                                  'B':{'min':b_med/30, 'max':b_med*100}}
hostphot.rgb_images.get_PS1_RGB_image(outfile, ra, dec, size=3, filters='grizy')

Downloads an RGB image from the PS1 server.

Parameters:
  • outfile (str) – URL of the image to be downloaded

  • 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) – Filters to include.

Returns:

url – The image’s URL for a colour image.

Return type:

str

hostphot.rgb_images.get_PS1_url(ra, dec, size=3, filters='grizy', data_format='jpg')

Get URL for the colour image.

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) – Filters to include.

  • data_format (str) – Data format (options are jpg or png).

Returns:

url – The image’s URL for a colour image.

Return type:

str

hostphot.rgb_images.get_SDSS_RGB_image(outfile, ra, dec, size=3)

Downloads an RGB image from the SDSS server.

Parameters:
  • remote_url (str) – URL of the image to be downloaded

  • 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.

Returns:

url – The image’s URL for a colour image.

Return type:

str

hostphot.rgb_images.linear(inputArray, scale_min=None, scale_max=None)

Performs linear scaling of the input numpy array.

Parameters:
  • inputArray (numpy array) – Image data array.

  • scale_min (float, default None) – Minimum data value.

  • scale_max (float, default None) – Maximum data value.

Returns:

imageData – Scaled image data array.

Return type:

numpy array

hostphot.rgb_images.log(inputArray, scale_min=None, scale_max=None)

Performs log10() scaling of the input numpy array.

Parameters:
  • inputArray (numpy array) – Image data array.

  • scale_min (float, default None) – Minimum data value.

  • scale_max (float, default None) – Maximum data value.

Returns:

imageData – Scaled image data array.

Return type:

numpy array

hostphot.rgb_images.sqrt(inputArray, scale_min=None, scale_max=None)

Performs sqrt() scaling of the input numpy array.

Parameters:
  • inputArray (numpy array) – Image data array.

  • scale_min (float, default None) – Minimum data value.

  • scale_max (float, default None) – Maximum data value.

Returns:

imageData – Scaled image data array.

Return type:

numpy array