Skip to content

Reducing the number of configurations in a lens file

Question

I have a multi-configuration lens in OSLO and I want to save one of the configurations as a separate single-configuration OSLO file. How can I do that?

Synopsis

Reducing the number of configurations in a lens file

Workaround

You can reduce the number of configurations (zoom positions) in any lens file by going to the top of the OSLO Surface Data Spreadsheet and reducing the maximum number of zoom positions (for example if the to of the spreadsheet says "Zoom 1 of 3", you can change it to read "Zoom 1 of 2" or "Zoom 1 of 1"). Note that when you do this, the configurations are deleted in reverse order (from highest to lowest). In the example given above changing the cells of the spreadsheet to read "Zoom 1 of 2" means that the 3rd configuration will be deleted. Note that as of OSLO 6.3, there is no way to change the maximum configuration number via a command line function. However, this is a feature request that we hope to address in a future release of OSLO. OSLO 6.3.1 will adds the capability of deleting the information in an individual configuration, however, the configuration itself will not be removed or deleted from the lens. This latter issue is also a feature request that we hope to address in a future release of OSLO.

Solution

The method that must be used to save one configuration of a lens model involves some manoeuvring with the saved lens file and the internal OSLO text editor: (Note that a method to perform this function as a simple menu option will be addressed in a future release of OSLO):
  1. Save the lens as a regular OSLO lens file
  2. Un-zoom the lens by changing the "Zoom 1 of X" designation at the top of the Surface Data Spreadsheet, to read "Zoom 1 of 1".
  3. Close the Surface Data Spreadsheet (Click on the Green checkmark in the upper left corner of the window) ...but do not save the lens file!
  4. Open the saved lens file (*.len or *.osl) using the OSLO text editor ("Window>>Editor>>Open"). In the "Open Text File" dialog, you will have to set the "Files of Type" setting to the "Text files (*.*)" option. Note that you will be opening the lens file that you just saved while the lens was still defined with multi-configurations.
  5. Locate the section of the file that specifies the multi-configuration section of the lens. It should begin with "CFG NEW" and end with "END".
  6. Copy this section of the file to the MS Windows clipboard
  7. Select "File>>New" from the OSLO Text Editor menu
  8. Paste the configuration data from the MS Windows clipboard into the blank OSLO Text Editor window.
  9. As an example, the text may look similar to the following: CFG NEW TH 2 2 12.0 AD 5 2 0.000345 TH 2 3 18.0 AD 5 3 0.000678 END
  10. The 3rd piece of data in each line refers to the configuration or zoom number. Delete all lines that do not relate the configuration number you are interested in.
  11. Delete the "CFG NEW" and "END" lines as well.
  12. In our example, the data should now look like the following if you are interested in saving the 2nd configuration: TH 2 2 12.0 AD 5 2 0.000345
  13. Now delete the 3rd piece of data in each line (the configuration number) and add a semicolon at the end of each line.
  14. Our example now looks like: TH 2 12.0; AD 5 0.000345;
  15. Select all the lines in the OSLO Text Editor and choose "Edit>>Execute Selection" from the OSLO Text Editor menu. Note that the Surface Data Spreadsheet should still be closed from a previous step in order for this step to always work properly.
  16. Now open the Surface Data Spreadsheet and you should note that the lens has changed to define only your desired configuration.
  17. Feel free to save the lens under a new name "File>>Save Lens As..."