Plotting routines for CASA simulations

This module provides several routines to plot results from CASA simulations.
This module is supposed to be used together with
read_casasim
Reads in the Casa simulation with name L001ALMA_NN and plots the line cube and
the integrated line emission. The output is in pdf (in the file
L001.pdf
)
import
prodimopy.observables.read_casasim
as
preadc
import
prodimopy.observables.plot_casasim
as
pplotc
from
matplotlib.backends.backend_pdf
import
PdfPages
data
=
preadc
.
CasaSim
(
"L001ALMA_NN"
)
with
PdfPages
(
"L001.pdf"
)
as
pdf
:
pc
=
pplotc
.
PlotCasasim
(
pdf
)
pc
.
plot_cube
(
data
.
cube
,
nrows
=
5
,
ncol
=
5
)
pc
.
plot_integrated
(
data
.
integrated
)
class
prodimopy.observables.plot_casasim.
PlotCasasim
(
pdf
,
labelspacing
=
1.0
)
[source]

Bases:
object
Plot routines for casa simulation results.
This class can be used together with
prodimoy.read_casasim
Parameters
:
pdf
(class:
matplotlib.backends.backend_pdf.PdfPages
) – this object is used to save the plots in a pdf file.
labelspacing
(
int
) – the spacing for the x and y labels in images in arcseconds.
i.e. 1 weans there will be an x(y) tick every 1 arcsec
add_beam
(
ax
,
image
,
color
=
'white'
)
[source]

adds a beam to a plot (axis).
Parameters
:
ax
(class:
matplotlib.axes.Axes
) – the axis for which the beam should be added
image
(class:
~prodimopy.read_casasim.CASAImage
) – some kind of image (can also be a cube)
FIXME
(
is proberly not general yet
)
plot_cube
(
cube
,
nrow
=
3
,
ncol
=
3
,
cvel_idx
=
None
,
step
=
1
,
zlim
=
[None,
None]
,
rms
=
False
,
mJy
=
False
,
zlog
=
False
,
powerNormGamma
=
None
,
cb_format
=
'%5.1f'
,
cb_fraction
=
0.015
,
cb_pad
=
0.005
,
cb_extend
=
'neither'
,
cmap
=
'inferno'
,
vellabel_fontsize
=
5
,
vellabel_pos
=
[0.95,
0.95]
,
clevels
=
None
,
ccolors
=
None
,
zoomto
=
None
,
idxchans
=
None
,
framecolor
=
'white'
,
fig
=
None
,
axes
=
None
,
beam_color
=
'white'
,
**
kwargs
)
[source]

Plots a spectral line cube.
Parameters
:
zoomto
(
float
) – this parameters allows to zoom into the image. The unit is in arcsec.
E.g. zoomto=1.0 will show the region around the the center ranging
from -1.0 to 1.0 arcsec for the x and y axis.
It is also possible to provide two values e.g. zoomto=[1.5,1] - region
-1.5 to 1.0 arcsec for the x and -1.5 to 1.0 for the y axis.
chans
array_like(int,ndim=1)
list if indices for the channels (velocities) that should be shown.
the correspoding images will be shown in the given order starting from
top left - to bottom right.
vellabel_pos
array_like(float,ndim=1)
Postition of the velocity label in the image. Default: [0.95,0.95], which is top right.
plot_integrated_diff
(
imageObs
,
imageModel
,
imageDiff
,
zlim
=
[None,
None]
,
mJy
=
False
,
zoomto
=
None
,
**
kwargs
)
[source]

Plots an image and its diff Model-Obs.
Parameters
:
zoomto
(
float
) – this parameters allows to zoom into the image. The unit is in arcsec.
E.g. zoomto=1.0 will show the region around the the center ranging
from -1.0 to 1.0 arcsec for the x and y axis.
plot_integrated
(
image
,
zlim
=
[None,
None]
,
mJy
=
False
,
cb_format
=
'%5.1f'
,
cb_show
=
True
,
cmap
=
'inferno'
,
clabel
=
None
,
zoomto
=
None
,
clevels
=
None
,
ccolors
=
None
,
cb_fraction
=
0.04
,
zlog
=
False
,
powerNormGamma
=
None
,
showBeam
=
True
,
cb_pad
=
0.02
,
cb_extend
=
'neither'
,
ax
=
None
,
**
kwargs
)
[source]

Plots a zeroth moment image (integrated intensity) image.
Parameters
:
zoomto
(
float
) – this parameters allows to zoom into the image. The unit is in arcsec.
E.g. zoomto=1.0 will show the region around the the center ranging
from -1.0 to 1.0 arcsec for the x and y axis.
ax
(
Axes
) – An matplotlic Axes object that is used to make the plot. if ‘None’ an new one will be created.
plot_mom1_diff
(
imageObs
,
imageModel
,
imageDiff
,
zlim
=
[None,
None]
,
zoomto
=
None
,
**
kwargs
)
[source]

Plots the moment 1 observations , model and the difference map.
Parameters
:
zoomto
(
float
) – this parameters allows to zoom into the image. The unit is in arcsec.
E.g. zoomto=1.0 will show the region around the the center ranging
from -1.0 to 1.0 arcsec for the x and y axis.
plot_mom1
(
image
,
zlim
=
[None,
None]
,
zoomto
=
None
,
cb_extend
=
'neither'
,
**
kwargs
)
[source]

Plots the momement 1 map.
Parameters
:
zoomto
(
float
) – this parameters allows to zoom into the image. The unit is in arcsec.
E.g. zoomto=1.0 will show the region around the the center ranging
from -1.0 to 1.0 arcsec for the x and y axis.
Todo
if zoomto estimate vmin/vmax from that region only
plot_pv
(
image
,
zlim
=
[None,
None]
,
ylim
=
[None,
None]
,
mJy
=
False
,
**
kwargs
)
[source]

Plots a position-velocity diagram.
Todo
it is not possible to set the xlim (offset) coordinate in arcsec. Requires likely the conversion form pix to arcsec or vice versa
plot_specprof
(
specprof
,
models
=
None
,
xlim
=
[None,
None]
,
modelNames
=
None
,
**
kwargs
)
[source]

Plots a spectral profile (histogram style).
plot_radprof
(
radprof
,
models
=
None
,
modelNames
=
None
,
pmGrayBox
=
0.25
,
**
kwargs
)
[source]

Plots a radial profile.
specprof_xy_hist
(
specprof
)
[source]

Produce x,y coordinates to plot spectral profile in histogram style.