#PyDCC is an open-source project released under the MIT license, accelerating application development for processing Digital Calibration Certificates (DCC). In this video, we will look briefly at the contents of a DCC and demonstrate PyDCC's essential features by implementing an example application from scratch, revealing how it can benefit your Python projects. Stay tuned for insights from our Sensor Application Lab, where we're pushing the boundaries of innovation. #SensorApplicationLab #DigitalCalibrationCertificate #DCC
Transcript
Hello, my name is Andreas Tobola and this video is about PyDCC. PyDCC is a software module for reading and processing digital calibration certificates. In this video I will give a brief introduction about the digital calibration certificates itself and 2nd we will write some code to read a digital calibration certificate using PYDDC. In order to start you have two options: The first option is to go to your local machine and use the packet manager pip to install PyDCC. The second option is to go to our official repository at GitHub.com and clone the whole repository there. No matter which option you choose as your starting point, I recommend you go to our official repository and download some examples, read the documentation and maybe use some of our example data. It's definitely a good starting point. And to use the background of the project, it was developed within the founded project GEMIMEG-II by a group of developers which I highly enjoyed to work with together and I also. Like the idea to provide this code as open source and make it also others possible to contribute. And there are several ways how you can contribute to this project. Therefore please read the contributing guide and in doubt contact us. Before we start, we should take a look at the internal structure and the content of the Digital Calibration Certificate. The Digital Calibration Certificate was designed by the PDP physical technician bundles unstyled and you will find a lot of information at their website at ptb.de/dcc. In general this document is a XML document and this XML document has five sections. Section one and two are mandatory. So administrative data and result. Of calibration, which you generally would expect from a calibration certificate. And the digital calibration certificate is of course an equivalent at digital equivalent of this, so it has to have. Said Minister of Data and calibration results, of course. Additionally we have comments in comments. You can add additional information whatever you like, as long as it complies with the XML document itself, with strings that you can add here. And you are free to add your additional information there. And Section 4 is also optional, So it's a human readability comment. And that's the background of the DCC here. So the human readable document is optional, but you have to provide data here in section one and two in a way that machines can interpret your results of calibration and administrative data. And that's the advantage also of digital calibration set, because it's not only a digital document, it's a machine. Nelly readable and interpretable document, so on. The fifth section is signature, the digital signature that you can also optionally add to your document and sign your document digitally. Now, what can we do with �� DCC? With IPCC, we can read contents of the administrative data. We can read contents of the Measurement results section. We can also verify the XML scheme. Or is it XML schemes? Because DC is using multiple schemes and it's not an easy task to verify the scheme and we can also verify the signature? Then there's some processing like sedate since last calibration. All of these can be done by starting from scratch, but you can also start with IDCC. Now let's go ahead and start with the first example. Installing the PDC module, we can import the module in Python. Import DCC. Imports �� DCC and what I will do in particular is from. DCC so from IDC import. So DCC class. And then I would like to load an example from a file. By the way, this is a good practice example temperature which was provided by the PTP. You can download this example on the PDP website just by going to PDCC has already mentioned and go to Good Practice. Then Scroll down there and you will find this example here under Temperature. There's also some example for Humidity temperature and it is the typical temperature example here. So let's go back to our code and from there I. Will load the TCC object. So DCC from file. There are also other options from stream or from server. In this file just provides the file name and it will load it from the file. If it's successful it will create this object. Starts this example. Yeah, no output expected because we're not printing anything and also no errors happen. But anyway we can just ask if this was successfully. So if not loaded then error DC print error decision was not loaded successfully. So we don't expect any output here because this shouldn't happen. All right, good. So next step and you can see here there is DCC object and there under this PC object we find the status report with us something like a checklist with true and false flags, binary flags which you can use to. See if several things that have been checked or performed fade or not. Well, if they have been performed like in this case DC status report and we ask scheme verification performed, Was the scheme verification performed And if it was performed so say if the scheme was valid if it was not performed, so we will get this output. Here let's start this. And it says warning XML schema verification was not performed. This is because we have to initiate this scheme revocation and I say DCC object and verify KCC XML and then. I will provide I would like to provide a parameter like online is true. So this is because we have the option to provide an online scheme verification offline. Why is it like this? In my case I have Internet connection so I can do it online and there are requirements that some devices are offline in a yeah network without Internet access so they cannot reach the PTP. Software where you can get all the skin files and list of scheme files. In my case I have Internet connection So what will happen if I start this? Spider C will see what references of schemes are here like so actual DCC scheme or the SI unit scheme and it will download it and do the verification step by step on this document. And it's it's it's taste. XML scheme is valid, so we reached this point here. XML schema is valid, so the verification scheme verification was performed and the schemes were valid. This is why we reached this point here. Let's go further. What else could we do? We can ask for the document ID. So it's a DCC is a document, Digital Calibration Certificate is document and the ID in this case in this example is this. Here most likely or at least what I'm interested in is not the document ID. I would like to see if this document is for a measurement device of earth with a specific serial number. So I would ask give me the serial number for this device and I will provide a string which and the device is serial number. And then I get so serial number back like in this case. OK, so next step is. Let's get calibration date. And transcript DCC calibration date. And it will provide music calibration date. In this example it's yeah from 1957 or dated to 1957 Hertz. Makes sense or not? What I'm interesting in most likely in at least our applications, is not the date itself, but more specifically the days since last calibration. So how many days are since have passed since last calibration? Because this is important for my Q quality management system QMS. And it says yeah 24,000 days since the last calibration roughly. And a rule could look like this, I accept. I would like to recalibrate every year so I've raised 365 days and I can say OK so if it's more than 365 days which is the case here, so I will get the output. Recalibration necessary. This is what it says. Overdue, according to Quality Management System. Yeah, another thing that I can do with utilizing the report again, so the Co status report, is this document signed in, signed and it it would be signed. It's not in this case and I'm not going to into detail the signing and yeah, verifying the signature because there will be a separate video about this. In this case it's not signed on. I expecting a warning DC is not signed. OK, let's print the whole status report. And start to slip board. It's like a checklist and you have here this. You have multiple flags which most of them are true. And at this point you see OK it document is not signed, it's false. So depending on your application you can check for valid scheme was it signed and you can test if it's fits your requirements. If this document fits your requirements based on this status report. Let's finish this example. Here we have covered several topics. Here's an overview about the features that have been implemented and also some administrative tasks that we had to do in the background. We have covered reading DC from file. We have covered reading calibration date dates since last calibration readings, the item ID or verifying the DCC scheme. What we have not covered that is implemented is reading at TCC from stream, reading DCC from my repository or server. Being a compressed DCC or compressing DCC for example for constrained devices, So devices with limited resources, limited memory. There are some features more, but there's also a lot of to do. However, IDC is a good starting point if you are thinking about implementing your application for evaluating a digital calibration certificate, in particular for an HP device or maybe a cloud service. So PCC might be a very good starting point. And saying this, there's also a lot of to do by DCC is definitely not finished. It's in particular regarding the measurement results. There is need for evaluating the uncertainty and do some computations on the measurement results. There's one example in the repository addressing the measurement results and uncertainty computation. This is important if you want to make a decision automatically if your sensor. With this calibration result is suitable for specific application in a specific use case and you want to do it automatically. So therefore you need to some some computing on the measurement results and therefore there is one example but still work to do. There's a heightened risk to use adjustment function which is sometimes included in a calibration certificate and it would be a very useful feature if we can automatically use this adjustment function to make a correction on the measurement results. If you want to contribute in some way, so I ask you to read set contributing guide in our repository which is. Here. Contributing MD and saying this. Thank you for your interest in PDC and in general in the digital calibration certificate and bye bye.To view or add a comment, sign in