gelsa.visu#
Functions
|
Colorize an image map. |
|
Process the image with an iterative median filter. |
|
Creates a color composite with rgb channels and optional brigtness value |
|
Overlay two rgb images. |
|
Apply median filter to the image |
|
Normalize an image with power. |
|
|
|
|
|
|
|
Display an image with matplotlib |
|
Make simple 1D trace of the 2D image |
- gelsa.visu.filter_image(image, masked_pix, iter=1, median_window=3)[source]#
Process the image with an iterative median filter.
Bad pixels are repaired iteratively by replacing them with the values from the median filtered image.
The kernel size is set by the median_window class variable.
- Parameters:
image (numpy.ndarray) – input image to process
masked_pix (numpy.ndarray) – selection array indicating bad pixels
iter (int)
- Returns:
processed image
- Return type:
- gelsa.visu.show(image=None, mask=None, var=None, crop=None, axes=None, levels=(10, 80), vmin_offset=200, infill=False, label_wavelength_step=500, colorbar=False, slice=None, extent=None, **params)[source]#
Display an image with matplotlib
- gelsa.visu.trace1d(image, mask=None, var=None, axis=0, **params)[source]#
Make simple 1D trace of the 2D image
- gelsa.visu.normalize_image(x, var=None, mask=None, levels=(10, 99.95), vmin=None, vmax=None, power=0.5, return_levels=False)[source]#
Normalize an image with power. Applies percentile clipping.
- Parameters:
x
levels
power
- Return type:
- gelsa.visu.make_color_image(r, g, b, brightness=None, **kwargs)[source]#
Creates a color composite with rgb channels and optional brigtness value
The color image is made with astropy.visualization.make_lupton_rgb.
If a brightness image is passed, it is used to set the value in the hsv color space. It should be normalized to the range [0, 1].
- gelsa.visu.colorize_image(image, hue=0, saturation=1)[source]#
Colorize an image map. The image array should be normalized in the range [0, 1]
- Parameters:
image (numpy.ndarray) – image map (2D array)
hue (float) – Hue value, in the range [0, 1]
saturation (float) – Saturation value, in the range [0, 1]
- Return type:
- gelsa.visu.make_image_composite(image_rgb, image_overlay, alpha_power=1, alpha=0.7)[source]#
Overlay two rgb images. The brightness of image_overlay is used for the mask.
- Parameters:
image_rgb (numpy.ndarray) – base rgb image
image_overlay (numpy.ndarray) – rgb image to overlay
alpha_power (float) – exponent for the alpha map
alpha (float) – opacity value in the range 0 transparent to 1 opaque.
- Return type: