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!
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