astro_prost.diagnose

Functions

getimages(ra, dec[, size, filters, type])

Query ps1filenames.py service to get a list of images.

geturl(ra, dec[, size, output_size, filters, format, ...])

Get the URL for images in the table.

get_ps1_pic(path, objid, ra, dec, size, band[, safe, save])

Downloads PS1 picture (in fits) centered at a given location.

find_all(name, path)

Crawls through a directory and all its sub-directories looking for a file matching

plot_match(host_ra, host_dec, true_host_ra, ...)

Short summary.

diagnose_ranking(true_index, post_probs, ...[, ...])

Short summary.

Module Contents

getimages(ra, dec, size=240, filters='grizy', type='stack')[source]

Query ps1filenames.py service to get a list of images.

Parameters:
  • ra (float) – Right ascension of position, in degrees.

  • dec (float) – Declination of position, in degrees.

  • size (int) – The image size in pixels (0.25 arcsec/pixel)

  • filters (str) – A string with the filters to include

Returns:

The results of the search for relevant images.

Return type:

Astropy Table

geturl(ra, dec, size=240, output_size=None, filters='grizy', format='jpg', color=False, type='stack')[source]

Get the URL for images in the table.

Parameters:
  • ra (float) – Right ascension of position, in degrees.

  • dec (float) – Declination of position, in degrees.

  • size (int) – The extracted image size in pixels (0.25 arcsec/pixel)

  • output_size (int) – output (display) image size in pixels (default = size). The output_size has no effect for fits format images.

  • filters (str) – The string with filters to include.

  • format (str) – The data format (options are "jpg", "png” or "fits").

  • color (bool, optional) – If True, creates a color image (only for jpg or png format). If False, return a list of URLs for single-filter grayscale images.

Returns:

The url for the image to download.

Return type:

str

get_ps1_pic(path, objid, ra, dec, size, band, safe=False, save=False)[source]

Downloads PS1 picture (in fits) centered at a given location.

Parameters:
  • path (str) – The filepath where the fits file will be saved.

  • objid (int) – The PS1 objid of the object of interest (to save as filename).

  • ra (float) – Right ascension of position, in degrees.

  • dec (float) – Declination of position, in degrees.

  • size (int) – The extracted image size in pixels (0.25 arcsec/pixel)

  • band (str) – The PS1 band.

  • safe (bool, optional) – If True, include the objid of the object of interest in the filename (useful when saving multiple files at comparable positions).

find_all(name, path)[source]
Crawls through a directory and all its sub-directories looking for a file matching

'name'. If found, it is returned.

Parameters:
  • name (str) – The filename for which to search.

  • path (str) – The directory to search.

Returns:

The list of absolute paths to all files called 'name' in 'path'.

Return type:

list

plot_match(host_ra, host_dec, true_host_ra, true_host_dec, host_z_mean, host_z_std, sn_ra, sn_dec, sn_name, sn_z, bayesflag, fn)[source]

Short summary.

Parameters:
  • host_ra (type) – Description of parameter host_ra.

  • host_dec (type) – Description of parameter host_dec.

  • true_host_ra (type) – Description of parameter true_host_ra.

  • true_host_dec (type) – Description of parameter true_host_dec.

  • host_z_mean (type) – Description of parameter host_z_mean.

  • host_z_std (type) – Description of parameter host_z_std.

  • sn_ra (type) – Description of parameter sn_ra.

  • sn_dec (type) – Description of parameter sn_dec.

  • sn_name (type) – Description of parameter sn_name.

  • sn_z (type) – Description of parameter sn_z.

  • bayesflag (type) – Description of parameter bayesflag.

  • fn (type) – Description of parameter fn.

Returns:

Description of returned object.

Return type:

type

diagnose_ranking(true_index, post_probs, galaxy_catalog, post_offset, post_z, post_absmag, galaxy_ids, z_sn, sn_position, post_offset_true=None, post_z_true=None, post_absmag_true=None, verbose=False)[source]

Short summary.

Parameters:
  • true_index (type) – Description of parameter true_index.

  • post_probs (type) – Description of parameter post_probs.

  • galaxy_catalog (type) – Description of parameter galaxy_catalog.

  • post_offset (type) – Description of parameter post_offset.

  • post_z (type) – Description of parameter post_z.

  • post_absmag (type) – Description of parameter post_absmag.

  • galaxy_ids (type) – Description of parameter galaxy_ids.

  • z_sn (type) – Description of parameter z_sn.

  • sn_position (type) – Description of parameter sn_position.

  • post_offset_true (type) – Description of parameter post_offset_true.

  • post_z_true (type) – Description of parameter post_z_true.

  • post_absmag_true (type) – Description of parameter post_absmag_true.

  • verbose (type) – Description of parameter verbose.

Returns:

Description of returned object.

Return type:

type