obiwan.qa.visual

Helper functions for plotting fits and numpy 2D arrays as images

Classes

plotImage Helper functions for displaying image and overlaying circles around sources

Functions

flux2mag(flux)
readImage(fn[, jpeg, ext]) Reads FITS and jpeg images so that x,y indices refer to the same pixels regardless of image format.
sliceImage(img[, xslice, yslice]) Not sure why, but simcat.x[xslice],simcat.y[yslice] corresponds to img[yslice,xslice], eg inverted for the image
class obiwan.qa.visual.plotImage[source]

Helper functions for displaying image and overlaying circles around sources

Parameters:img – need to give as initial input b/c some helper funcs that dont directly use img, need its shape at least, see circles()
circles(xs, ys, ax, img_shape=None, xslice=None, yslice=None, r_pixels=19.083969465648853, color='y')[source]

xs,ys: x,y positions of sources in pixels, e.g. tractor.bx or simcat.x img_shape: needed when xslice or yslice is None xlice,yslice: slice() objects into the image array r_pixels: radius circles in pixels

justInSlice(x, y, xslice, yslice)[source]

Returns bool array of x,y positions in the slice()

obiwan.qa.visual.readImage(fn, jpeg=False, ext=1)[source]

Reads FITS and jpeg images so that x,y indices refer to the same pixels regardless of image format. x,y and fits correspond so the jpeg is rotated and flipped to align with fits

Parameters:
  • fn – image filename
  • jpeg – bool, is is a jpeg?
obiwan.qa.visual.sliceImage(img, xslice=slice(None, None, None), yslice=slice(None, None, None))[source]

Not sure why, but simcat.x[xslice],simcat.y[yslice] corresponds to img[yslice,xslice], eg inverted for the image