Beispiel #1
0
def runScattering(acqEntries, configSetting):
    
    for seqIndex in range(len(acqEntries)):
        acqEntry = acqEntries[seqIndex]
        sampleEntry = samples[acqEntry['sample']]
        
        # Click if runnable
        if isRunScattering(acqEntry['runId']):
            # Set sample
            quokka.setSample(sampleEntry['position'], sampleEntry['name'], sampleEntry['description'], sampleEntry['thickness'], isDriveSampleStage())
            # Clear transmission flag
            sics.set('transmissionflag', 0)
            sleep(0.1)
            # Set attenuation
            log('Finding safe attenuation value ...')
            startingAttenuation = driveSafeAttenuation(configSetting['manualAttenuationAlgorithm'], configSetting['startingAttenuation'])
            # Acquire data
            mode = configSetting['scatteringMode']
            preset = getScatteringPreset(acqEntry['runId'], acqEntry['preset'])
            updateScatteringRunState(acqEntry['runId'], True)
            log('Start scattering run on ' + sampleEntry['name'] + ' (mode: ' + mode.key + ', preset: ' + str(preset) + ') ... ')
            # Scan (force scan if this is a dark current scan)
            dataFile = scan(mode, dataType.HISTOGRAM_XY, preset, getForcedScanValue(sampleEntry['type']))
            # Update data file name
            updateScatteringRunState(acqEntry['runId'], False)
            updateScatteringDetails(acqEntry['runId'], dataFile[-14:-7], getLambdaValue(), getAttValue(), getL1Value(), getL2Value())
            # Print instrument state
            sleep(0.2)
            # Drive attenuation back safer value
            log('Drive attenuation back to safe value ...')
            if startingAttenuation is None:
                startingAttenuation = 300
            driveAtt(startingAttenuation)
            quokka.printQuokkaSettings()
Beispiel #2
0
def runTransmission(acqEntries, configSetting):
    
    for seqIndex in range(len(acqEntries)):
        acqEntry = acqEntries[seqIndex]
        sampleEntry = samples[acqEntry['sample']]
        
        # Click if runnable
        if isRunTransmission(acqEntry['runId']):
            # Set sample
            quokka.setSample(sampleEntry['position'], sampleEntry['name'], sampleEntry['description'], sampleEntry['thickness'], isDriveSampleStage())
            # Set transmission flag
            sics.set('transmissionflag', 1)
            sleep(0.1)
            # Set attenuation
            # Acquire data
            mode = configSetting['transmissionMode']
            preset = configSetting['transmissionPreset']
            updateTransmissionRunState(acqEntry['runId'], True)
            log('Start transmission run on ' + sampleEntry['name'] + ' ...')
            dataFile = scan(mode, dataType.HISTOGRAM_XY, preset, getForcedScanValue(sampleEntry['type']))
            # Update data file name
            updateTransmissionRunState(acqEntry['runId'], False)
            updateTransmissionDetails(acqEntry['runId'], dataFile[-14:-7], getLambdaValue(), getAttValue(), getL1Value(), getL2Value())
            # Print instrument state
            sleep(0.2)
            quokka.printQuokkaSettings()