How is measurement uncertainty defined / calculated (of a sensor or measurement)? Textbooks and online sources often say the industry standard for uncertainty is given at a confidence interval of 95 %. This means out of 100 measurements, 95 would achieve the specified value and deviate around this value in range of the +/- uncertainty given. For example temperature sensor: states uncertainty of 1 deg C within a certain range. So 95% of the time the uncertainty is within this range.
However i am not sure how this uncertainty is calculated. Is the uncertainty 2 times standard deviation or 2 times standard error?

If for example a temperature sensor says it measures temperature with an uncertainty of +/- 1 deg C, then did the manufacturer test this sensor say a thousand times at a controlled temperature, for example 25 C, calculated the mean to be 25 C of those 1000 measurements, and then give this uncertainty as +/- 2 times standard deviation/standard error to get the final uncertainty of +/- 1 deg C ?
Here is the source of the formulas and uncertainty explanantion: https://andyjconnelly.wordpress.com/2017/05/16/uncertainty-and-repeats/
 A: The uncertainty specified by a manufacturer is not evaluated by considering a single sensor but by considering the spread across the whole production, determined both from sampling the production and by considering design parameters.
Therefore, you should not interpret the specifications as "95 % of the time the uncertainty is within this range" but "95 % of the manufactured units have an error which is within the specified uncertainty".
Note also that it's not really true that the industry standard for uncertainty is given at a confidence interval of 95 %: it may depend on the specific parameter and on the manufacturer, and in most cases manufacturers don't report information about the statistics across the production. That is, interpreting manufacturer's specification frequently needs some guesswork (and don't assume a normal distribution of the error).
For instance, have a look at the data sheet of a popular temperature sensor, the Texas Instrument LM35, you can see that the manufacturer gives three different specifications for the accuracy: typical, tested limit and design limit. In a design, forget about the typical specifications, because there's no information about which statistics these come from (are they a standard deviation, and expanded deviation, a mean, a median etc.? Who knows). Instead, the manufacturer reports, note (1), "tested Limits are ensured and 100% tested in production" and, note (2) "design Limits are ensured (but not 100% production tested) over the indicated temperature and supply voltage ranges. These limits are not used to calculate outgoing quality levels".
