|
|
|
|
SynopsisConverts a point from one ChIPS coordinate system to another. Syntaxconvert_coordinate(point [,input coordinate] [,output coordinate] [,axis]); Description
The convert_coordinate command converts a point from one ChIPS coordinate system into another. The conversion can be performed between any coordinate systems which have been created. For example, the value of a point in data system coordinates can be converted to the data system from a different plot. The input and output coordinate systems are specified as an enumerated type, a string, or a ChipsId. If no system is given, the current coordinate system is used. The allowed enumerated types include PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM or DATA; see "ahelp coordsys" for more information. If a string is supplied, it should be the name of a data system. The command will look for the specified data system in the current plot. Alternatively, a ChipsId can be supplied to specify the coordinate system from any window, frame or plot. The output of this command is the input point value(s) represented in the specified output coordinate system. If the input is a single value, a single value will be returned. Otherwise a coordinate pair will be returned. Example 1chips> add_window (360, 360, "pixels"); chips> print (convert_coordinate ([180,180], PIXEL, WINDOW_NORM)); chips> print (convert_coordinate ([.5,.5], WINDOW_NORM)); Add a window which is 360x360 pixels; the default coordinate system for a window is always pixels). Convert the point (180,180) pixels into window normalized coordinates; the result should be (.5,.5). Then convert (.5,.5) from window normalize coordinates into the current coordinate system. Example 2
chips> id = ChipsId;
chips> add_curve (id,[1,2,6,7],[6,13,2,6],"line.color=green");
chips> split (2);
chips> current_plot ("plot2");
chips> x = [0:10];
chips> y = x^3;
chips> add_curve (x,y);
chips> x = convert_coordinate (6, id,DATA, X_AXIS);
chips> add_vline (x);Create two plots each with its own curve. Convert the value "6", which is associated with the x-axis, from the data coordinates of the first plot to the data coordinates of the second plot. Store the returned value and use it to create a vertical line in the second plot. Example 3chips> add_curve ([1,2,6,7],[6,13,2,6],"line.color=cyan"); chips> pnt = convert_coordinate ([2,13], NULL, PLOT_NORM); chips> id = ChipsId; chips> id.coord_sys = PLOT_NORM; chips> add_point (id, pnt[0], pnt[1], "color=red"); chips> limits (X_AXIS, 0,8); Create a curve and use convert_coordinate to determine where the point (2,13) is in plot normalized coordinates. A NULL value was passed in for the input coordinate. This provided a means of not having to explicitly set the input coordinate. The input coordinate defaults to the current coordinate system, which is the current data coordinate system. Store the returned value and use it to create a point in plot normalized coordinates. BugsSee the bugs pages on the ChIPS website for an up-to-date listing of known bugs. |
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |