Skip to content

Commit

Permalink
adding UUID to annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Gilbert authored and jacobagilbert committed Jan 16, 2023
1 parent 3b69e03 commit 5d1c0b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sigmf-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`). |

Expand Down
6 changes: 6 additions & 0 deletions sigmf/schema-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion sigmf/sigmffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}

Expand Down

0 comments on commit 5d1c0b6

Please sign in to comment.