pysdic.cordin.CORDIN#
- class CORDIN(xml_file, convert_types=True)[source]#
Bases:
objectAcquisition information of a CORDIN capture, read from its
CaptureInfoXML file.Each image of the capture has a frame number (
FrameNumber, from 1 to the number of frames, in the order of acquisition) and a module number (Module, the module of the camera that took it). This class gives the information of an image from either number, and converts one into the other.Important
The frame numbers start at 1 (not 0), as in the XML file.
- Parameters:
xml_file (str or pathlib.Path) – Path to the
CaptureInfoXML file.convert_types (bool, optional (default:
True)) – If True, the values of the attributes are converted tobool,intorfloatwhen possible (seeconvert_value()).
Examples
>>> calibration = CORDIN("calibration/capture.xml") >>> measure = CORDIN("measure/capture.xml") >>> measure.get_infos(frame=12)["FileName"] >>> measure.get_module(frame=12) >>> measure.get_frame(module=60)
- get_infos(frame=None, module=None)[source]#
Return the information of an image, given either its frame number or its module number (exactly one of them).
- Parameters:
- Returns:
A copy of the attributes of the
FrameInfoelement, with itsFileName.- Return type:
- Raises:
ValueError – If both or none of
frameandmoduleare given.KeyError – If the frame or the module does not exist.