Re: [core] [Last-Call] Last Call: <draft-ietf-core-senml-more-units-02.txt> (Additional Units for SenML) to Proposed Standard

Carsten Bormann <cabo@tzi.org> Thu, 31 October 2019 08:36 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 09464120876 for <core@ietfa.amsl.com>; Thu, 31 Oct 2019 01:36:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VFT6fYIR8uh9 for <core@ietfa.amsl.com>; Thu, 31 Oct 2019 01:36:54 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 32D8D120864 for <core@ietf.org>; Thu, 31 Oct 2019 01:36:54 -0700 (PDT)
Received: from client-0140.vpn.uni-bremen.de (client-0140.vpn.uni-bremen.de [134.102.107.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 473dwJ4L3DzywV; Thu, 31 Oct 2019 09:36:47 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <AM6PR0602MB3368610C8BAD09D5E938C2BEF5630@AM6PR0602MB3368.eurprd06.prod.outlook.com>
Date: Thu, 31 Oct 2019 09:36:31 +0100
Cc: core <core@ietf.org>
X-Mao-Original-Outgoing-Id: 594203789.584443-4faba0252243bc10d5aecee509e3914e
Content-Transfer-Encoding: quoted-printable
Message-Id: <99D083F4-ED5F-4822-A517-142EC10A5349@tzi.org>
References: <41C0F8EE-6A11-4B07-BA18-7DE106F03183@episteme.net> <CEE49F5A-E7FE-4933-BF68-E1A2EA8CEC62@ericsson.com> <DF78FB17-0DDA-471E-A28A-15AC0718F653@iii.ca> <AM6PR0602MB3368610C8BAD09D5E938C2BEF5630@AM6PR0602MB3368.eurprd06.prod.outlook.com>
To: Hytonen Harri <harri.hytonen@vaisala.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/wqqpBcRc4HTxSM5ai-DPb-PONNA>
Subject: Re: [core] [Last-Call] Last Call: <draft-ietf-core-senml-more-units-02.txt> (Additional Units for SenML) to Proposed Standard
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 31 Oct 2019 08:36:57 -0000

(Limiting CC list to CoRE WG:)

> On Oct 31, 2019, at 08:17, Hytonen Harri <harri.hytonen@vaisala.com> wrote:
> 
> As explained before, it's not matter of saving floating point calculations, but preserving the original precision of the measurement. 

I think this is an interesting statement.
This certainly was not the reason why we were going for the secondary units (as Ari said, these are about support for legacy data models).
But I’m still curious how, say, expressing precipitation in mm/h is preserving the precision better than expressing it in m/s after scaling it by 3.6e6.  Sure, that floating point calculation has a rounding error, but that will usually be on the order of 1/2**24 (or 1/2**53 if your sensor has double precision floating point), while the instrument resolution is likely on the order of 1/2**10 or 1/2**12 (as you can see, I know nothing about precipitation sensors).

Note that formats such as CBOR or JSON cannot *indicate* precision or accuracy (or uncertainty in general) within a single number; there is no way to say what conventionally is written down as 8.0 vs. 8.000 (even in JSON, where both forms can be written, these have exactly the same semantics).  So that would be a separate issue (easily addressed by putting information about the uncertainty into separate numbers, often in the metadata as it often doesn’t change between measurements).

Note also that the terminology here often requires clarification or explicit referencing; e.g., IEEE 754 uses “precision” essentially for “resolution”, not for “precision” as used in metrology(*) (which is essentially “repeatability” and “reproducibility” in the VIM [1]).

Grüße, Carsten

[1]: https://www.bipm.org/utils/common/documents/jcgm/JCGM_200_2008.pdf
“International vocabulary of metrology — Basic and general concepts and associated terms (VIM)”

(*) applying metrology to meteorology sensors :-)