CPlotView:PlotImageCol


The PlotImageCol method plots the pixel values along an image column, as a function of y-axis position.

Syntax

CPlot = CPlotView:PlotImageCol( CImage, x, y1, y2, sTitle, sCap, bWcs=false )

bullet.gif    CImage specifies the image to plot.

bullet.gif    x value specifies the column number, beginning at 1.

bullet.gif    y1 is the minimum y (row) number to plot, beginning at 1

bullet.gif    y2 is the maximum y (row) number to plot, beginning at 1.

bullet.gif    sTitle is a string for the Plot window title.

bullet.gif    sCap is a string for the plot caption.

bullet.gif    bWcs is true if the plot is to use world coordinates if a calibration exists. If omitted, it defaults to false.

Return value:

bullet.gif    CPlot is a new CPlot object attached to the current plot series. It is nil on failure.

Remarks

This method creates a graph of luminance value versus row number for the specified image column. The image coordinates are specified in pixel coordinates even if the plot is to be made using world coordinates (the bUseWcs argument). The x, y1, and y2 arguments specify column and row positions, indexed with the first pixel at 1. If you need to plot from an image position in world coordinates, use the WcsToXy method to convert x, y1, or y2 before calling PlotImageCol.

Examples

Example 1: Assume that a CImage I exists. The following script plots column 150 from row 300 through row 499. World Coordinates units are not plotted, since the bWcs value is not specified:

V = new_plotview()

-- create a CPlotView

x = 150 ; y1 = 300 ; y2 = 499

-- define the column and rows to plot

sTitle = "My Plot"

-- title

sCap = "Column Plot"

-- caption

V:PlotImageCol( I, x, y1, y2, sTitle, sCap )

-- plot the column

Example 2: Suppose an astronomical image is the current image and that it has an equatorial form of world coordinate calibration. The following script 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): 

V = new_plotview()

-- create a CPlotView

sT = "My Plot"

-- title

sC = "Column Plot"

-- caption

sRa = "5:20:13.54"

-- set the center coordinate (right ascension)

sDec = "-12:15:20.4"

-- set the center coordinate (right ascension)

x, y = I:WcsToXy(sRA,sDec)

-- position the image cursor

if x >= 1 and x <= I:Cols() then

-- check if x inside image

  y1 = math.max(1,y-100)

-- make y1 inside the image

  y2 = math.min(I:Rows(),y+100)

-- make y2 inside the image

  V:PlotImageCol(I,x,y1,y2,sT,sC,true)

-- plot the column

end

 

Related Topics

CPlotView class, PlotImageRow, Image Coordinate System, Subpixel Coordinate Definition

 

Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.