Author Topic: Estimation of acquisition time  (Read 5022 times)

Donggao Zhao

  • Post Doc
  • ***
  • Posts: 10
    • UT Austin Electron Microbeam Laboratories
Estimation of acquisition time
« on: May 06, 2014, 10:38:10 AM »
In addition to peak and background times, there are times used for moving spectrometers and stage and setting up column conditions. How is the acquisition time of each analysis estimated? Often the actual acquisition time is longer than the estimated time. How close is the estimated acquisition time to the actual acquisition time? Thanks.

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Estimation of acquisition time
« Reply #1 on: May 06, 2014, 07:49:51 PM »
In addition to peak and background times, there are times used for moving spectrometers and stage and setting up column conditions. How is the acquisition time of each analysis estimated? Often the actual acquisition time is longer than the estimated time. How close is the estimated acquisition time to the actual acquisition time? Thanks.

It's quite complicated actually. In fact, I would venture that the modeling of acquisition time is more complicated than the matrix correction physics, if you want to get reasonable accuracy. But it's even worse than that... because of subtle latencies in the instrument responses it is very difficult to get exact estimates for small but significant indeterminicies when they are repeated hundreds to thousands of times.  I wonder by what percentage are your estimates off?

I worked with Paul Carpenter with his 8200 to do the JEOL latencies, but I'm sure our work could be improved upon. The essential trick is to perform a test that accentuates a particular latency. For example, a wavescan with very short count times, but many data points.

That said, there is a user adjustable parameter in the Probewin.INI file that you can use to "tweak" your acquisition time estimation accuracy. Please check your reference manual, but the parameter is :

[hardware]
AutomationOverheadPerAnalysis=10.0   ; user tunable parameter

So, short of providing us with additional tests of the JEOL instrument latencies, this number can be "tweaked" to provide a more accurate acquisition time estimate for a specific instrument.

Below is a small portion of the acquisition time estimation code (because we are limited to 30K characters per post!). Because there are so many acquisitions options in Probe for EPMA, this estimate gets rather complicated rather quickly!   ;D

Sub TimeCalculate(mode As Integer, MaxTime As Single, maxcolumn As Single, maxreturn As Single, maxfliptime As Single, maxpeakingtime As Single, timearray() As Single, movearray() As Single, elementarray() As Single, sample() As TypeSample)
' Calculate time only (no display)
' mode = 0 calculate average time for multiple analyses
' mode > 0 calculate time for this specific analysis (mode = datarow)
' timearray() = total time per spectro
' movearray() = total non-counting time per element (includes time waiting for next analytical or column condition)
' elementarray() = total counting time per element

ierror = False
On Error GoTo TimeCalculateError

Dim alldone As Integer, nintegrations As Integer, i As Integer, n As Integer
Dim motor As Integer, order As Integer, chan As Integer, iscal As Integer
Dim imotor As Integer, ichan As Integer, nscal As Integer

Dim onmove_time As Single, maxreturntime As Single, xtalmovetime As Single
Dim oncount_time As Single, hicount_time As Single, locount_time As Single
Dim himove_time As Single, lomove_time As Single

Dim xtalfliptime(1 To MAXSPEC%) As Single
Dim lastxtal(1 To MAXSPEC%) As String
Dim lastposition(1 To MAXSPEC%) As Single
Dim returnmovetime(1 To MAXSPEC%) As Single
Dim peakingtime(1 To MAXSPEC%) As Single
Dim columntime(1 To MAXSPEC%) As Single     ' set column time for each spectrometer
Dim columntime2(1 To MAXSPEC%) As Single     ' set column time for each spectrometer (after acquisition)
Dim lastbiases(1 To MAXSPEC%) As Single

Dim nonEDS_time As Single

Const GRAPH_INIT_TIME! = 2#
Const PEAK_FACTOR! = 1.1
Const BACKLASHTIME# = 2#
Const TDI_OVERHEAD# = 1.8

Const PENEPMA_STARTUP# = 16#

' Set hardware overhead time depending on interface
hard_time! = DEFAULT_HARDTIME!   ' set hardware overhead time
If InterfaceType% = 0 Then hard_time! = 0.3 * RealTimeInterval!   ' Demo (no hardware overhead)
'If InterfaceType% = 1 Then hard_time! = hard_time! * 0.1          ' Unused
If InterfaceType% = 2 Then
If JeolEOSInterfaceType& = 1 Then hard_time! = hard_time! * 0.05        ' JEOL 8200/8500 TCP/IP
If JeolEOSInterfaceType& = 2 Then hard_time! = hard_time! * 0.1         ' JEOL 8900 TCP/IP
If JeolEOSInterfaceType& = 3 Then hard_time! = hard_time! * 0.8         ' JEOL 8230/8530 TCP/IP
End If
'If InterfaceType% = 3 Then hard_time! = hard_time! * 1.3       ' Unused
'If InterfaceType% = 4 Then hard_time! = hard_time! * 1#        ' Unused
If InterfaceType% = 5 Then hard_time! = hard_time! * 1.9       ' SX100
'If InterfaceType% = 6 Then hard_time! = hard_time! * 1.2       ' Unused
'If InterfaceType% = 7 Then hard_time! = hard_time! * 1#        ' Unused
'If InterfaceType% = 8 Then hard_time! = hard_time! * 1#        ' Unused
'If InterfaceType% = 9 Then hard_time! = hard_time! * 1#        ' Unused
If InterfaceType% = 10 Then hard_time! = hard_time! * 1#       ' Axioscope
'If InterfaceType% = 11 Then hard_time! = hard_time! * 1#       ' Unused

' Set kilovolt set time depending on interface
If OperatingVoltagePresent And Not UseDoNotSetConditionsFlag Then
kilovoltset_time! = KILOVOLTSET!   ' set kilovolt set time
Else
kilovoltset_time! = 0#
End If
If InterfaceType% = 0 Then kilovoltset_time! = kilovoltset_time! * 0.2        ' Demo
'If InterfaceType% = 1 Then kilovoltset_time! = kilovoltset_time! * 0.5        ' Unused
If InterfaceType% = 2 Then kilovoltset_time! = kilovoltset_time! * 1#         ' JEOL TCP/IP
'If InterfaceType% = 3 Then kilovoltset_time! = kilovoltset_time! * 1#         ' Unused
'If InterfaceType% = 4 Then kilovoltset_time! = kilovoltset_time! * 1#         ' Unused
If InterfaceType% = 5 Then kilovoltset_time! = kilovoltset_time! * 1.5        ' SX100
'If InterfaceType% = 6 Then kilovoltset_time! = kilovoltset_time! * 1.8        ' Unused
'If InterfaceType% = 7 Then kilovoltset_time! = kilovoltset_time! * 1#         ' Unused
'If InterfaceType% = 8 Then kilovoltset_time! = kilovoltset_time! * 0#         ' Unused
'If InterfaceType% = 9 Then kilovoltset_time! = kilovoltset_time! * 1#         ' Unused
If InterfaceType% = 10 Then kilovoltset_time! = kilovoltset_time! * 0#        ' Axioscope
'If InterfaceType% = 11 Then kilovoltset_time! = kilovoltset_time! * 1#        ' Unused

' Set beamcurrent set time depending on interface
If BeamCurrentPresent And Not UseDoNotSetConditionsFlag Then
beamcurrentset_time! = BEAMCURRENTSET!   ' set beamcurrent set time
Else
beamcurrentset_time! = 0#
End If
If InterfaceType% = 0 Then beamcurrentset_time! = beamcurrentset_time! * 0.4        ' Demo
'If InterfaceType% = 1 Then beamcurrentset_time! = beamcurrentset_time! * 0.5        ' Unused
If InterfaceType% = 2 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' JEOL TCP/IP
'If InterfaceType% = 3 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' Unused
'If InterfaceType% = 4 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' Unused
If InterfaceType% = 5 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' SX100
'If InterfaceType% = 6 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' Unused
'If InterfaceType% = 7 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' Unused
'If InterfaceType% = 8 Then beamcurrentset_time! = beamcurrentset_time! * 0#         ' Unused
'If InterfaceType% = 9 Then beamcurrentset_time! = beamcurrentset_time! * 1#         ' Unused
If InterfaceType% = 10 Then beamcurrentset_time! = beamcurrentset_time! * 0#        ' Axioscope
'If InterfaceType% = 11 Then beamcurrentset_time! = beamcurrentset_time! * 1#        ' Unused

' Set beamsize set time depending on interface
If BeamSizePresent And Not UseDoNotSetConditionsFlag Then
beamsizeset_time! = BEAMSIZESET!   ' set beamsize set time
Else
beamsizeset_time! = 0#
End If
If InterfaceType% = 0 Then beamsizeset_time! = beamsizeset_time! * 0.2        ' Demo
'If InterfaceType% = 1 Then beamsizeset_time! = beamsizeset_time! * 0.5        ' Unused
If InterfaceType% = 2 Then beamsizeset_time! = beamsizeset_time! * 0.8        ' JEOL TCP/IP
'If InterfaceType% = 3 Then beamsizeset_time! = beamsizeset_time! * 1#         ' Unused
'If InterfaceType% = 4 Then beamsizeset_time! = beamsizeset_time! * 1#         ' Unused
If InterfaceType% = 5 Then beamsizeset_time! = beamsizeset_time! * 1#         ' SX100
'If InterfaceType% = 6 Then beamsizeset_time! = beamsizeset_time! * 2#         ' Unused
'If InterfaceType% = 7 Then beamsizeset_time! = beamsizeset_time! * 1#         ' Unused
'If InterfaceType% = 8 Then beamsizeset_time! = beamsizeset_time! * 0#         ' Unused
'If InterfaceType% = 9 Then beamsizeset_time! = beamsizeset_time! * 1#         ' Unused
If InterfaceType% = 10 Then beamsizeset_time! = beamsizeset_time! * 0#        ' Axioscope
'If InterfaceType% = 11 Then beamsizeset_time! = beamsizeset_time! * 1#        ' Unused

' Set hysteresis set time depending on interface
If HysteresisPresentFlag And Not UseDoNotSetConditionsFlag Then
hysteresisset_time! = HYSTERESISSET!   ' set beamsize set time
Else
hysteresisset_time! = 0#
End If
If InterfaceType% = 0 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Demo
'If InterfaceType% = 1 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
If InterfaceType% = 2 Then hysteresisset_time! = hysteresisset_time! * 0#         ' JEOL TCP/IP
'If InterfaceType% = 3 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
'If InterfaceType% = 4 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
If InterfaceType% = 5 Then hysteresisset_time! = hysteresisset_time! * 1#         ' SX100
'If InterfaceType% = 6 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
'If InterfaceType% = 7 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
'If InterfaceType% = 8 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
'If InterfaceType% = 9 Then hysteresisset_time! = hysteresisset_time! * 0#         ' Unused
If InterfaceType% = 10 Then hysteresisset_time! = hysteresisset_time! * 0#        ' Axioscope
'If InterfaceType% = 11 Then hysteresisset_time! = hysteresisset_time! * 0#        ' Unused

' Set columncondition set time depending on interface
If ColumnConditionPresent And Not UseDoNotSetConditionsFlag Then
columnconditionset_time! = COLUMNCONDITIONSET!   ' set column condition set time
Else
columnconditionset_time! = 0#
End If
If InterfaceType% = 0 Then columnconditionset_time! = columnconditionset_time! * 0.2        ' Demo
'If InterfaceType% = 1 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
If InterfaceType% = 2 Then columnconditionset_time! = columnconditionset_time! * 1#         ' JEOL TCP/IP
'If InterfaceType% = 3 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
'If InterfaceType% = 4 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
If InterfaceType% = 5 Then columnconditionset_time! = columnconditionset_time! * 1#         ' SX100
'If InterfaceType% = 6 Then columnconditionset_time! = columnconditionset_time! * 1#         ' Unused
'If InterfaceType% = 7 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
'If InterfaceType% = 8 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
'If InterfaceType% = 9 Then columnconditionset_time! = columnconditionset_time! * 0#         ' Unused
If InterfaceType% = 10 Then columnconditionset_time! = columnconditionset_time! * 0#        ' Axioscope
'If InterfaceType% = 11 Then columnconditionset_time! = columnconditionset_time! * 0#        ' Unused

' Calculate actual number of spectrometers used for software overhead
order% = 1
For motor% = 1 To NumberOfTunableSpecs%
chan% = RealTimeGetChannelNumber%(motor%, order%, sample())    ' get channel number
If ierror Then Exit Sub
If chan% > 0 Then n% = n% + 1
Next motor%

' Initialize software overhead time based on number of spectrometers in use
If InterfaceType% = 0 Or (InterfaceType% = 2 And UseSharedMonitorDataFlag) Then
soft_time! = RealTimeInterval! * Sqr(n%)      ' demo or JEOL monitor based hardware (8900/8200/8500)
Else
soft_time! = 0.6 + RealTimeInterval! * Sqr(n%)     ' add in ~1 sec for firmware delays
End If

' Initialize each spectrometer with column setting time if interface is present
For iscal% = 1 To NumberOfTunableSpecs%
columntime!(iscal%) = soft_time! * 2.5   ' for setting beam spot/scan mode

' Set analytical conditions
If sample(1).ColumnConditionMethod% = 0 Then
If OperatingVoltagePresent Then
If sample(1).kilovolts! <> DefaultKiloVolts! Then
columntime!(iscal%) = columntime!(iscal%) + kilovoltset_time! + KilovoltChangeDelay!
End If
If sample(1).beamcurrent! <> DefaultBeamCurrent! Then
columntime!(iscal%) = columntime!(iscal%) + beamcurrentset_time! + BeamCurrentChangeDelay!
End If
If sample(1).beamsize! <> DefaultBeamSize! Or UseForceSizeFlag% Then
columntime!(iscal%) = columntime!(iscal%) + beamsizeset_time! + BeamSizeChangeDelay!
If HysteresisPresentFlag Then columntime!(iscal%) = columntime!(iscal%) + hysteresisset_time!
End If
End If

' Column condition is always set on each analysis
Else
If ColumnConditionPresent And sample(1).ColumnConditionString$ <> DefaultColumnConditionString$ Or UseForceColumnConditionFlag Then
columntime!(iscal%) = columntime!(iscal%) + columnconditionset_time! + ColumnConditionChangeDelay!
End If
End If

' Add in time to set beam deflection
If UseBeamDeflectionFlag And FormAUTOMATE.CheckBeamDeflection(sample(1).Type% - 1).value = vbChecked Then
columntime!(iscal%) = columntime!(iscal%) + soft_time! * 3#
End If

' Add in faraday cup or beam unblank delay
columntime!(iscal%) = columntime!(iscal%) + soft_time! + FaradayWaitOutTime!

' Add in decontamination time
If DecontaminationTime! > 0# Then columntime!(iscal%) = columntime!(iscal%) + soft_time! + DecontaminationTime!

' Add in absorbed current measurement if specified
If AbsorbedCurrentMeasureFlag Then columntime!(iscal%) = columntime!(iscal%) + soft_time! + FaradayWaitInTime!
Next iscal%

' Tunable specs
order% = 1
Do Until alldone
alldone = True
For motor% = 1 To NumberOfTunableSpecs%

chan% = RealTimeGetChannelNumber%(motor%, order%, sample())    ' get channel number
If ierror Then Exit Sub
If chan% < 1 Then GoTo 1000:   ' no more elements on this spectrometer
alldone = False
If sample(1).DisableAcqFlag%(chan%) = 0 Then   ' not disabled acquisition

iscal% = RealTimeGetScalerNumber%(chan%, sample())    ' get scaler number
If ierror Then Exit Sub

' Load last position for each element for subsequent elements ONLY! (see AcquireUpdateSampleProgressStart for actual calculation)
If order% = 1 Then lastposition!(iscal%) = sample(1).OnPeaks!(chan%) ' assume starting at on-peak for first element
If sample(1).Type <> 3 Then
onmove_time! = LimitToLimit! * Abs(lastposition!(iscal%) - sample(1).OnPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))
onmove_time! = onmove_time! + soft_time! + hard_time!
Else
If QuickWaveScanAcquisitionFlag Then
If MotBacklashFactors!(motor%) <= 0# Then onmove_time! = LimitToLimit! * Abs(lastposition!(iscal%) - sample(1).WDSQuickScanLoPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))  ' step up
If MotBacklashFactors!(motor%) > 0# Then onmove_time! = LimitToLimit! * Abs(lastposition!(iscal%) - sample(1).WDSQuickScanHiPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))   ' step down
onmove_time! = onmove_time! + soft_time! + hard_time!
Else
If MotBacklashFactors!(motor%) <= 0# Then onmove_time! = LimitToLimit! * Abs(lastposition!(iscal%) - sample(1).WDSWaveScanLoPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))  ' step up
If MotBacklashFactors!(motor%) > 0# Then onmove_time! = LimitToLimit! * Abs(lastposition!(iscal%) - sample(1).WDSWaveScanHiPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))   ' step down
onmove_time! = onmove_time! + soft_time! + hard_time!
End If
End If

If SpecBackLashFlag Then onmove_time! = onmove_time! + BACKLASHTIME#    ' add in software backlash time (on-peak)

' Save last spectrometer position for move to on-peak calculation for subsequent elements
If sample(1).Type <> 3 Then
If sample(1).BackgroundTypes%(chan%) = 0 Then       ' off-peak
lastposition!(iscal%) = sample(1).LoPeaks!(chan%)
End If
If sample(1).BackgroundTypes%(chan%) = 1 Then       ' MAN
lastposition!(iscal%) = sample(1).OnPeaks!(chan%)
End If
If sample(1).BackgroundTypes%(chan%) = 2 Then       ' multi-point
If sample(1).MultiPointNumberofPointsAcquireLo%(chan%) > 0 Then lastposition!(iscal%) = sample(1).MultiPointAcquirePositionsLo!(chan%, sample(1).MultiPointNumberofPointsAcquireLo%(chan%))
End If
Else
If QuickWaveScanAcquisitionFlag Then
If MotBacklashFactors!(motor%) <= 0# Then lastposition!(iscal%) = sample(1).WDSQuickScanHiPeaks!(chan%)  ' end high
If MotBacklashFactors!(motor%) > 0# Then lastposition!(iscal%) = sample(1).WDSQuickScanLoPeaks!(chan%)   ' end low
Else
If MotBacklashFactors!(motor%) <= 0# Then lastposition!(iscal%) = sample(1).WDSWaveScanHiPeaks!(chan%)  ' end high
If MotBacklashFactors!(motor%) > 0# Then lastposition!(iscal%) = sample(1).WDSWaveScanLoPeaks!(chan%)   ' end low
End If
End If

' Save last bias voltage
lastbiases!(iscal%) = sample(1).Biases!(chan%)

' Calculate off-peak motion (on peak to hi peak)
If sample(1).Type% <> 3 Then
himove_time! = LimitToLimit! * Abs(sample(1).HiPeaks!(chan%) - sample(1).OnPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))
himove_time! = himove_time! + 3# * soft_time! + hard_time!
If SpecBackLashFlag Then himove_time! = himove_time! + BACKLASHTIME#    ' add in software backlash time (hi-peak)

' Calculate off-peak motion (hi peak to lo peak)
lomove_time! = LimitToLimit! * Abs(sample(1).LoPeaks!(chan%) - sample(1).HiPeaks!(chan%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))
lomove_time! = lomove_time! + 3# * soft_time! + hard_time!
If SpecBackLashFlag Then lomove_time! = lomove_time! + BACKLASHTIME#    ' add in software backlash time (lo-peak)
End If

' Load last crystal for each element
If sample(1).CrystalNames$(chan%) <> "EDS" Then
If lastxtal$(iscal%) = vbNullString Then lastxtal$(iscal%) = sample(1).CrystalNames$(chan%) ' init
If lastxtal$(iscal%) <> sample(1).CrystalNames$(chan%) Then
lastxtal$(iscal%) = sample(1).CrystalNames$(chan%)
xtalfliptime!(iscal%) = xtalfliptime!(iscal%) + XTALFLIP!
movearray!(chan%) = movearray!(chan%) + XTALFLIP!    ' add crystal flip time as non-count time

' Calculate move to flip position and back time
xtalmovetime! = 0#
If ScalCrystalFlipFlags%(iscal%) > 1 Then
xtalmovetime! = LimitToLimit! * Abs(lastposition!(iscal%) - ScalCrystalFlipPositions!(iscal%)) / (MotHiLimits!(motor%) - MotLoLimits!(motor%))
xtalmovetime! = xtalmovetime! * 2#      ' back and forth
movearray!(chan%) = movearray!(chan%) + xtalmovetime!    ' add crystal flip move time as non-count time
End If
End If

' Standard
If sample(1).Type% = 1 Then
If TimeAcquireQuickStandardElement(chan%, sample()) Then

' Use unknown count time for interfered elements
oncount_time! = sample(1).LastOnCountTimes!(chan%)
If sample(1).UnknownCountTimeForInterferenceStandardFlag And AcquireIsUseUnknownCountTimeForInterferenceStandardFlag(chan%, sample()) Then
oncount_time! = sample(1).LastOnCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

' Add in integrated intensity time
If sample(1).IntegratedIntensitiesUseIntegratedFlags(chan%) Then     ' assume 50% peak to background intensities using initial step size
nintegrations% = Abs(sample(1).HiPeaks!(chan%) - sample(1).LoPeaks!(chan%)) / sample(1).IntegratedIntensitiesInitialStepSizes!(chan%) * 1.5
If UseROMBasedSpectrometerScanFlag Then
oncount_time! = oncount_time! * nintegrations%  ' add in time for spec movement as element time
Else
nintegrations% = nintegrations% ^ PEAK_FACTOR!          ' try to model increased integrations for peak intensity
oncount_time! = (oncount_time! + soft_time! + hard_time!) * nintegrations%  ' add in time for spec movement as element time
End If
End If

' Add volatile (TDI) count time
If VolatileSelfCalibrationAcquisitionFlag And sample(1).OrderNumbers%(chan%) = 1 Then
oncount_time! = oncount_time! + VolatileCountIntervals% * (TDI_OVERHEAD# * soft_time!)   ' add in time for interval counting
End If

' Check for Nth point and OnPeakTimeFractionFlag and adjust on-peak count times if specified and <> 1.0
If NthPointAcquisitionFlag And OnPeakTimeFractionFlag And OnPeakTimeFractionValue! <> 1# Then
If sample(1).NthPointAcquisitionFlags%(chan%) Then
If mode% = 0 Then
oncount_time! = (oncount_time! * OnPeakTimeFractionValue! + (oncount_time! * (sample(1).NthPointAcquisitionIntervals%(chan%) - 1))) / sample(1).NthPointAcquisitionIntervals%(chan%)
Else
If mode% Mod sample(1).NthPointAcquisitionIntervals%(chan%) = 1 Then
oncount_time! = oncount_time! * OnPeakTimeFractionValue!
End If
End If
End If
End If

' Calculate off-peak count times if not MAN
If sample(1).BackgroundTypes%(chan%) <> 1 Then  ' 0=off-peak, 1=MAN, 2=multipoint

' Use unknown count time for interfered elements
hicount_time! = sample(1).LastHiCountTimes!(chan%)
If sample(1).UnknownCountTimeForInterferenceStandardFlag And AcquireIsUseUnknownCountTimeForInterferenceStandardFlag(chan%, sample()) Then
hicount_time! = sample(1).LastHiCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

' Add in overhead for backgrounds
If sample(1).BackgroundTypes%(chan%) = 0 Then
hicount_time! = hicount_time!   ' himove time accounted for separately
End If
If sample(1).BackgroundTypes%(chan%) = 2 Then
hicount_time! = hicount_time! / 2#   ' used in multi-point acquisition
hicount_time! = hicount_time! * sample(1).MultiPointNumberofPointsAcquireHi%(chan%) ' used in multi-point acquisition
hicount_time! = hicount_time! + 2.1 * (soft_time! + hard_time!) * sample(1).MultiPointNumberofPointsAcquireHi%(chan%)  ' add in hardware move overhead
End If

' Use unknown count time for interfered elements
locount_time! = sample(1).LastLoCountTimes!(chan%)
If sample(1).UnknownCountTimeForInterferenceStandardFlag And AcquireIsUseUnknownCountTimeForInterferenceStandardFlag(chan%, sample()) Then
locount_time! = sample(1).LastLoCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

' Add in overhead for backgrounds
If sample(1).BackgroundTypes%(chan%) = 0 Then
locount_time! = locount_time!   ' lomove time accounted for separately
End If
If sample(1).BackgroundTypes%(chan%) = 2 Then
locount_time! = locount_time! / 2#   ' used in multi-point acquisition
locount_time! = locount_time! * sample(1).MultiPointNumberofPointsAcquireLo%(chan%) ' used in multi-point acquisition
locount_time! = locount_time! + 2.1 * (soft_time! + hard_time!) * sample(1).MultiPointNumberofPointsAcquireLo%(chan%)  ' add in hardware move overhead
End If

' Correct off-peaks time and motion for Nth point acquisition (normal and multi-point backgrounds)
If NthPointAcquisitionFlag And sample(1).NthPointAcquisitionFlags%(chan%) Then      ' check if using Nth point off-peaks
If mode% = 0 Then
hicount_time! = hicount_time! / sample(1).NthPointAcquisitionIntervals%(chan%)
locount_time! = locount_time! / sample(1).NthPointAcquisitionIntervals%(chan%)
himove_time! = himove_time! / sample(1).NthPointAcquisitionIntervals%(chan%)
lomove_time! = lomove_time! / sample(1).NthPointAcquisitionIntervals%(chan%)
Else
If mode% Mod sample(1).NthPointAcquisitionIntervals%(chan%) <> 1 Then
hicount_time! = 0#
locount_time! = 0#
himove_time! = 0#
lomove_time! = 0#
End If
End If
End If
End If

If sample(1).BackgroundTypes%(chan%) = 1 Then ' do not add off peak time and motion if MAN
elementarray!(chan%) = oncount_time!
Else
elementarray!(chan%) = oncount_time! + hicount_time! + himove_time! + locount_time! + lomove_time!    ' combine off-peak count and move time
End If
If order% > 1 Then movearray!(chan%) = movearray!(chan%) + onmove_time!  ' add in time for subsequent element on-peak spectrometer movement

' Add in counting overhead for software
elementarray!(chan%) = elementarray!(chan%) + soft_time!
End If
End If

' Unknown
If sample(1).Type% = 2 Then
If UseAlternatingOnAndOffPeakAcquisitionFlag Then
oncount_time! = sample(1).LastOnCountTimes!(chan%)  ' alternating on/off calculation is performed below
Else
oncount_time! = sample(1).LastOnCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

' Calculate integrated intensity time
If sample(1).IntegratedIntensitiesUseIntegratedFlags(chan%) Then     ' assume 50% peak to background intensities using initial step size
nintegrations% = Abs(sample(1).HiPeaks!(chan%) - sample(1).LoPeaks!(chan%)) / sample(1).IntegratedIntensitiesInitialStepSizes!(chan%) * 1.5
If UseROMBasedSpectrometerScanFlag Then
oncount_time! = oncount_time! * nintegrations%
Else
nintegrations% = nintegrations% ^ PEAK_FACTOR!          ' try to model increased integrations for peak intensity
oncount_time! = (oncount_time! + soft_time! + hard_time!) * nintegrations%  ' add in time for spec movement as element time
End If
End If

' Add volatile (TDI) count time
If VolatileSelfCalibrationAcquisitionFlag And sample(1).OrderNumbers%(chan%) = 1 Then
oncount_time! = oncount_time! + VolatileCountIntervals% * (TDI_OVERHEAD# * soft_time!)  ' add in time for interval counting
End If

' Check for Nth point and OnPeakTimeFractionFlag and adjust on-peak count times if specified and <> 1.0
If NthPointAcquisitionFlag And OnPeakTimeFractionFlag And OnPeakTimeFractionValue! <> 1# Then
If sample(1).NthPointAcquisitionFlags%(chan%) Then
If mode% = 0 Then
oncount_time! = (oncount_time! * OnPeakTimeFractionValue! + (oncount_time! * (sample(1).NthPointAcquisitionIntervals%(chan%) - 1))) / sample(1).NthPointAcquisitionIntervals%(chan%)
Else
If mode% Mod sample(1).NthPointAcquisitionIntervals%(chan%) = 1 Then
oncount_time! = oncount_time! * OnPeakTimeFractionValue!
End If
End If
End If
End If

' Calculate off-peak count times
If sample(1).BackgroundTypes%(chan%) <> 1 Then  ' 0=off-peak, 1=MAN, 2=multipoint
If UseAlternatingOnAndOffPeakAcquisitionFlag Then
hicount_time! = sample(1).LastHiCountTimes!(chan%)
Else
hicount_time! = sample(1).LastHiCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

' Add in overhead for backgrounds
If sample(1).BackgroundTypes%(chan%) = 0 Then
hicount_time! = hicount_time!   ' himove time accounted for separately
End If
If sample(1).BackgroundTypes%(chan%) = 2 Then
hicount_time! = hicount_time! / 2#      ' used in multi-point acquisition
hicount_time! = hicount_time! * sample(1).MultiPointNumberofPointsAcquireHi%(chan%) ' used in multi-point acquisition
hicount_time! = hicount_time! + 2.1 * (soft_time! + hard_time!) * sample(1).MultiPointNumberofPointsAcquireHi%(chan%)  ' add in hardware move overhead
End If

If UseAlternatingOnAndOffPeakAcquisitionFlag Then
locount_time! = sample(1).LastLoCountTimes!(chan%)
Else
locount_time! = sample(1).LastLoCountTimes!(chan%) * sample(1).LastCountFactors!(chan%)
End If

John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Estimation of acquisition time- Multi-point bgd
« Reply #2 on: May 08, 2014, 12:52:30 PM »
So here's an example of a "tweak" I just made to the time calculation to improve the estimation of the multi-point background acquisition...

I was doing this:

If sample(1).BackgroundTypes%(chan%) = 2 Then
hicount_time! = hicount_time! / 2#      ' used in multi-point acquisition
hicount_time! = hicount_time! * sample(1).MultiPointNumberofPointsAcquireHi%(chan%) ' used in multi-point acquisition
hicount_time! = hicount_time! + 2.1 * (soft_time! + hard_time!) * sample(1).MultiPointNumberofPointsAcquireHi%(chan%)  ' add in hardware move overhead

where the motion time for the spectrometer to move between the multiple background positions was very roughly estimated. Today I modified this code to reflect the motion time more accurately as seen here:

If sample(1).BackgroundTypes%(chan%) = 2 Then
hicount_time! = hicount_time! / 2#   ' used in multi-point acquisition
hicount_time! = hicount_time! * sample(1).MultiPointNumberofPointsAcquireHi%(chan%) ' used in multi-point acquisition
hicount_time! = hicount_time! + (himove_time! + lomove_time! + soft_time! + hard_time!) * sample(1).MultiPointNumberofPointsAcquireHi%(chan%)  ' add in hardware move overhead
End If


Models can *always* be improved!   ;D
« Last Edit: May 08, 2014, 12:54:14 PM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Estimation of acquisition time
« Reply #3 on: July 14, 2014, 11:40:36 AM »
Another acquistion time-related question - I updated my software to v.10.4.1 this morning, and now it is calculating very long acquisition times for standard acquisition - for example, for 10 standard points at ~1.5 minutes/point, it calculated an acquisition time of 1143.61 hours.

I tried the same acquisition using a previous version of PFE (10.3.9), using the same points and the same acquisition parameters (i.e. no confirm, no quick standards, 5 standard points to acquire, etc), and it calculated a much more reasonable 3378 seconds.

This only seems to be for standard acquisition automation - calculated unknown acquisition times doesn't seem to be affected.

My bad!  The glitch is fixed and PFE is ready to download the update!  Sorry again!
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Julien

  • Professor
  • ****
  • Posts: 84
  • The truth is out there...
    • Geoloweb - J. Allaz personal website
Re: Estimation of acquisition time
« Reply #4 on: January 15, 2017, 06:11:48 PM »
Hi John,

Reviving an old subject... I have a problem with the time estimate related to the TDI and the auto-focus, and I am wondering how / if we can enhance that...

The time is overestimated when I do use the TDI, by 20-30% or so. For a ~3.5 min analysis time (2-3 elements per spectro, each 30-60 sec either with MAN or a couple with 2-pts bkg) the analysis is actually done is just under 2.5 min. For longer analysis (REE element... 5-6 min with 6-8 elements per spectro), the time is overestimated a little less than 20%... Any chance I can adjust this in probewin.ini or so?

About the auto-focus: are you setting a fixed "extra time", and can we modify it? My auto-focus is done in 4-5 sec if only a quick focus scan (short Z-range) is required. JEOL has a bug in their software (need to contact them about that), and if a larger Z-focus search need to be performed, the process will fail 50% of the time when the position was significantly out-of-focus to begin with... For what I needs, when using the auto-focus on every point, I first make sure that my points are close to focus to make sure that only a short Z-range auto-focus scan will be required. What setting do you have for the auto-focus on JEOL-8230?

Julien

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Estimation of acquisition time
« Reply #5 on: January 15, 2017, 10:28:03 PM »
The time is overestimated when I do use the TDI, by 20-30% or so. For a ~3.5 min analysis time (2-3 elements per spectro, each 30-60 sec either with MAN or a couple with 2-pts bkg) the analysis is actually done is just under 2.5 min. For longer analysis (REE element... 5-6 min with 6-8 elements per spectro), the time is overestimated a little less than 20%... Any chance I can adjust this in probewin.ini or so?

Hi Julien,
There is an adjustment for automation overhead in the Probewin.ini, but in this case I am pleased to work with you on improving the TDI specific overhead time for JEOL instruments.  On my Cameca instrument I have tuned the TDI acquisition time overhead estimate to around 5 or 10% relative accuracy, but if you can run a quick test or two for me we can improve the JEOL TDI acquisition time "overhead" value as well if not better. 

Simply set the TDI intervals in the Special Option dialog to some large number (say 30 intervals), and run a single point acquisition and let me know what it estimated and what it actually was (in relative percent) from the Automate! window caption.

About the auto-focus: are you setting a fixed "extra time", and can we modify it? My auto-focus is done in 4-5 sec if only a quick focus scan (short Z-range) is required. JEOL has a bug in their software (need to contact them about that), and if a larger Z-focus search need to be performed, the process will fail 50% of the time when the position was significantly out-of-focus to begin with... For what I needs, when using the auto-focus on every point, I first make sure that my points are close to focus to make sure that only a short Z-range auto-focus scan will be required. What setting do you have for the auto-focus on JEOL-8230?

Unfortunately the 8x30 auto-focus command from JEOL contains no tuning parameters and my only responsibility is to turn on the optical light source (and wait 4 seconds), prior to sending the auto-focus command.
john
« Last Edit: January 15, 2017, 10:46:23 PM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 2858
  • Never sleeps...
    • John Donovan
Re: Estimation of acquisition time
« Reply #6 on: January 26, 2017, 09:37:37 AM »
Hi John,

Reviving an old subject... I have a problem with the time estimate related to the TDI and the auto-focus, and I am wondering how / if we can enhance that...

The time is overestimated when I do use the TDI, by 20-30% or so. For a ~3.5 min analysis time (2-3 elements per spectro, each 30-60 sec either with MAN or a couple with 2-pts bkg) the analysis is actually done is just under 2.5 min. For longer analysis (REE element... 5-6 min with 6-8 elements per spectro), the time is overestimated a little less than 20%... Any chance I can adjust this in probewin.ini or so?

About the auto-focus: are you setting a fixed "extra time", and can we modify it? My auto-focus is done in 4-5 sec if only a quick focus scan (short Z-range) is required. JEOL has a bug in their software (need to contact them about that), and if a larger Z-focus search need to be performed, the process will fail 50% of the time when the position was significantly out-of-focus to begin with... For what I needs, when using the auto-focus on every point, I first make sure that my points are close to focus to make sure that only a short Z-range auto-focus scan will be required. What setting do you have for the auto-focus on JEOL-8230?

Julien

Just a quick note  to say that Julien and I have "tweaked" the time estimate code for TDI (and general JEOL) acquisitions so that he is now seeing the estimated acquisition times to within a few percent accuracy...  please update PFE if you'd like to see improved accuracy in the automation time estimates.
john
The only stupid question is the one not asked!