vasca.visualization

Visualization related methods for VASCA

Module Contents

Functions

plot_sky_sources

Plot the selected sources and (optinally) the visit detections on the sky.

plot_field_sky_map

Plot the reference sky map.

plot_region_sky_gnomeview

Plot the nr visits and optionally (selected) sources (optinally) on the sky.

plot_region_sky_mollview

Plot the nr visits, fields or exposure on the sky. Coverage table has to be previously created with region.add_coverage_hp.

plot_table_hist

Plot histogram for passed astropy.table.Table and variable

scatter_hist

plot_table_scatter

Plot scatter plot for passed astropy.table.Table and variables

plot_pipe_diagnostic

Diagnotic plots for VASCA pipe

plot_light_curves

Plot the light curves of the passed sources.

plot_light_curve

Plots light curve

plot_lombscargle

Runs and plots Lomb Scargle diagram

plot_sed

Plots spectral energy distribution

API

vasca.visualization.plot_sky_sources(tt_src, tt_det=None, only_selected=True, ax=None, src_id='rg_src_id', sky_region_wcs=None, draw_labels=True, src_kwargs=None, det_kwargs=None)[source]

Plot the selected sources and (optinally) the visit detections on the sky.

tt_srcastropy.table.Table

Source list to plot. Has to contain “ra”, “dec” and srd id columns.

tt_detastropy.table.Table, optional

Detection list to plot. Has to contain “ra”, “dec” and src_id columns. Default is None.

only_selected: bool, optional

Show only selected sources. tt_src must have a “sel” column. default is True.

axaxes, optional

Matplotlib axes to plot on. The default is None.

src_id: str, optional

Write the source ID next to its marker, saved in the passed column name, typically “rg_src_id”, “fd_src_id” or None. Default is “”rg_src_id””

sky_region_wcs: (regions.SkyRegion, WCS) , optional

Plot only sources within the sky region. A WCS has to be passed along ina tuple. Default is None.

draw_labelsbool, optional

Draw labels next to sources showing “src_iud” entry. The default is True.

src_kwargsdict, optional

Keyword arguments for pyplot.plot of the sources. The default is None.

det_kwargsdict, optional

Keyword arguments for pyplot.patches.Polygon of the detections. The default is None.

matplotlib.axes

Used Matplotlib axes.

astropy.table.Table

Sources plotted from tt_src

vasca.visualization.plot_field_sky_map(field, fig=None, ax=None, img_idx=-1, sky_region=None, **img_kwargs)[source]

Plot the reference sky map.

field: vasca.BaseField

VASCA field to be plotted.

fig: figure, optional

Matplotlib figure to draw on, if None a new figure is created. The default is None.

axaxes, optional

Matplotlib axes to plot on. The default is None.

img_idxint, optional

Index nr of the visit in the tt_visits table. If -1 is passed the reference image is shown. Default is -1.

sky_region: regions.SkyRegion , optional

Plot only within the sky region. The field WCS will be used Default is None.

**img_kwargsdict

Key word arguments for pyplot.imshow plotting.

matplotlib.figure

Matplotlib figure used to draw

matplotlib.graph.AxesImage

Matplotlib axes of 2D image.

vasca.visualization.plot_region_sky_gnomeview(region, ra, dec, sel_srcs=True, gw_kwargs=None, ps_kwargs=None)[source]

Plot the nr visits and optionally (selected) sources (optinally) on the sky.

regionvasca.region.Region

Region for which is plotted.

rafloat

RA of the center of the sky figure.

dec: float

DEC of the center of the sky figure.

sel_srcsbool, optional

Show only selected sources. The default is True.

gw_kwargsdict, optional

Keyword arguments for healpy.gnomview. The default is None.

ps_kwargsdict, optional

Keyword arguments for healpy.projscatter. The default is None.

matplotlib.axes

Used Matplotlib axes.

vasca.visualization.plot_region_sky_mollview(region, var='nr_vis', mw_kwargs=None)[source]

Plot the nr visits, fields or exposure on the sky. Coverage table has to be previously created with region.add_coverage_hp.

regionvasca.region.Region

Region for which is plotted.

coordstr

Coordinate system, Galactic or ICKS

var: str

Variable to plot, exposure “exp”, visits “nr_vis” or or fields “nr_fds”

mw_kwargsdict, optional

Keyword arguments for healpy.mollview. The default is None.

matplotlib.axes

Used Matplotlib axes.

vasca.visualization.plot_table_hist(tt, var, ax=None, logx=False, obs_filter_id=None, **hist_kwargs)[source]

Plot histogram for passed astropy.table.Table and variable

ttastropy.table.Table

Table containing a column with the plotted variable.

varstr, optional

Variable name

axmatplotlib.axes, optional

Axes to draw on. The default is None.

logxbool, optional

Histogram of log10(var) instead of var. The default is False.

obs_filter_id: int, optional

Observation filter ID Nr., if None all filters are shown. THe default is None.

**hist_kwargsdict

Key word arguments passed tu plt.hist

matplotlib.axes

Axes that where used to draw.

list of float

Histogram bin values.

list of float

Histogram bins, default is [selected, all] events.

vasca.visualization.scatter_hist(x, y, ax, ax_histx, ax_histy)[source]
vasca.visualization.plot_table_scatter(tt, varx, vary, ax=None, xlim=None, ylim=None, invert_xaxis=None, invert_yaxis=None, xscale='linear', yscale='linear', obs_filter_id=None, grp_var='sel', grp_vals=None, add_projection=False, **scatter_kwargs)[source]

Plot scatter plot for passed astropy.table.Table and variables

ttastropy.table.Table

Table containing columns with the plotted variables.

varxstr

Variable name on X-axis

varystr

Variable name on Y-axis

axmatplotlib.axes, optional

Axes to draw on. The default is None.

xlimlist, optional

List with [xmin, xmax] axis value. Default is None.

ylimlist, optional

List with [ymin, ymax] axis value. Default is None.

xscalestr, optional

Type of x-scale (“log”, “linear”). Default is “linear”.

yscalestr, optional

Type of y-scale (“log”, “linear”). Default is “linear”.

obs_filter_id: int, optional

Observation filter ID Nr., if None all filters are shown. The default is None.

grp_var: str, optional

Group scatter plot by colors based on this table variable. The default is “sel”. If None is passed no groups will be done.

add_projection: bool, optional

Add histogram with projection on the sides

**plot_kwargsdict

Key word arguments passed tu plt.plot

axmatplotlix.axes

Axes that where used to draw.

vasca.visualization.plot_pipe_diagnostic(tc, table_name, plot_type, fig_size=(12, 8), obs_filter_id=None)[source]

Diagnotic plots for VASCA pipe

tcvasca.TableCollection

Table collection, either field or region

table_namestr

Name of the table, tt_detections or tt_sources

plot_typestr

Type of plot, either “hist” or “scatter”

fig_size: (float,float)

Matplotlib figure (x,y) size in inches.

obs_filter_id: int, optional

Observation filter ID. Default is None.

matplotlib.figure

Figure used for plotting

dict

Dictionary with plot variables keys and plot settings values

vasca.visualization.plot_light_curves(tc, fd_src_ids=None, rg_src_ids=None, fig=None, ax=None, ylim=None, plot_upper_limits=True, flux_var='flux', **errorbar_kwargs)[source]

Plot the light curves of the passed sources.

tcVASCA.table.TableCollection

Either field, region or source that contains the light curves.

fd_src_idslist or int

List or single field source IDs to plot. Default is None.

rg_src_idslist or int

List or single region source IDs to plot. Default is None.

fig: figure, optional

Matplotlib figure to draw on, if None a new figure is created. The default is None.

axaxes, optional

Matplotlib axes to plot on. The default is None.

ylimlist, optional

Limits of the y axis. Default is None

plot_upper_limitsbool

Plot upper limits to the lightcurve. The default is True.

flux_var: str, optional

Variable in table to be used to get flux Jy

**errorbar_kwargsdict

Key word arguments for pyplot.errorbars plotting.

matplotlib.figure

Matplotlib figure used to draw

matplotlib.axes

Used Matplotlib axes.

vasca.visualization.plot_light_curve(tc_src, fig=None, ax=None, show_gphoton=True, add_axes=True, **errorbar_kwargs)[source]

Plots light curve

tc_src: vasca.TableCollection

Table collection containing tt_sed table.

fig: figure, optional

Matplotlib figure to draw on, if None a new figure is created. The default is None.

axaxes, optional

Matplotlib axes to plot on. The default is None.

show_gphoton: bool, optional

Show gphoton light curve too, if present in table collection?. The default is True.

add_axes: bool, optional

Add additional x- and y-axis on the empty sides

**errorbar_kwargsdict

Key word arguments for pyplot.errorbars plotting.

matplotlib.figure

Matplotlib figure used to draw

matplotlib.axes

Used Matplotlib axes.

vasca.visualization.plot_lombscargle(tt_lc, fig=None, ax=None, ax_phase=None, ax_lc=None, obs_filter='NUV', nbins_min=10, logy=False, freq_range=[0.03, 2] / uu.d, plot_dtbins=True)[source]

Runs and plots Lomb Scargle diagram

tc_src: vasca.TableCollection

Table collection containing tt_sed table.

fig: figure, optional

Matplotlib figure to draw on, if None a new figure is created. The default is None.

axaxes, optional

Matplotlib axes to plot LombScargle diagram on. The default is None.

ax_lcaxes, optional

Matplotlib axes to plot with the light curve to plot peak frequency model on. The default is None.

ax_phaseaxes, optional

Matplotlib axes to plot phase diagram. The default is None.

obs_filterstr, optional

Observational filter to perform LombScargle on. The default is “NUV”

nbins_minint, optional

Minimum number of time bins to perform LombScargle. The default is 20.

logybool, optional

Plot LombScargle diagram in log(Power). The default is True.

freq_rangelist

Minimum and maximum Frequency. If None calculated automatically.

matplotlib.figure

Matplotlib figure used to draw

matplotlib.axes

Used Matplotlib axes.

dict

Lomb Scargle results

vasca.visualization.plot_sed(tc_src, fig=None, ax=None, plot_spec_lines=False, plot_spec=False, **errorbar_kwargs)[source]

Plots spectral energy distribution

tc_src: vasca.TableCollection

Table collection containing tt_sed table.

fig: figure, optional

Matplotlib figure to draw on, if None a new figure is created. The default is None.

axaxes, optional

Matplotlib axes to plot on. The default is None.

plot_spec_lines: bool

Plot typical spectral lines in White Dwarfs. The default is False.

plot_spec: bool

Plot typical spectral lines in White Dwarfs. The default is False.

**errorbar_kwargsdict

Key word arguments for pyplot.errorbars plotting.

matplotlib.figure

Matplotlib figure used to draw

matplotlib.axes

Used Matplotlib axes.

dict

Dictionary with fit information