helper functions


uvotpy.uvotplot.Ellipse(xxx_todo_changeme, xxx_todo_changeme1, angle=0.0, resolution=200, **kwargs)

plot an ellipse using an N-sided polygon


(x,y) : float

centre ellipse

(rx,ry) : float

half axis ellipse

angle : float

angle in units of degrees

resolution : int

determines number of points to use

and additional kwargs for pyplot.plot()


uvotpy.uvotplot.binplot(*args, **kwargs)

Bin up the arrays with the keyword bin=<number> Same parameters as used by plot (pyplot)


uvotpy.uvotplot.contourpk(x, y, f, levels=None, xb=None, xe=None, yb=None, ye=None, s=60, kx=1, ky=1, dolabels=True, **kwargs)

Make a contour plot with 1-D array inputs for X, Y and F. This is a wrapper to convert lists of points (X,Y,Z) in 2-D arrays, then calls contour()


X, Y: ndarrays[:], 1D on a 2D plane

coordinates X, Y

Z : ndarray[:], 1D function on X,Y


uvotpy.uvotplot.maskEllipse(maskimg, x, y, a, b, theta, test=0, chatter=1)

update a mask excluding ellipse region


maskimg : ndarray, 2D, bool

boolean array to aplly mask to (i.e., numpy.ones( array([200,400]),dtype=bool) )

x,y : int, float

ellipse center coordinate x,y

a,b : float

ellipse major axis a; minor axis b;

theta : float

rotation angle theta counterclockwise in deg.


maskimg with all pixels inside the ellipse are set to False


uvotpy.uvotplot.plot_ellipsoid_regions(Xim, Yim, Xa, Yb, Thet, b2mag, matched, ondetector, img_pivot, img_pivot_ori, img_size, limitMag, img_angle=0.0, lmap=False, makeplot=True, color='k', annulusmag=13.0, ax=None, chatter=1)

This routine is to plot ellipsoid regions on the grism image/graph, which may be a rotated, cropped part of the detector image

Returns:None or boolean map image, plots an ellipse on the current figure


uvotpy.uvotplot.waveAccPlot(wave_obs, pix_obs, wave_zmx, pix_zmx, disp_coef, obsid=None, acc=None, order=None, wheelpos=200, figureno=1, legloc=[1, 2])

Plots of the accuracy of the wavelength solution from zemax compared to the observed wavelengths.


wave_obs, pix_obs : ndarray

observed wavelengths points (green circles)

wave_zmx ,pix_zmx : ndarray

calculated zemax points (or the interpolated solution (red crosses)

disp_coef : ndarray

dispersion coefficients

disp_coef : list

coefficients in reverse order: if p is of length N, this the polynomial

is as follows for coeff named p:

y(x) = p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]

kwargs : dict

  • acc : accuracy in wavelength
  • order : order of polynomial disp_coef (default len(coef) )
  • obsid : if given, append to title


Figure description

x-axis : pix - pixel number referenced to [260nm in first order]

Top panel only

y-axis: lambda - lambda_linear

linear term in the dispersion a linear term is fit to the wavelengths

$lambda_{lin}$ = coef[0]+coef[1]*pix

Bottom panel only

y-axis: residuals

wave_obs, pix_obs - wave(pix_obs) (green circles) wave_zmx, pix_zmx - wave(pix_zmx) (red crosses)