Technical Issues - FilmStar News 2017 Other editions:
2006, 2007, 2008,
2009, 2010,
2011, 2012 January 16 Photopic Response Curves A user requested an
automatic way to plot photopic transmittance as a function of wavelength.
This is readily accomplished manually in Excel, but tedious. Our
solution combines the FilmStar Workbook, FilmStar BASIC and the
FSPlot Module. It works as well for photopic reflectance. PhotopicPlot.bas >>>
C:\Winfilm\Basic32 Referring to Setup...Parameters, we utilize Transmittance vs. Wavelength Range. This allows us to set graph range 350-800 even though CIE calculations are 380-780. The example uses CIE 1931 values (1 nm interval) and is easily modified. Users requiring help with FilmStar BASIC or Workbook should contact FTG Software. January 17 Auto-Optimize in Workbook
Here's a simple illustrative example. Download AutoWbOpti.zip; unzip and copy as follows (assuming default directories). AutoWbOpti.bas >>>
C:\Winfilm\Basic32
You should get a similar graph after clicking <Ctrl+Z> for Zoom Mode. Changing the Workbook Macro from CALCULATE; ($D$1) to something like BasExec x=5; gives the BASIC Conflict message. The Workbook may be the most challenging module in FilmStar; users are invited to contact FTG Software for an online run-through via ZOOM. January 20 Zero Layers
As shown above, there is a great difference in the spectra when 14 layers (including a massive 1 mm Si substrate) are deleted. But as Zoom Mode shows below, the spectrum at short wavelengths is not affected by the removal, thus verifying the algorithm.
Previous versions failed when Side 2 Compensation <> FWD ignore Side 2. That is still the case, but now Zero Layers automatically changes Side 2 Compensation if necessary, thereby eliminating error messages. Substrates should be treated as massive layers; designs with parentheses are not supported. Most users will never require Zero Layers, but those that do consider it to be a very important capability. February 23 MEASURE (Scantraq) Saving Two File Types A user requested the ability to automatically save spectra in two formats. Click here to download BASIC code that does the job. Copy to your C:\Winfilm\Basic32 directory. In order to automatically save scans, enter the following in the Setup.. Scan Macros editor. Substitute Scantraq for Winfilm as required.
When there is no Scan Macros editor, as is the case for instruments such as Ocean Optics or FTIR, the code is specified at the end of the Sample Scan macro in the Control Macros dialog (part of the Setup.. Scan Method sequence). Sub Main .... .... BasChain "C:\Winfilm\Basic32\Save_CSV&SPC.bas" End Sub You can also enter the following in Tools.. Macro Commands, in this case assigning to Macro Button 4.
March 6 Identifying Bad Data Measuring %R/%T for a fused silica substrate seems easy, but maybe not! A user, intending to deduce n&k vs. wavelength, sent us data collected with a PerkinElmer Lambda 1050 with a goniometer accessory and UV Winlab software. As this is a well-known material, expected values are easy to calculate. Comparing theory (SiO2 Sopra.itw) and measurements in FSPlot's View.. Zoom Mode <Ctrl+Z>, we note problems from 300-400 and 800-900 nm. There is no better way to identify bad data. Such comparison will be difficult (impossible??) in UV Winlab.
Transmittance results were disappointedly similar. Was integration time (scan speed) optimal? Was the tungsten lamp aligned properly, stabilized, and not approaching burnout? Operator error? 0% baseline compensation? Would FilmStar smoothing help? This includes the ability to smooth before normalization, thereby minimizing noise. That would not, however, improve 300-400 and 800-900 nm regions. Reasonable n&k results from 400-800 nm were deduced with INDEX Calculate n,k Algorithm #4.
Failure to examine data before hitting <Calculate> often leads to wasted hours, frustration, and possible crashes. If in doubt, send us your data (in one Excel file please). We note, however, that the accuracy required for n&k analysis typically exceeds that required for QA pass/fail specifications. When plotted on a 0-100% scale the above spectra give a different impression. March 20 Preserving Design Format
Since solutions based on Notepad or Word/Excel may be inconvenient, 2.61.3980 adds a new option to the Groups editor: Edit...Lock Design. In this mode designs can be edited and evaluated but are locked against reprocessing, thus appearing as originally typed when saved and reopened. Optimization and other features are disabled in this mode. The status bar adds Design Lock when activated.
May 8 Scan or
Calculate with the Collector June 28 Triangle Graph, etc.
September 12 DESIGN BASIC XL Example The code below demonstrates DESIGN BASIC XL functions. MEASURE examples can be found here (temperature stage) and here (angular dispersion). A reason to NOT install Excel on QA computers is to prevent accidental or intentional changes in spectral data. ' DESIGNXL.bas ' FTG Software , Princeton, NJ ©2017 DefInt i-N DefSng A-H, O-Z Option Base 1 Option Explicit ' ****************** Change as required ****************** ' Default directory for saving Excel files Const Directory$ = "c:\Winfilm\Spectra\" ' Angle range Const aMin = 0 Const aMax = 75 Const aDel = 15 Const VLTBLUE& = RGB(228, 228, 255) Sub Main() Dim ang, xDat(), yDat(), kCol, nCols, nRows, iDat, nDat, t$ nCols = 3 + 2*(aMax - aMin)/aDel ' wave and %R %T columns For ang = aMin To aMax Step aDel ' loop over angles kCol = kCol + 1 ' column number If ang < 0 Or ang >= 90 Then MsgBox "Invalid angle",16:XLclose:End Calculate If kCol = 1 Then xDat = Spectrum_X nDat = UBound(xDat) If ang = aMin Then nRows = 1 + nDat XLnew nRows, nCols, "Spectrum1" ' open hidden workbook End If XLwrite 1, 1, "Wave (nm)",,,, VLTBLUE For iDat = 1 To nDat XLwrite iDat + 1, 1, xDat(iDat) Next iDat kCol = 2 End If t$ = CStr(ang) & "°" XLwrite 1, kCol, "%R " & t$,,,, VLTBLUE XLwrite 1, kCol + 1, "%T " & t$,,,, VLTBLUE yDat = Spectrum_Y For iDat = 1 To nDat XLwrite iDat + 1, kCol, 100 * yDat(iDat, 1) ' %R XLwrite iDat + 1, kCol + 1, 100 * yDat(iDat, 2) ' %T Next iDat kCol = kCol + 1 Next ang On Error Resume Next Kill Directory$ & "Test.xls" XLsave Directory$ & "Test.xls" XLview Directory$ & "Test.xls" XLclose ' close hidden workbook If MsgBox("Click OK to close Excel window", 64) = vbOK Then AppActivate "Microsoft Excel" SendKeys "%{F4}" ' close Excel End If End Sub Can't get the BASIC code to work? Contact FTG Software to arrange a ZOOM meeting. October 9 Converting Spectral Files A user needed to convert numerous J-CAMP (DX) files to Excel format. The latest FTG Software versions support XLS (Excel 1997+) and XLSX (Excel 2007+). Excel is not required. An advantage of XLSX is smaller file size, e.g. 11 KB instead of 26 KB for 380-780 x 1 nm MEASURE spectra. The code below converts 1000 files in a minute or two. ' SpcConvert.bas ' Converts FilmStar spectral file format ' Paths must already exist Const Path1$ = "C:\Winfilm\Source\" Const Ext1$ = ".dx" ' .csv/.dx/.spc/.xls/.xlsx Const Path2$ = "C:\Winfilm\Destin\" Const Ext2$ = ".xlsx" ' .csv/.dx/.spc/.xls/.xlsx Sub Main k% = Len(Ext1$) s$ = Dir(Path1$ & "*" & Ext1$) Do i% = i% + 1 FileOpen Path1$ & s$ FileSave Path2$ & Left$(s$, Len(s$) - k%) & Ext2$ s$ = Dir$() StatusLabel "Converting file #" & CStr(i%) Loop Until s$="" StatusLabel "" End Sub Source and destination directories can be the same. Users who wish to experiment with test files can use the following file generator:
XLSX requires .NET Framework 2.0 [C:\Windows\Microsoft.NET\Framework\v2.0.50727]. This is probably already installed. Can't get BASIC to work? Contact us to arrange a ZOOM meeting. December 12 Scanning Multiple Samples While the Collector was originally developed for the Cary UMA, a modification is available in other MEASURE versions. Suppose you need to sample purchased optics. Why save spectra in multiple files when they can be saved in a single Excel file? Here's an example where 5 samples each of 3 different parts are measured: Option Explicit Const File$ = "C:\Winfilm\Spectra\MultTest.xlsx" ' .xls or .xlsx Const Part$ = "Optic" ' 5 samples each of 3 different parts Const Parts% = 3 ' 15 scans total Const Smpls% = 5 Sub Main Dim i%, k%, p$, s$ If PgmExe$ = "Mcary5U" Then Exit Sub Const OK$ = ", then click <OK>" MsgBox "Mount reference optic" & OK$, 0, "Multi-scan" DataType = 3: Scan ' reference DataType = 1 ' sample For k = 1 To Parts p$ = Part$ & CStr(k) For i = 1 To Smpls s$ = "Sample " & CStr(i): AxesDraw MsgBox "Mount " & s$ & OK$, 0, p$ Scan ,,,,,"Scanning " & p$ & ", " & s$ Collect p$, s$, (i=1 And k=1) Next i Next k AxesDraw End Sub Try the above with Test Mode enabled (comment-out MsgBox lines
if in a hurry). We think
you'll agree that this is much easier than dealing with 15 files.
Open the FSPlot Module, select one of the data sheets and click
Spectra.. Plot Sheet <Shift+F4>.
|
Copyright © 2023 FTG Software Associates
Last updated on
August 16, 2024