From 5d1c0b6d129733db0eb7a097b297725c5e62382f Mon Sep 17 00:00:00 2001 From: Jacob Gilbert Date: Thu, 12 Jan 2023 09:55:45 -0700 Subject: [PATCH] adding UUID to annotations --- sigmf-spec.md | 2 ++ sigmf/schema-meta.json | 6 ++++++ sigmf/sigmffile.py | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sigmf-spec.md b/sigmf-spec.md index 586907ba..97df3257 100644 --- a/sigmf-spec.md +++ b/sigmf-spec.md @@ -39,6 +39,7 @@ Copyright of contributions to SigMF are retained by their original authors. All - [Annotations Array](#annotations-array) - [Annotation Segment Objects](#annotation-segment-objects) - [SigMF Collection Format](#sigmf-collection-format) + - [SigMF Recording Objects](#sigmf-recording-objects) - [Licensing](#licensing) - [SigMF Compliance](#sigmf-compliance) - [SigMF Schema Compliance](#sigmf-schema-compliance) @@ -630,6 +631,7 @@ Segment Objects: | `comment` | false | string | A human-readable comment. | | `freq_lower_edge` | false | double | The frequency (Hz) of the lower edge of the feature described by this annotation. | | `freq_upper_edge` | false | double | The frequency (Hz) of the upper edge of the feature described by this annotation. | +| `uuid` | false | string | A RFC-4122 compliant UUID string of the form `xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx`.| | `latitude` | false | | The latitude corresponding to the annotation (DEPRECATED, use `core:geolocation`). | | `longitude` | false | | The longitude corresponding to the annotation (DEPRECATED, use `core:geolocation`). | diff --git a/sigmf/schema-meta.json b/sigmf/schema-meta.json index 93d5aa3a..3282958c 100644 --- a/sigmf/schema-meta.json +++ b/sigmf/schema-meta.json @@ -281,6 +281,12 @@ "description": "The sample index at which this Segment takes effect.", "minimum": 0, "type": "integer" + }, + "core:uuid": { + "$id": "#/properties/annotations/items/anyOf/0/properties/core%3Auuid", + "description": "RFC-4122 unique identifier.", + "maxLength": 36, + "type": "string" } }, "additionalProperties": true diff --git a/sigmf/sigmffile.py b/sigmf/sigmffile.py index ee35d047..18e49392 100644 --- a/sigmf/sigmffile.py +++ b/sigmf/sigmffile.py @@ -130,6 +130,7 @@ class SigMFFile(SigMFMetafile): DATETIME_KEY = "core:datetime" LAT_KEY = "core:latitude" LON_KEY = "core:longitude" + UUID_KEY = "core:uuid" GEOLOCATION_KEY = "core:geolocation" COLLECTION_KEY = "core:collection" GLOBAL_KEY = "global" @@ -142,7 +143,8 @@ class SigMFFile(SigMFMetafile): ] VALID_CAPTURE_KEYS = [DATETIME_KEY, FREQUENCY_KEY, HEADER_BYTES_KEY, GLOBAL_INDEX_KEY, START_INDEX_KEY] VALID_ANNOTATION_KEYS = [ - COMMENT_KEY, FHI_KEY, FLO_KEY, GENERATOR_KEY, LABEL_KEY, LAT_KEY, LENGTH_INDEX_KEY, LON_KEY, START_INDEX_KEY + COMMENT_KEY, FHI_KEY, FLO_KEY, GENERATOR_KEY, LABEL_KEY, LAT_KEY, LENGTH_INDEX_KEY, LON_KEY, START_INDEX_KEY, + UUID_KEY ] VALID_KEYS = {GLOBAL_KEY: VALID_GLOBAL_KEYS, CAPTURE_KEY: VALID_CAPTURE_KEYS, ANNOTATION_KEY: VALID_ANNOTATION_KEYS}