Program: PROFGLOB Purpose: Interactive estimation of width of global profile. (No fitting involed) Category: ANALYSIS, PLOTTING, PROFILES File: profglob.c Author: M.G.R. Vogelaar Keywords: GRDEVICE= Plot device: [list of all graphics devices] Destination of plot, Screen or Hardcopy. XARRAY= Give values along X: Input from file, table, image or recall file. The X values will be sorted by the program in increasing order. SEE EXAMPLES ! YARRAY= Give # values for Y: # is the number of values entered with XARRAY= SEE EXAMPLES ! EYARRAY= Give one or more values for errors in Y: [no errors] Pressing carriage return will exclude the possibility to plot error bars and the calculation of errors in the estimated profile width. Otherwise you can read error data from file, table or image. If you enter less than the number in XARRAY= then the remaining values are copied from the last one entered. Negative values are converted to positive values. SEE EXAMPLES ! WLEVEL= Give W-level (0-100): [20] Max. numbers that you are allowed to enter is 2. This value sets the height at which the profile width is measured at positions using maxima entered by XPOS= or entered with the interactive cursor. The heights are with respect to ZEROLEVEL= ZEROLEVEL= Give zero level: [0.0] W-levels are taken with respect to this value. XUNITS= Give units of X axis: [?] Input is a text that will be plotted along the X-axis. YUNITS= Give units of Y axis: [?] Input is a text that will be plotted along the Y-axis. The program creates a table where, besides the estimated width, also the profile area is listed. The units of the area are XUNITS= * YUNITS= FILENAME= Write results to file with name: [do not store] The results of the program will be listed in a table in the log file. This table can also be written to an ASCII file on disk. The file name will be FILENAME= OVERWRITE= File exists, overwrite? Y/[N] If the file in FILENAME= already exists, you are prompted with this keyword. If you press 'N', then you are re-prompted with FILENAME= to enter a new name. XPOS= Give x position(s) of maximum: [calculated] Maximum number of X values is 2. If you know the positions of a maximum (or the maxima) beforehand, it is possible to enter it here. Q= Give smoothing parameter: [calculated] The smoothing parameter is used in calculating the second derivative of the profile when the program searches gaussian components in a profile. The estimates for the positions of maxima is used to calculate default values for XPOS= if the profile has more than one peak. NPTS= Give number of points to calculate pos. of max: [5] Allow program to find a better estimate of the maximum (or the maxima) by examining NPTS= neighbour points to the left and NPTS= points to the right. INTERACT= Determine positions of maxima manually? Y/[N] If you are not satisfied with the defaults of XPOS= as suggested by the program, enter new values with the interactive cursor. Fix a position with the LEFT mouse button. Redraw and reset with the RIGHT button and continue with keyboard key 'Q' or 'q'. PLOTTING: ======== ** PGMOSAIC= View surface sub divisions in x,y: [1,1] View surface can contain a number of plots in in X and Y direction (mosaic). Default is 1 plot in both X- and Y direction. ** PGPAPER= Give width(cm), aspect ratio: [calc, calc] Aspect ratio is height/width. ** PGBOX= Corners of box Xl,Yl,Xh,Yh: [calculated] It is possible to overrule the calculated PGPLOT box size with PGBOX=. The coordinates (x,y) of the lower point are given first. ** PGCOLOR= Give color 1..15: [1] See description for the available colors. ** PGWIDTH= Give line width 1..21: [2] ** PGHEIGHT= Give character height: [1.0] Character height as a multiple of the default height. ** PGFONT= Give font 1..4: [2] 1 single stroke 'normal' font 2 roman font 3 italic font 4 script font Examples: INPUT OF ARRAY DATA =================== The input of the array data follows the rules of input of floating point numbers. Probably you want to use one of the database or file functions 'table', 'image', 'file'. FILE ==== Syntax for reading from file: keyword=file(filename,column,rows) and the syntax for 'rows' is as for recall files. ex.1: XARRAY=file(profile.txt,2,3:20) reads from ASCII file profile.txt the second column. It starts reading at row 1 and it wil read until line 20 is read. ex.2: XARRAY=file(profile.txt,2,1:) reads from ASCII file profile.txt the second column. It starts reading at row 1 and it will read until the end of that column. IMAGE ===== Syntax for reading image data: keyword=image(set, box) 'set' is the set/subset specification as known from the INSET= keywords. 'box' sets the limits as in the BOX= keywords. Suppose we have a 2-dim RA/DEC GIPSY set called 'profset', then: ex.3: YARRAY=image(profset dec 0, -14 15) reads profile data in the RA direction at DEC=0. It starts reading at RA=-14 and it stops reading image data after RA=15 TABLE ===== Syntax for reading data from a table: keyword=table(set, tab, col, rows) 'set' is the set/subset specification as known from the INSET= keywords. 'tab' is the name og the GDS table, 'col' is the name of a column in that table and rows indicate the rows in that column. Set 'profset' has a table called 'tab1'. This table has two columns named 'X' and 'Y': ex.4: XARRAY=table(profset,tab1,X,1:39) reads row 1 to 39 from column 'X' from table 'tab1' in set 'profset'. Description: PROFGLOB is a program that can assist you in estimating the width of a global profile. The profile will be plotted and defaults for the position of a maximum (or the maxima) will be calculated and plotted. If you are not satisfied with these defaults then you can enter positions manually using the interactive cursor (INTERACT=Y). At the so called W-level, a horizontal line will intersect the XPOS= vertical line (that indicates the position of the maximum) and the profile. The intersections with the profile determine the estimated width of the profile. Also the estimated errors in the width will be plotted. Results are listed in a table in the GIPSY log file or in an ASCII file on disk (FILENAME=). Here is a recipe how the errors are calculated: The horizontal line through WLEVEL= and XPOS= crosses the profile at certain X. Find the nearest (in X) data point. Use its error to construct two new horizontal lines (through Y+/-Yerr) that crosses the profile at two new values of X. Determine for each position the interval to which it belongs and get the left (or) right end point of that interval. Repeat it for the other X value. These points have also a corresponding error. If you connect the upper and lower Y values of these two points, two lines will emerge. The intersection of these two lines with the WLEVEL= line gives two X values of which the difference is a measure of the wanted error. If these actions are applied to the left and right side of the profile, then you get two error widths, say ew1 and ew2. The estimated error in the width will be: 0.5*SQRT(ew1^2+ew2^2). The table that is created looks like: W-level | width +/- error | velocity | area ..| =============================================================== 20 | 107.96 +/- 4.1269 | 717.977 | 4433.36 ..| Color indices: 0 Background 1 Default (Black if background is white) 2 Red 3 Green 4 Blue 5 Cyan 6 Magenta 7 Yellow 8 Orange 9 Green + Yellow 10 Green + Cyan 11 Blue + Cyan 12 Blue + Magenta 13 Red + Magenta 14 Dark Gray 15 Light Gray 16-255 Undefined Available fonts: 1 single stroke "normal" font 2 roman font 3 italic font 4 script font Notes: ....... Example: Updates: May 30, 1995: VOG, Document created.