mabl / PyPylon

An experimental python wrapper around the Basler Pylon 5 library
BSD 3-Clause "New" or "Revised" License
53 stars 34 forks source link

cam.properties['ExposureTime'] KeyError: 'Key does not exist #4

Open maxlklaxl opened 8 years ago

maxlklaxl commented 8 years ago

could it be that the cam.properties.keys() differ from camera to camera?

>>> cam.properties['ExposureTime']
Traceback (most recent call last):
  File "/home/strawlab/image-processing-server/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 3066, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-1-b9cb32d7a463>", line 1, in <module>
    cam.properties['ExposureTime']
  File "PyPylon/cython/factory.pyx", line 87, in pypylon.cython.factory._PropertyMap.__getitem__ (cython/factory.cpp:2637)
KeyError: 'Key does not exist'

so this is the list of properties from the GigE Basler acA640-120gm

In[2]: cam.properties.keys()
Out[2]: 
[u'SequenceEnable',
 u'SequenceCurrentSet',
 u'SequenceAsyncRestart',
 u'SequenceAsyncAdvance',
 u'SequenceSetTotalNumber',
 u'SequenceSetIndex',
 u'SequenceSetStore',
 u'SequenceSetLoad',
 u'SequenceSetExecutions',
 u'TLParamsLocked',
 u'SequenceAdvanceMode',
 u'SequenceControlSelector',
 u'SequenceControlSource',
 u'SequenceAddressBitSelector',
 u'SequenceAddressBitSource',
 u'GainAuto',
 u'GainSelector',
 u'GainRaw',
 u'BlackLevelSelector',
 u'BlackLevelRaw',
 u'GammaEnable',
 u'GammaSelector',
 u'Gamma',
 u'DigitalShift',
 u'SubstrateVoltage',
 u'PixelFormat',
 u'PixelSize',
 u'PixelColorFilter',
 u'ProcessedRawEnable',
 u'PixelDynamicRangeMin',
 u'PixelDynamicRangeMax',
 u'ReverseX',
 u'ReverseY',
 u'FieldOutputMode',
 u'Deinterlacer',
 u'TestImageSelector',
 u'SensorWidth',
 u'SensorHeight',
 u'WidthMax',
 u'HeightMax',
 u'LightSourceSelector',
 u'BalanceWhiteReset',
 u'BalanceWhiteAuto',
 u'BalanceRatioSelector',
 u'BalanceRatioAbs',
 u'BalanceRatioRaw',
 u'ColorTransformationSelector',
 u'ColorTransformationValueSelector',
 u'ColorTransformationValue',
 u'ColorTransformationValueRaw',
 u'ColorTransformationMatrixFactor',
 u'ColorTransformationMatrixFactorRaw',
 u'ColorAdjustmentEnable',
 u'ColorAdjustmentReset',
 u'ColorAdjustmentSelector',
 u'ColorAdjustmentHue',
 u'ColorAdjustmentHueRaw',
 u'ColorAdjustmentSaturation',
 u'ColorAdjustmentSaturationRaw',
 u'Width',
 u'Height',
 u'OffsetX',
 u'OffsetY',
 u'CenterX',
 u'CenterY',
 u'BinningHorizontal',
 u'BinningVertical',
 u'EnableBurstAcquisition',
 u'AcquisitionMode',
 u'AcquisitionStart',
 u'AcquisitionStop',
 u'AcquisitionFrameCount',
 u'TriggerSelector',
 u'TriggerMode',
 u'TriggerSoftware',
 u'TriggerSource',
 u'TriggerActivation',
 u'TriggerDelayAbs',
 u'ExposureMode',
 u'InterlacedIntegrationMode',
 u'ExposureAuto',
 u'ExposureTimeAbs',
 u'ExposureTimeRaw',
 u'ReadoutTimeAbs',
 u'ExposureOverlapTimeMaxAbs',
 u'ExposureOverlapTimeMaxRaw',
 u'GlobalResetReleaseModeEnable',
 u'AcquisitionFrameRateEnable',
 u'AcquisitionFrameRateAbs',
 u'ResultingFrameRateAbs',
 u'AcquisitionStatusSelector',
 u'AcquisitionStatus',
 u'LineSelector',
 u'LineMode',
 u'LineLogic',
 u'LineFormat',
 u'LineSource',
 u'LineInverter',
 u'LineTermination',
 u'LineDebouncerTimeAbs',
 u'LineDebouncerTimeRaw',
 u'LineStatus',
 u'LineStatusAll',
 u'UserOutputSelector',
 u'UserOutputValue',
 u'UserOutputValueAll',
 u'TimerDelayTimebaseAbs',
 u'TimerDurationTimebaseAbs',
 u'TimerSelector',
 u'TimerDelayAbs',
 u'TimerDelayRaw',
 u'TimerDurationAbs',
 u'TimerDurationRaw',
 u'TimerTriggerSource',
 u'TimerTriggerActivation',
 u'CounterSelector',
 u'CounterEventSource',
 u'CounterResetSource',
 u'CounterReset',
 u'LUTSelector',
 u'LUTEnable',
 u'LUTIndex',
 u'LUTValue',
 u'LUTValueAll',
 u'PayloadSize',
 u'GevSCPSPacketSize',
 u'GevSCPD',
 u'GevSCFTD',
 u'GevSCBWR',
 u'GevSCBWRA',
 u'GevSCBWA',
 u'GevSCDMT',
 u'GevSCDCT',
 u'GevSCFJM',
 u'GevVersionMajor',
 u'GevVersionMinor',
 u'GevDeviceModeIsBigEndian',
 u'GevDeviceModeCharacterSet',
 u'GevInterfaceSelector',
 u'GevMACAddress',
 u'GevSupportedIPConfigurationLLA',
 u'GevSupportedIPConfigurationDHCP',
 u'GevSupportedIPConfigurationPersistentIP',
 u'GevCurrentIPConfiguration',
 u'GevCurrentIPAddress',
 u'GevCurrentSubnetMask',
 u'GevCurrentDefaultGateway',
 u'GevPersistentIPAddress',
 u'GevPersistentSubnetMask',
 u'GevPersistentDefaultGateway',
 u'GevLinkSpeed',
 u'GevLinkMaster',
 u'GevLinkFullDuplex',
 u'GevLinkCrossover',
 u'GevFirstURL',
 u'GevSecondURL',
 u'GevNumberOfInterfaces',
 u'GevMessageChannelCount',
 u'GevStreamChannelCount',
 u'GevSupportedOptionalCommandsEVENTDATA',
 u'GevSupportedOptionalCommandsEVENT',
 u'GevSupportedOptionalCommandsPACKETRESEND',
 u'GevSupportedOptionalCommandsWRITEMEM',
 u'GevSupportedOptionalCommandsConcatenation',
 u'GevHeartbeatTimeout',
 u'GevTimestampTickFrequency',
 u'GevTimestampControlLatch',
 u'GevTimestampControlReset',
 u'GevTimestampControlLatchReset',
 u'GevTimestampValue',
 u'GevCCP',
 u'GevStreamChannelSelector',
 u'GevSCPInterfaceIndex',
 u'GevSCDA',
 u'GevSCPHostPort',
 u'GevSCPSFireTestPacket',
 u'GevSCPSDoNotFragment',
 u'GevSCPSBigEndian',
 u'UserSetSelector',
 u'UserSetLoad',
 u'UserSetSave',
 u'UserSetDefaultSelector',
 u'DefaultSetSelector',
 u'AutoTargetValue',
 u'AutoGainRawLowerLimit',
 u'AutoGainRawUpperLimit',
 u'AutoExposureTimeAbsLowerLimit',
 u'AutoExposureTimeAbsUpperLimit',
 u'AutoFunctionProfile',
 u'AutoFunctionAOISelector',
 u'AutoFunctionAOIWidth',
 u'AutoFunctionAOIHeight',
 u'AutoFunctionAOIOffsetX',
 u'AutoFunctionAOIOffsetY',
 u'AutoFunctionAOIUsageIntensity',
 u'AutoFunctionAOIUsageWhiteBalance',
 u'AutoFunctionAOIUsageRedLightCorrection',
 u'UserDefinedValueSelector',
 u'UserDefinedValue',
 u'DeviceVendorName',
 u'DeviceModelName',
 u'DeviceManufacturerInfo',
 u'DeviceVersion',
 u'DeviceFirmwareVersion',
 u'DeviceID',
 u'DeviceUserID',
 u'DeviceScanType',
 u'DeviceReset',
 u'TemperatureSelector',
 u'TemperatureAbs',
 u'ParameterSelector',
 u'RemoveLimits',
 u'ExpertFeatureAccessSelector',
 u'ExpertFeatureAccessKey',
 u'ExpertFeatureEnable',
 u'ChunkModeActive',
 u'ChunkSelector',
 u'ChunkEnable',
 u'ChunkStride',
 u'ChunkSequenceSetIndex',
 u'ChunkOffsetX',
 u'ChunkOffsetY',
 u'ChunkWidth',
 u'ChunkHeight',
 u'ChunkDynamicRangeMin',
 u'ChunkDynamicRangeMax',
 u'ChunkPixelFormat',
 u'ChunkTimestamp',
 u'ChunkFramecounter',
 u'ChunkLineStatusAll',
 u'ChunkTriggerinputcounter',
 u'ChunkLineTriggerIgnoredCounter',
 u'ChunkFrameTriggerIgnoredCounter',
 u'ChunkFrameTriggerCounter',
 u'ChunkFramesPerTriggerCounter',
 u'ChunkLineTriggerEndToEndCounter',
 u'ChunkInputStatusAtLineTriggerBitsPerLine',
 u'ChunkInputStatusAtLineTriggerIndex',
 u'ChunkInputStatusAtLineTriggerValue',
 u'ChunkShaftEncoderCounter',
 u'ChunkExposureTime',
 u'ChunkPayloadCRC16',
 u'EventSelector',
 u'EventNotification',
 u'ExposureEndEventStreamChannelIndex',
 u'ExposureEndEventFrameID',
 u'ExposureEndEventTimestamp',
 u'LineStartOvertriggerEventStreamChannelIndex',
 u'LineStartOvertriggerEventTimestamp',
 u'FrameStartOvertriggerEventStreamChannelIndex',
 u'FrameStartOvertriggerEventTimestamp',
 u'AcquisitionStartOvertriggerEventStreamChannelIndex',
 u'AcquisitionStartOvertriggerEventTimestamp',
 u'FrameTimeoutEventStreamChannelIndex',
 u'FrameTimeoutEventTimestamp',
 u'EventOverrunEventStreamChannelIndex',
 u'EventOverrunEventFrameID',
 u'EventOverrunEventTimestamp',
 u'FileSelector',
 u'FileOperationSelector',
 u'FileOpenMode',
 u'FileAccessBuffer',
 u'FileAccessOffset',
 u'FileAccessLength',
 u'FileOperationStatus',
 u'FileOperationResult',
 u'FileSize',
 u'FileOperationExecute']
mabl commented 8 years ago

Yep, this is what the API exposes. However there are direct access helpers inside the C API. Potentially these are more unified. I'll look into these.

chrothenbach commented 6 years ago

This works for me on Basler acA3800-10gm (22493825)

cam.properties['ExposureTimeAbs'] = 50000