starred.plots package

Submodules

starred.plots.plot_function module

starred.plots.plot_function.dict_to_kwargs_list(dict)[source]

Transform dictionnary into a list kwargs. All entry must have the same lenght.

:param

starred.plots.plot_function.display_data(data, sigma_2=None, masks=None, figsize=None, units=None, center=None)[source]

Plots the observations and the noise maps.

Parameters:
  • data – array containing the observations

  • sigma_2 – array containing the square of the noise maps

  • figsize – tuple that indicates the size of the figure

  • units (str) – units in which the pixel values are expressed

  • center – x and y coordinates of the centers of the observations

Returns:

output figure

starred.plots.plot_function.make_gif(list_files, output_path, duration=100, loop=1)[source]
starred.plots.plot_function.make_movie(model, kwargs, data, sigma_2, outpath, figsize=(9, 7.5), epochs_list=None, duration=20, loop=1, format='gif', cmap=None)[source]
starred.plots.plot_function.make_video(images, outvid=None, fps=5, size=None, is_color=True, format='mp4v')[source]

Create a video from a list of images.

@param outvid output video @param images list of images to use in the video @param fps frame per second @param size size of each frame @param is_color color @param format see http://www.fourcc.org/codecs.php @return see http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html

The function relies on http://opencv-python-tutroals.readthedocs.org/en/latest/. By default, the video will have the size of the first image. It will resize every image to this size before adding them to the video.

starred.plots.plot_function.multiple_PSF_plot(model, data, sigma_2, kwargs, star_coordinates=None, masks=None, mask_alpha=0.7, figsize=None, units=None, vmin=None, vmax=None, n_sigma=5)[source]

Plots the narrow PSF fit for all observations.

Parameters:
  • model – array containing the model

  • data – array containing the observations

  • sigma_2 – array containing the square of the noise maps

  • kwargs – dictionary containing the parameters of the model

  • star_positions – array of shape (N, 2), containing the pixel coordinates of each star Default None, N is the number of stamps (data.shape[0]), coordinates relative to the center of the original astronomical image.

  • masks – array containing the masks

  • figsize – tuple that indicates the size of the figure

  • units (str) – units in which the pixel values are expressed

  • vmin (float) – lower limit for displaying the residuals (in unit of noise sigma)

  • vmax (float) – upper limit for displaying the residuals (in unit of noise sigma)

  • n_sigma – number of sigmas to clip the residuals. Default is 5.

Except if both vmin and vmax are provided, the range will be [-n_sigma, +n_sigma]. :type n_sigma: float

Returns:

output figure

starred.plots.plot_function.plot_convergence_by_walker(samples_mcmc, param_mcmc, n_walkers, verbose=False)[source]
starred.plots.plot_function.plot_deconvolution(model, data, sigma_2, s, kwargs, epoch=0, units=None, figsize=(15, 10), cut_dict=None)[source]

Plots the results of the deconvolution.

Parameters:
  • data – array containing the observations. Has shape (n_epoch, n_pixel, n_pixel).

  • sigma_2 – array containing the square of the noise maps (n_epoch, n_pixel, n_pixel).

  • s – array containing the narrow PSF (n_epoch, n_pixel*susampling factor, n_pixel*susampling factor).

  • epoch (int) – index of the epoch to plot

  • kwargs – dictionary containing the parameters of the model

  • figsize – tuple that indicates the size of the figure

  • units (str) – units in which the pixel values are expressed

Returns:

output figure

starred.plots.plot_function.plot_loss(loss_history, figsize=(10, 5), ax=None, title=None)[source]
starred.plots.plot_function.single_PSF_plot(model, data, sigma_2, kwargs, n_psf=0, figsize=(15, 8), units=None, upsampling=None, masks=None, mask_alpha=0.7, star_coordinates=None, n_sigma=5)[source]

Plots the narrow PSF fit for a single observation.

Parameters:
  • model – array containing the model

  • data – array containing the observations

  • sigma_2 – array containing the square of the noise maps

  • kwargs – dictionary containing the parameters of the model

  • n_psf (int) – selected PSF index

  • figsize – tuple that indicates the size of the figure

  • units (str) – units in which the pixel values are expressed

  • upsampling_factor (int) – Provide the upsampling factor to degrade the model to the image resolution. Leave to ‘None’ to show the higher resolution model.

  • masks (array of the size of your image) – Boolean masks

  • star_coordinates – array of shape (N, 2), where N is the number of stamps in data, each row contains (x, y) coordinates, in pixels, with center the middle of the original astronomical image. default None.

  • n_sigma (float) – number of sigmas to clip the residuals. Default is 5.

Returns:

output figure

starred.plots.plot_function.view_deconv_model(model, kwargs, data, sigma_2, figsize=(9, 7.5), cmap='gist_heat')[source]

Module contents

This subpackage contains plotting functions