Program: SPLINEFIT Purpose: Fit spline to data in selected subses and interpolate data for other subsets Category: FITTING, MANIPULATION File: splinefit.c Author: M.G.R. Vogelaar Keywords: INSET= Give set, subsets: Maximum number of subsets is 2048. (e.g. INSET=AURORA FREQ) BOX= Give box in ..... [entire subset] SPLINESET= Give (same) input set and subsets which set the spline data: Enter the same set as in INSET=, but specify now the subsets which contains the spline control points. The calculated spline always will go through these control points. (e.g. SPLINESET=AURORA FREQ -10 0 10 15) SORDER= Number of intervals to calculate average Y for control point: [0] If another value than the default is selected, then the program will sub divide a profile in SORDER= intervals and in each interval an average Y is calculated which (with the central X) forms one spline control point. The effect will be a smoothing of data. OUTSET= Give output set (, subsets): Output set and subset(s) for the result. The number of output subsets is the same as the number of input sub- sets. INGRIDS= X values of profile in grids: Y/[N] In most cases you want to transform the X values in your profiles to physical values (e.g. grids along frequency axis to km/s). Default the conversion is done if the header defines such a transformation. To override the default and work in grids only, you should select 'Y'. PLOT= Plot all the profiles in the box: Y/[N] Each profile is plotted together with the spline control points and the calculated spline. PLOTMINMAX= Enter min, max in Y for profile plots: [min,max] If a plot is wanted, the values for DATAMIN and DATAMAX are read from the header of the input set. These values are the default min, max in de prompt. The values are used to set the range in Y for the plots. GRDEVICE= Plot device: [List of devices] Destination of plot, Screen or Hardcopy. ** 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: [default by application] 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] ** PGFONT= Give font 1..4: [2] 1 single stroke 'normal' font 2 roman font 3 italic font 4 script font Description: This program can serve as a template for programs that process profiles. It avoids the confusing syntax for so called class 2 programs. It tries to read, as efficient as possible, profile data, manipulates the data and writes the result to an output set. This program uses a sample of profile points (given with SPLINESET=) and calculates the cubic spline through these points. The other points in the profile are interpolated using this spline and written to the output set. If you subtract the result (OUTSET=) from the input (INSET=) then you should see no residuals in those subsets that were selected to define the spline control points. Note that you can only fit missing subsets that are between the first and last subset with spline controls. The program is straightforward and easy to expand. It can easily be extended with other functions that process the profile data (e.g. polynomial fit). 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 22, 2006: VOG, Document created.