Reserach Support Services

Home » Research » Research Support Services » Facilities » Surface Science and Photoelectron Spectroscopy » WinFp Version Updates and Programming Notes

WinFp Version Updates and Programming Notes

Revised August 30, 2004


GENERAL PROGRAMMING NOTES HERE

INSTALLATION NOTES HERE


Changes for version 0_015 of WinFp...

1. Major changes in display algorithms. Learned to use the following command sequence:


Public RefreshRegion As System.Drawing.Rectangle
.
.
RefreshRegion = New Rectangle(DrawLeft + CursorLeft, DrawDown + _
CursorDown, CursorWidth, CursorHeight)
Me.Invalidate(RefreshRegion)
Me.Update()


RefreshRegion is a rectangle that is used to define the only region of the screen deplay that is repainted by the invalidate command. The me.Update line executes the display.

This is used to much advantage to only refresh regions of the screen that  change with an action. At this point it is used to keep from refreshing the plot border and energy tics except when updating the entire display.  Also, clicking the mouse cursor just erases the previous cursor from the screen and draws the new cursor on the screen.

2. Screen background set to bitmap image with white color under data display region so that screen does not flicker on every me.invalidate command that repaints that area. The key instruction after setting up the bitmap is:


' Set up the background image for the screen so that it is the same color as the
' data display area.
objBackgroundDisplay = New Bitmap(DisplayRectangle.Width, DisplayRectangle.Height)
objBackgroundGraphics = Graphics.FromImage(objBackgroundDisplay)
objBackgroundGraphics.Clear(System.Drawing.SystemColors.Control)
' Clear the data display area to a color.
objBackgroundGraphics.FillRectangle(System.Drawing.Brushes.White, DrawLeft + 1, DrawDown + 1, DrawWidth - 1, DrawHeight - 1)
'objGraphics.FillRectangle(System.Drawing.SystemBrushes.Control, 1, 1, DrawWidth - 1, DrawHeight - 1)
' Draw a single line boder on the data display
objBackgroundGraphics.FillRectangle(System.Drawing.Brushes.Black, DrawLeft, DrawDown, DrawWidth, 1)
objBackgroundGraphics.FillRectangle(System.Drawing.Brushes.Black, DrawLeft, DrawDown, 1, DrawHeight)
objBackgroundGraphics.FillRectangle(System.Drawing.Brushes.Black, DrawLeft, DrawDown + DrawHeight, DrawWidth, 1)
objBackgroundGraphics.FillRectangle(System.Drawing.Brushes.Black, DrawLeft + DrawWidth, DrawDown, 1, DrawHeight)

Me.BackgroundImage = objBackgroundDisplay



Changes for version 0_014 of WinFp...

2004_08_21_01

1. Initial bitmap graphics in memory programmed by setting object definition of the memory bitmap that I named objDataDisplay to "new bitmap" and assigning it to objGraphics.

2004_08_21_02

2. All initialization actions have been moved to the 'Load' event. Go to this subroutine by clicking on "vclsCollection Events" in the left address bar of the code window and then clicking on "Load" in the right address bar. It is no longer necessary to open the section " Windows Form Designer generated code " in code.

3. Draw counter added to check if the screen is being redrawn too many times for a given action.

2004_08_22_01

4. Problem of adding peak immediately after switching tab regions, and not having the data display updated to show the new peaks, corrected by adding a line to btnAddPeak(clicked) routine to let the program know that an action is taking place subsequent to switching tabs.

2004_08_22_02

5. In order for editing of points to work, had to add code to "DrawEditPointRed" to initialize objGraphics with a line of the form:
objGraphics = Graphics.FromImage(objDataDisplay)
Also added this line to "DrawCursor" and the following line to both routines.
Me.Invalidate()
It seems that objgraphics has to reloaded in every routine that uses a different kind of drawing object - but this is not certain. There may be other problems.

2004_08_23_01

6. Program can now read and write to the same filename again and again.


Changes for version 0_013 of WinFp...

2004_08_20_02

1. Handling of asymmetry limits is changed.
Asymmetry limits are treated as a peak attribute similar to the peak parameter attributes of fixes, boundaries, and constraints. The default low and high asymmetry limits are given to the first peak added to a region. Subsequent peaks that are added are given the attributes of the previous peak. The low and high asymmetry limits for a peak are changed in a panel that can be added to the 'Peaks' display with the 'Select Peaks Panels' option in the 'View' drop-down menu. The limit value is activated upon hitting the 'Enter' key after inserting the number. If desired, the low and high asymmetry limits of all peaks in a region are changed to the same values with a button option on the same panel.

The attributes of a parameter control the values that are allowed to be set by the user and the values that are allowed in the optimization of  the fit. Occasionally the attributes become in conflict, and in these  cases there is a hierarchy in which attribute takes control. The rules  are as follows:
1. If a parameter value is fixed, it is not allowed to change from the value input by the user.
2. Otherwise constraints are utilized during the optimization process.
3. If a parameter value moves outside the boundary limits, the parameter value is set to the nearest boundary value, and the parameter value is  fixed.
4. If the parameter is not fixed and it is not constrained to another value, and the asymmetry of the peak moves outside the asymmetry limits, the value of the high halfwidth of the peak is adjusted to the nearest asymmetry limit value.

2004_08_20_03

The property of the main window has been set so that a scroll bar will not appear.


Changes for version 0_012 of WinFp...

2003_10_29_01

1. Option added for selecting which Peaks panels are displayed.  Sometimes too much information is on the screen when adding peaks and fitting the data.  Under the 'View' drop-down menu is an option 'Select Peaks Panels'.  Selecting this option brings up a panel that allows you to take Peaks panels off the display, put panels back on the display, or reorder the panels on the display according to the order in which they are added to the view.

2003_11_01_01

2. Left/right scroll bar allowed when panels extend beyond the screen.

2004_08_18_01

3. Corrections on asymmetry initializations for moving regions made in routines btnAddSpectra and FromRegionToRegionPeaks. This corrects problems with these initializations when adding spectra and when moving data to and from the scratch region, which resulted in high halfwidths being set to zero when initializing peak parameters.


Changes for version 0_011 of WinFp...

2003_10_25_1

1. 'Delete Current Peak' moved from 'Actions on All Peaks' menu to 'Peaks' button panel to left of data display.

2003_10_25_4

2. 'Scale/Shift/Broaden All Peaks' option on the 'Collective Actions on Peaks' menu. Panel also appears on 'Subtract Peaks' task.

Scaling Peaks Panel
What it can be used for:
When peaks are brought in from another region, the amplitudes can easily be scaled (all by the same scale factor) to visually match the intensity of the new data. An example is bringing in peaks from a full region fit for beta subtraction of data collected in a close-up region.
How it works and what the program does:
Three methods to scale:
a. Using Cursor to scale:
    Click set a cursor marker at a point at which you want the peaks sum line to pass through. It is best to pick a point near the position of a peak.
    Click the + button on the scaling panel.
    The peak amplitudes will be scaled so that the sum passes through the cursor marker point.
b. Manual scaling:
    Type a value other than 1.0 in the scaling value box.
Type 'Enter'
    The peak amplitudes are multiplied by the value you typed. The value in the box is set back to 1.0.
c. Step up/down buttons on number box.
    The peak amplitudes are increased/decreased by 0.2%.
Alternative method of scaling all peaks.
See 'Set All Peaks Scaling Constraints'.

Shift Peaks Panel:
What it can be used for:
Shifting the position of all of the peaks the same amount. It might help setting up consistent fits of related molecules. This should NOT be used to correct for different energy scales due to different calibrations, such as sometimes occurs between He I and He II data of the same molecule. The 'Shift Data Energy' panel should be used.
How it works and what the program does:
Three methods to shift:
a. Using cursor to shift:
    Click set a cursor marker at a point at which you want a peak to shift.
    Click the + button on the shift panel.
  The program finds the peak closest to the cursor marker position and shifts that peak to that position. All other peaks are shifted by the same amount.
b. Manual scaling:
    Type a value other than 0.0 in the scaling value box.
    Type 'Enter'
    The peak are shifted by the value you typed. The value in the box is set back to 0.0.
c. Step up/down buttons on number box.
    The peak positions are increased/decreased by 0.001 eV.

Change Widths Panel:
What it can be used for:
Adds a constant value to the low and high halfwidths of every peak.
He II data is often collected at poorer resolution than He I data.
When using He I fit peaks to model He II data, the poorer resolution of the He II data may be noticeable. This routine can be used to consistently add width to the He I peaks.
How it works and what the program does:
Type a value other than 0.0 in the 'Change Widths' box. Type 'Enter'. Click the 'Add' or 'Subtract' button.
All peak widths are changed by the amount in the box. Constraint conditions on the widths, if they exist, are then reapplied. Reapplication of width constraints may not be completely appropriate in all circumstances.
If the purpose is to use He I peaks to fit He II data, all width constraints on the He I peaks should first be removed before broadening the peaks. The 'Set He II Constraints' can then be applied after broadening the peaks and before optimizing the fit of the He II data.

3. Menus rearranged.

2003_10_26_01

4. Setting the cursor marker position.
Most functions in WinFp act on the position of the cursor marker.
Clicking anywhere in the data display region sets the marker. The energy and counts of the marker are displayed on the panels next to the data display.
Alternatively, the cursor marker can be set by typing energy and counts values in the display boxes (typing 'Enter' after entry). The up/down buttons on the number boxes move the energy/counts up/down by one screen pixel position at a time.

2003_10_26_02

5. Warning if screen width becomes too small has been inserted.

2003_10_28_02

6. Setting default asymmetry conditions for regions that have no peaks has been corrected.

7. All asymmetry conditions are now written to the region file when there are peaks. The program still reads region files that do not have the peak asymmetry conditions written in, and in this case it estimates limits based on the asymmetries of the peaks in the files.


Changes for version 0_010 of WinFp...

2003_09_17_1

1. The 'Store' and 'Retrieve' buttons and the routine for copying peaks between regions have been updated to carry along the asymmetry conditions.

2003_09_17_2

2. A file menu option has been added to import peak parameters from .PEK files.

3. Some data files from the original programs may contain numbers in exponential notation (for example 0.318E-3). This format is not supported by WinFp. Files should be scanned for such numbers and edited to have only normal real numbers. A future version of WinFp will have code to deal with this format.


Changes for version 0_009 of WinFp...

2003_08_29_1

1. Icons for desktop and start menu changed.

2003_08_29_2

2. Refresh of analyzer sensitivity correction line incorporated and panel made invisible if another option is selected while it is on the screen.

2003_08_29_3

3. 'Take Peaks From Region' option removed. 'Store Current Peaks' and 'Retrieve From Store' will be used exclusively for transferring peaks between regions. This way the user will be sure to see the region from which the peaks are taken.

4. 'Subtract Peaks' function is simplified to deal only with shifting, scaling, and subtracting peaks. All work on peaks except the final shift of all peaks and scaling is done under the other menus.  Button options are restricted to avoid complicated sequences and to ensure that the logfile correctly records the final change in the data.

5. Under 'Actions On Peaks' an option has been added to set fixes and contraints that allow the intensities of all peaks to scale together while not allowing any other parameter to change. That is, only the amplitude of peak 1 is allowed to change and all other peak amplitudes maintain the same relative amplitudes to peak 1. Halfwidths of peak 1 are fixed and the halfwidths of other peaks are constrained to their current values (relative to the values of peak 1). This option is called 'Set All Peak Scaling Constraints'. This is useful when taking peaks from another region to be used for satellite subtractions, and the absolute intensities of all the peaks need to be scaled together to the new data region while maintaining all other relative features.

6. Update of the display and list of the peak parameters when retrieving peaks from the store has been added.

7. The routines for peak subtracting, baseline subtracting, and energy shifting can be exited only by completing the routines. This restriction ensures that the actions in these routines are recorded in the log file. A message is given when an attempt is made to open another menu option before completing these routines.

8. Install changed so that previous versions do not need to be uninstalled.


Changes for version 0.007 of WinFp...

1. 'Group Peaks' panel retains values that are entered and brings back 'Peaks' panels when completed.

2. Setup and deployment created as part of project, icon added.  Setup puts an icon on the desktop and the program on the start menu. Visual,net support libraries are obtained automatically across the internet.

3. Error on reading in .rgn files with extremely large high halfwidths corrected (Tonja-detected problem).

4. When writing the HPG plot file, the program offers the name of the region (or the name of the first region if it is a stack plot) with the .hpg extension appended to the name.  The offered name can be changed.

5. Errors in HPG plot file corrected (detected by Tonja, Asha, and Nadine).
a. spurious lines in stacked plots when baselines omitted is corrected.
b. peaks are again separate objects, as are total sum and baseline. Each can be selected separately in presentations.

6. Summary of peak values in the .rgn file corrected for listing amplitude fixes and constraints (Asha detected problem).

7. 'View' of current peak values on screen updated more automatically.

8. The energies of the data points may now be shifted. This may be helpful in lining up HeII spectra with HeI spectra when the calibrations are slightly different, or lining up spectra that have been collected with different retarding voltages, or comparing shifts of ionizations. The menu item 'Shift Data Energies' is in the 'Edit Data' list. The option acts on the region that is displayed when the option is selected. If the data is copied to the scratch area (region 0) first and the option is selected on this region, the region 0 data will be overlayed on the other tab regions when they are selected.  Shifts may stepped in either direction by a selected amount on the shift region. If this is region 0 the shifts may also be viewed by the overlay on any other tab region. When satisfied with the shift there is a 'Keep' button that records the shift on the region logfile and exits the shift routine. The 'Discard' button returns the data to the original energies and exits the shift routine.

9. The 'Help' option currently opens the PES facility web page with Internet Explorer. The 'About Help' option allows you to set the location of your browser and the address of the web page that is opened.

10. There is a simple 'About WinFp' option in the 'Help' menu.

11. 'Baseline Subtract' option added to the 'Edit Data' menu. This can be used to view the residual of fit after the peaks have been subtracted from the data, and can be used to improve (fudge) the appearance of data that is sitting on a rapidly rising baseline. It should not be used before the intensity correction. When the 'Keep' button is selected a record of the subtracted baseline in placed in the region's logfile and the baseline is then set to zero.

12. When subtracting peaks, the display now rescales to show all the new data in the window, including negative values.

13. Display features have been improved when switching between regions with the the 'Edit Baseline' panel open.
 


Changes for version 0.006 of WinFp...

1. Closing the program now asks if you have saved all the files you want. You must answer 'yes' before the program closes.

2. The tab line now expands or contracts with the size of the screen. The change in size is activated when the cursor clicks on the drawing region and refreshes the display.

3. Keyboard options are provided for most of the menu items. Some menu items have been renamed to avoid conflicts and there have been some reorganizations.

4. When adding spectra, the 'keep' button has been disabled until you actually have added some spectra.

5. The optimization routine has been improved.
a. A problem that sometimes occured on starting optimization was identified. This may be the root of many or all of the occurences of parameters jumping to strange values.
b. If a guess by the optimization routine does not improve the fit because parameter changes are too large, the routine tries again with smaller changes in the parameters (doubles the damping, done invisible to the user). It tries this five times before telling you that it could not find better parameters. If the fit does not look satisfactory it is probably caught in a local minimum and you have to give it a better initial guess to get to another local minimum.

6. Improved control of the asymmetry of peaks is provided. It is important that this functionality be understood. Limits on the asymmetry, as defined by the Width High divided by the Width Low, are set on a panel in the middle of the peak options. The default values are set so that at the default minimum asymmetry value (1.0) the peak is symmetric and at default maximum (4.0) the Width High is four times the Width Low. These limits can be changed individually for each peak or globally for all peaks on this panel. Setting a minimum asymmetry value less that one means the peak is allowed to be more broad on the low ionization energy side than on the high. When peak parameters are set up, these asymmetry limits are observed by adjusting the Width High if necessary. If the optimization routines try to set the Width High outside these limits with respect to Width Low, the optimization routines will constrain the Width High to the Width Low by the limiting value. These limits only function if the Width High is not already constrained to some parameter or if it is fixed, either by the user or by hitting a bound in optimization.

7. A button has been provided on the left column of the 'Peaks' panels to quickly free all parameters of constraints and fixes.

8. Setting constraints manually and updating the display as constraints are manually changed has been improved. There is considerable change of code for setting up constraints, so let me know if you detect any problems. A parameter may now be constrained to another parameter that is itself constrained to still another parameter. This allows setting up a series or group of parameters that are serially related by constraints. The only condition is that the last parameter in the series must not be constrained to another parameter (logical, otherwise it is not the last in the series). Another way of stating this condition is that the series can not be circular. Examples of circular series are (1) a parameter constrained back to itself, (2) a parameter constrained to a second parameter that is constrained back to the first parameter, (3) a parameter constrained to a second parameter that is constrained to a third parameter that is constrained back to the first parameter, and so on. When the program detects a circular series of constraints a message will appear showing you the members of the series and telling you to correct it.

9. Under 'Actions on Peaks' a new option has been added to quickly 'group' a set of peaks for constraints. This is particularly useful for fitting vibrational fine structure or hot bonds. It allows you to select a group of peaks to have all the same high widths and the same low widths. You also have an option to set a constant separation (vibrational frequency) between the peaks, and an option to have the peaks maintain the same relative amplitudes that you start them with (i.e. Franck-Condon factors for vibrational structure, Boltzman populations for hot bands). The peak of the group that is at lowest energy is the base peak, and the parameters of the other peaks in the group are constrained to the parameters of the base peak as directed.


Changes for version 0.005 of WinFp...

1. Editing Points.
a. More control has been provided for the y scale when editing points.
b. The problem of the selected edit point continuing to be highlighted when the routine is exited abnormally has been corrected.

2. Plotting spectra.
a. Plot preview has been made wider on the edges for tic labels - has no effect on hpg files.
b. Improved setting of aspect ratio for plots.
c. Problem of minor tic marks being too long when the energy scale ends with minor tic marks has been corrected.
d. Problem of losing the Ionization Energy label in plot preview when the axis ends with minor tics has been corrected - hpg files had no such problem.

3. Tab regions
a. Behavior of tab display improved when closing regions - no longer flickers through the regions.
b. Option added on File menu to close selected regions in addition to just the display region or all regions - choosing the option gives a list of regions to multiple select.
b. Tab regions now numbered as well as labeled to help when working with large numbers of regions.

4. Saving and retrieving regions.
a. An occasional problem with the formatting of very large numbers in saved files is corrected.
b. Option added on the File menu to save selected regions in addition to just the display region or all regions
- choosing the option gives a list of regions to multiple select.

5. Display refreshing.
a. The problem of the display refreshing multiple times when baseline parameters are changed has been corrected.