CPlotView:PlotCursorColAvg CPlotView:PlotImageCol

CPlotView:PlotCursorCol


The PlotCursorCol method plots the pixel values in the column at the center of the image cursor on a displayed image. This plots the pixel value as a function of y-axis position measured in pixel coordinates.

Syntax

CPlotView:PlotCursorCol( CImageView )

    CImageView is a reference to the class object where the image is displayed.

Remarks

This method works with an image displayed in a CImageView. It creates a graph of luminance value versus row number for one column passing through the center of the image cursor. The number of rows plotted (i.e., the plot length) is defined by the cursor height. If the cursor rectangle is used to define the center position in pixel coordinates, then the central row is calculated as y = (ymin + ymax) / 2. The cursor region can be set using the SetCursorRect method or the cursor can be positioned using SetCursorPos or SetCursorPosWcs.

Example

Assume that a CImageView object named V exists. The following script fragment plots column 150 over a length of 200 pixels (rows 300:499) for the current image of the image set:

V:SetPlotAvgMode(1)

-- set the averaging method to 1 (median)

R = CRect:new()

-- create a CRect object

R:Set(100,200,300,499)

-- specify the region to plot

V:SetCursorRect(R)

-- assign the CRect to the cursor

P = CPlotView:new()

-- create a CPlotView object

P:PlotCursorCol(V)

-- make the plot

Alternatively, suppose an astronomical image is the current image and that it has an equatorial form of world coordinate calibration. The following script fragment plots the image luminance at coordinate (5:20:13.54,-12:15:20.4), over 100 pixels long and aligned in the column (vertical) direction. Since this fragment plots 200 rows, the cursor's column extent is unimportant and we need only to set the number of rows (height):

sRa = "5:20:13.54"

-- set the first coordinate (right ascension)

sDec = "-12:15:20.4"

-- set the second coordinate (right ascension)

V:SetCursorPosWcs(sRA,sDec)

-- position the image cursor

V:SetCursorHeight(200)

-- set the cursor height, in pixels

P = CPlotView:new()

-- create a CPlotView

P:PlotCursorCol( V )

-- plot the column at the center of the cursor

Related Topics

CPlotView, CImageView, SetCursorRect, SetCursorPosWcs, PlotCursorRow, Image Coordinate System, Subpixel Coordinate Definition