plot_fit

petrofit.modeling.plot_fit(model, image, mode='center', center=None, vmin=None, vmax=None, cbar=True, fontsize=18, figsize=[18, 6], flux_label='Pixel Value')[source]

Plot fitted model, its 1D fit profile and residuals. If trying to convert a model to image, use petrofit.modeling.fitting.model_to_image instead. This function dose not call plt.show().

Parameters:
imagearray

2D array that was fit by the model.

modestr, optional
One of the following modes (astropy.convolution.utils.discretize_model):
  • 'center' (default)

    Discretize model by taking the value at the center of the bin.

  • 'linear_interp'

    Discretize model by linearly interpolating between the values at the corners of the bin. For 2D models interpolation is bilinear.

  • 'oversample'

    Discretize model by taking the average on an oversampled grid.

  • 'integrate'

    Discretize model by integrating the model over the bin using scipy.integrate.quad. Very slow.

modelFittableModel

Original data that was fitted by the model.

modestr, optional
One of the following modes (astropy.convolution.utils.discretize_model):
  • 'center' (default)

    Discretize model by taking the value at the center of the bin.

  • 'linear_interp'

    Discretize model by linearly interpolating between the values at the corners of the bin. For 2D models interpolation is bilinear.

  • 'oversample'

    Discretize model by taking the average on an oversampled grid.

  • 'integrate'

    Discretize model by integrating the model over the bin using scipy.integrate.quad. Very slow.

centertuple

(x, y) Coordinate of the center of the image (in pixels). The origin of the image is defined as origin = center - floor_divide(size, 2) (i.e the image will range from (origin -> origin + size)). If None, the origin of the image is assumed to be at (0, 0) (i.e center = floor_divide(size, 2)).

vminfloat

Min plot value

vmaxfloat

Max plot value

cbarbool

Show color-bar if True.

fontsizeint

Font size of labels.

figsizetuple

Figure size, should be (3*size, size).

flux_labelstr

Label for color-bar.

Returns:
axs, cbar, model_image, residual_image(array of axes.Axes, cbar, array, array)