pdspy.plotting

plotting.plot_1D_visibilities

pdspy.plotting.plot_1D_visibilities(visibilities, model, parameters, params, index=0, fig=None, plot_disk=False, color='k', markersize=8, linewidth=1, line_color='g', disk_only_color='gray', fontsize='medium')

Plot the 1D azimuthally averaged visibility data along with the specified model.

Args:
visibilities (dict):

Dictionary containing the visibility data, typically as loaded by utils.load_config and utils.load_data.

model (modeling.Model):

The radiative transfer model that you would like to plot the visibilities of. Typically this is the output of modeling.run_disk_model.

parameters (dict):

The parameters dictionary in the config module as loaded in by utils.load_config

params (dict):

The parameters of the model, typically as a dictionary mapping parameter keys from the parameters dictionary to their values.

index (int, optional):

The visibilities dictionary typically contains a list of datasets. index indicates which one to plot.

fig (tuple, (matplotlib.Figure, matplotlib.Axes), optional):

If you’ve already created a figure and axes to put the plot in, you can supply them here. Otherwise, plot_1D_visibilities will generate them for you. Default: None

plot_disk (bool, optional):

Should plot_1D_visibilities show the disk-only contribution to the model? Default: False

color (str, optional):

The color to use for plotting the visibility data. Default: “k”

markersize (int, optional):

The size of the markers to use for plotting the visibility data. Default: 8

linewidth (int, optional):

What linewidth to use for plotting the model. Default: 1

line_color (str, optional):

The color to use for plotting the model visibilities. Default: “g”

disk_only_color (str, optional):

The color to use for plotting the disk-only model visibilities. Default: “gray”

fontsize (str or int):

What fontsize to use for labels, ticks, etc. Default: “medium”

Returns:
fig (matplotlib.Figure):

The matplotlib figure that was used for the plot.

ax (matplotlib.Axes):

The matplotlib axes that were used for the plot.

plotting.plot_continuum_image

pdspy.plotting.plot_continuum_image(visibilities, model, parameters, params, index=0, fig=None, cmap='jet', fontsize='medium', image='data', contours='model', model_image='beam-convolve', weighting='robust', robust=2, maxiter=200, threshold=0.001, uvtaper=None, cmap_contours='none', colors_contours='none', levels=None, negative_levels=None, show_beam=False, beamxy=(0.1, 0.1), show_colorbar=False, cax=None, colorbar_location='right', colorbar_orientation='vertical', colorbar_size='5%', colorbar_pad=0.05, units='Jy/beam')

Plot the millimeter continuum image, along with the best fit model.

Args:
visibilities (dict):

Dictionary containing the visibility data, typically as loaded by utils.load_config and utils.load_data.

model (modeling.Model):

The radiative transfer model that you would like to plot the visibilities of. Typically this is the output of modeling.run_disk_model.

parameters (dict):

The parameters dictionary in the config module as loaded in by utils.load_config

params (dict):

The parameters of the model, typically as a dictionary mapping parameter keys from the parameters dictionary to their values.

index (int, optional):

The visibilities dictionary typically contains a list of datasets. index indicates which one to plot.

fig (tuple, (matplotlib.Figure, matplotlib.Axes), optional):

If you’ve already created a figure and axes to put the plot in, you can supply them here. Otherwise, plot_1D_visibilities will generate them for you. Default: None

image (str, optional):

Should the image show the “data”, “model”, or “residuals”. Default: “data”

contours (str, optional):

Should the image show the “data”, “model”, or “residuals”. Or could also not show contours with “none”. Default: “model”

model_image (str, optional):

Should the model image be made by convolving a radiatie transfer generated image with an estimate of the beam (“beam-convolve”), or by generating model visibilities at the correct baselines of the data and then using interferometry.clean to generate an image (“CLEAN”). Default: “beam-convolve”

weighting (str, optional):

What weighting scheme should the model image use if model_image="CLEAN", “natural”, “robust”, or “uniform”. Default:”robust”

robust (int, optional):

The robust parameter when weighting="robust". Default: 2

maxiter (int, optional):

The maximum number of CLEAN iterations to perform. Default: 2

threshold (float, optional, Jy):

The stopping threshold for the CLEAN algorithm. Default: 0.001 Jy

uvtaper (float, optional, lambda):

FWHM of the Gaussian tapering to apply to the weights when running CLEAN. Default: None

cmap (str, optional):

Which colormap to use for plotting the image. Default: “jet”

cmap_contours (str, optional):

Colormap to use for the contours. If “none”, use the same as cmap. Default: “none”

colors_contours (str or list-like, optional):

Colors to use for the contours. If “none”, use the "cmap" from the image. Default: “none”

levels (list of float, optional):

The flux levels at which to plot contours. If None, use [0.1, 0.3, 0.5, 0.7, 0.9] x image.max(). Default: None

negative_levels (list of float, optional):

A list of negative flux levels at which to plot dashed contours. Default: None

show_beam (bool, optional):

Should the plot show the size of the beam? Default: False

beamxy (tuple, optional):

If show_beam=True, where should the beam be placed in the image, in units of axes fraction. Default: (0.1,0.1)

show_colorbar (bool, optional):

Should the plot show a colorbar for the image? Default: False

cax (matplotlib.Axes, optional):

Pass an existing Axes class to use for the colorbar. If None, plot_continuum_image will generate a new one. Default:None

colorbar_location (str, optional):

Should the colorbar be located to the “right” of the image or on “top” of the image. Default: ‘right’

colorbar_size (str, optional):

The percent width of the image Axes that should be used for the width of the colorbar Axes. Default: ‘5%’

colorbar_pad (str, optional):

How much padding should there be between the image Axes and the colorbar Axes. Default: 0.05

units (str, optional):

What units should the colorbar use? Options include “Jy/beam”, “mJy/beam”, and “uJy/beam”. Default: “Jy/beam”

fontsize (str or int):

What fontsize to use for labels, ticks, etc. Default: “medium”

Returns:
fig (matplotlib.Figure):

The matplotlib figure that was used for the plot.

ax (matplotlib.Axes):

The matplotlib axes that were used for the plot.

cax (matplotlib.Axes, optional):

The matplotlib axes that were used for the colorbar, if show_colorbar=True.

plotting.plot_channel_maps

pdspy.plotting.plot_channel_maps(visibilities, model, parameters, params, index=0, plot_vis=False, fig=None, image='data', contours='model', model_image='beam-convolve', maxiter=100, threshold=1.0, uvtaper=None, weighting='natural', robust=2.0, vmin=None, vmax=None, levels=None, negative_levels=None, image_cmap='viridis', contours_colors=None, fontsize='medium', show_velocity=True, show_beam=True, vis_color='b', vis_model_color='g', show_xlabel=True, show_ylabel=True, skip=0, auto_center_velocity=False, v_width=10.0, beamxy=(0.15, 0.15), show_colorbar=False, cax=None, colorbar_location='right', colorbar_orientation='vertical', colorbar_size='10%', colorbar_pad=0.01, units='Jy/beam', vis_marker='o')

Plot the millimeter channel maps, along with the best fit model.

Args:
visibilities (dict):

Dictionary containing the visibility data, typically as loaded by utils.load_config and utils.load_data.

model (modeling.Model):

The radiative transfer model that you would like to plot the visibilities of. Typically this is the output of modeling.run_disk_model.

parameters (dict):

The parameters dictionary in the config module as loaded in by utils.load_config

params (dict):

The parameters of the model, typically as a dictionary mapping parameter keys from the parameters dictionary to their values.

index (int, optional):

The visibilities dictionary typically contains a list of datasets. index indicates which one to plot.

plot_vis (bool, optional):

If True, plot the azimuthally averaged visibilities instead of images. Defautl: False

fig (tuple, (matplotlib.Figure, matplotlib.Axes), optional):

If you’ve already created a figure and axes to put the plot in, you can supply them here. Otherwise, plot_channel_maps will generate them for you. It will use visibilities["nrows"][index] rows and visibilities["ncols"][index] columns. Default: None

image (str, optional):

Should the image show the “data”, “model”, or “residuals”. Default: “data”

contours (str, optional):

Should the image show the “data”, “model”, or “residuals”. Or could also not show contours with “none”. Default: “model”

model_image (str, optional):

Should the model image be made by convolving a radiatie transfer generated image with an estimate of the beam (“beam-convolve”), or by generating model visibilities at the correct baselines of the data and then using interferometry.clean to generate an image (“CLEAN”). Default: “beam-convolve”

weighting (str, optional):

What weighting scheme should the model image use if model_image="CLEAN", “natural”, “robust”, or “uniform”. Default:”robust”

robust (int, optional):

The robust parameter when weighting="robust". Default: 2

maxiter (int, optional):

The maximum number of CLEAN iterations to perform. Default: 2

threshold (float, optional, Jy):

The stopping threshold for the CLEAN algorithm. Default: 0.001 Jy

uvtaper (float, optional, lambda):

FWHM of the Gaussian tapering to apply to the weights when running CLEAN. Default: None

image_cmap (str, optional):

Which colormap to use for plotting the image. Default: “jet”

colors_contours (str or list-like, optional):

Colors to use for the contours. If None, use the default colormap. Default: None

levels (list of float, optional):

The flux levels at which to plot contours. If None, use [0.1, 0.3, 0.5, 0.7, 0.9] x image.max(). Default: None

negative_levels (list of float, optional):

A list of negative flux levels at which to plot dashed contours. Default: None

show_beam (bool, optional):

Should the plot show the size of the beam? Default: False

beamxy (tuple, optional):

If show_beam=True, where should the beam be placed in the image, in units of axes fraction. Default: (0.1,0.1)

show_colorbar (bool, optional):

Should the plot show a colorbar for the image? Default: False

cax (matplotlib.Axes, optional):

Pass an existing Axes class to use for the colorbar. If None, plot_continuum_image will generate a new one. Default:None

colorbar_location (str, optional):

Should the colorbar be located to the “right” of the image or on “top” of the image. Default: ‘right’

colorbar_size (str, optional):

The percent width of the image Axes that should be used for the width of the colorbar Axes. Default: ‘5%’

colorbar_pad (str, optional):

How much padding should there be between the image Axes and the colorbar Axes. Default: 0.05

units (str, optional):

What units should the colorbar use? Options include “Jy/beam”, “mJy/beam”, and “uJy/beam”. Default: “Jy/beam”

show_velocity (bool, optional):

Label each channel with the velocity of that channel? Default: True

vis_marker (str, optional)

If plot_vis=True, the marker to use to plot the visibility data. Default: “o”

vis_color (str, optional)

If plot_vis=True, the color to use to plot the visibility data. Default: “b”

vis_model_color (str, optional)

If plot_vis=True, the color to use to plot the visibility model. Default: “g”

show_xlabel (bool, optional)

Show ticks and axes labels on the x-axis? Default: True

show_ylabel (bool, optional)

Show ticks and axes labels on the y-axis? Default: True

skip (int, optional)

The number of channels to skip between each panel of the plot. Default: 0

auto_center_velocity (bool, optional)

Automatically center the velocities within the number of plot panels provided. Default: False

v_width (float, optional)

If auto_center_velocity=True, the width of the line that you want to show in the channel maps. skip will be automatically determined based on the number of Axes provided. Default: 10., kms

fontsize (str or int):

What fontsize to use for labels, ticks, etc. Default: “medium”

Returns:
fig (matplotlib.Figure):

The matplotlib figure that was used for the plot.

ax (matplotlib.Axes):

The matplotlib axes that were used for the plot.

cax (matplotlib.Axes, optional):

The matplotlib axes that were used for the colorbar, if show_colorbar=True.

plotting.plot_SED

pdspy.plotting.plot_SED(spectra, model, SED=False, fig=None, model_color='g', linewidth=1, fontsize='medium')

Plot the SED generated by a radiative transfer modeling run with pdspy, typically generated by the output of modeling.run_disk_model.

Args:
spectra (list):

List of Spectrum objects with data for the object you are studying.

model (modeling.Model):

The radiative transfer model that you would like to plot the SED of. The Model.spectra dictionary must include a “SED” key. Typically this is the output of modeling.run_disk_model.

SED (bool, optional):

Whether to plot as a traditional SED (True), i.e. as \(\nu F_{\nu}\), or as a spectrum, i.e. \(F_{\nu}\). Default: False

fig (tuple, (matplotlib.Figure, matplotlib.Axes), optional):

If you’ve already created a figure and axes to put the plot in, you can supply them here. Otherwise, plot_SED will generate them for you. Default: None

model_color (str, optional):

The color to use for plotting the model SED. Default: “g”

linewidth (int, optional):

What linewidth to use for plotting the model. Default: 1

fontsize (str or int):

What fontsize to use for labels, ticks, etc. Default: “medium”

Returns:
fig (matplotlib.Figure):

The matplotlib figure that was used for the plot.

ax (matplotlib.Axes):

The matplotlib axes that were used for the plot.

plotting.plot_pvdiagram

pdspy.plotting.plot_pvdiagram(visibilities, model, parameters, params, index=0, plot_vis=False, image='data', contours='model', model_image='beam-convolve', maxiter=100, threshold=1.0, uvtaper=None, weighting='natural', robust=2.0, length=100, width=9, image_cmap='Blues', levels=None, fontsize='medium', fig=None, ignore_velocities=None, curve_masses=[0.2, 0.5, 1.0])

Plot the millimeter channel maps, along with the best fit model.

Args:
visibilities (dict):

Dictionary containing the visibility data, typically as loaded by utils.load_config and utils.load_data.

model (modeling.Model):

The radiative transfer model that you would like to plot the visibilities of. Typically this is the output of modeling.run_disk_model.

parameters (dict):

The parameters dictionary in the config module as loaded in by utils.load_config

params (dict):

The parameters of the model, typically as a dictionary mapping parameter keys from the parameters dictionary to their values.

index (int, optional):

The visibilities dictionary typically contains a list of datasets. index indicates which one to plot.

fig (tuple, (matplotlib.Figure, matplotlib.Axes), optional):

If you’ve already created a figure and axes to put the plot in, you can supply them here. Otherwise, plot_channel_maps will generate them for you. It will use visibilities["nrows"][index] rows and visibilities["ncols"][index] columns. Default: None

image (str, optional):

Should the image show the “data”, “model”, or “residuals”. Default: “data”

contours (str, optional):

Should the image show the “data”, “model”, or “residuals”. Or could also not show contours with “none”. Default: “model”

model_image (str, optional):

Should the model image be made by convolving a radiatie transfer generated image with an estimate of the beam (“beam-convolve”), or by generating model visibilities at the correct baselines of the data and then using interferometry.clean to generate an image (“CLEAN”). Default: “beam-convolve”

weighting (str, optional):

What weighting scheme should the model image use if model_image="CLEAN", “natural”, “robust”, or “uniform”. Default:”robust”

robust (int, optional):

The robust parameter when weighting="robust". Default: 2

maxiter (int, optional):

The maximum number of CLEAN iterations to perform. Default: 2

threshold (float, optional, Jy):

The stopping threshold for the CLEAN algorithm. Default: 0.001 Jy

uvtaper (float, optional, lambda):

FWHM of the Gaussian tapering to apply to the weights when running CLEAN. Default: None

length (int, optional):

Length of the box, in pixels, to use to extract the PV diagram. Default: 100

width (int, optional):

Width of the box, in pixels, to use to extract the PV diagram. Default: 100

image_cmap (str, optional):

Which colormap to use for plotting the image. Default: “Blues”

levels (list of float, optional):

The flux levels at which to plot contours. If None, use [0.1, 0.3, 0.5, 0.7, 0.9] x image.max(). Default: None

fontsize (str or int):

What fontsize to use for labels, ticks, etc. Default: “medium”

Returns:
fig (matplotlib.Figure):

The matplotlib figure that was used for the plot.

ax (matplotlib.Axes):

The matplotlib axes that were used for the plot.

cax (matplotlib.Axes, optional):

The matplotlib axes that were used for the colorbar, if show_colorbar=True.