Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostics and data products. Specify sigan settings and cal info captures. JSON Schema 2020-12. #42

Merged
merged 188 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
8b662cf
WIP. Added diagnostics extension, update algorithm extension with dat…
dboulware Apr 7, 2023
813005f
Corrected amplitude_bin_size and added amplitude_min/max. Java implem…
dboulware Apr 11, 2023
952f191
Add missing files.
dboulware Apr 11, 2023
f0208ab
Diagnositcs spec corrections.
dboulware Apr 11, 2023
26c04b3
spec cleanup.
dboulware Apr 12, 2023
b26f42d
note ordering in dataproducts.
dboulware Apr 18, 2023
e509cf1
minor edits
dboulware Apr 18, 2023
ead726e
make max of max channel power not required.
dboulware Apr 18, 2023
4563cb6
Fixed length getter in AmplitudeProbabilityDistribution.
dboulware Apr 19, 2023
ffe51c5
Add link to new nasctn-sea extension.
dboulware Apr 19, 2023
34761f9
nasctn-sea namespace cleanup.
dboulware Apr 19, 2023
79f2a03
cleanup
dboulware Apr 19, 2023
ca8fb0b
Sigan settings and sensor example update.
dboulware Apr 19, 2023
8f8ec37
SiganSettings cleanup
dboulware Apr 19, 2023
12bbdc3
schema update
dboulware Apr 20, 2023
409528f
Removed CalibrationAnnotation and SensorAnnotation from Java implemen…
dboulware Apr 20, 2023
f26b299
Cleanup diagnostics example.
dboulware Apr 20, 2023
fd70412
Update jar version.
dboulware Apr 20, 2023
48a329a
Update emitter geolocation description.
dboulware Apr 20, 2023
430d6fc
Global getDataFilePath -> getFilePath in Java.
dboulware Apr 20, 2023
0e2710f
getFilePath -> getFilepath
dboulware Apr 20, 2023
bb8046b
fix digitalfilter link
aromanielloNTIA Apr 20, 2023
0b87b01
markdownlint all documentation
aromanielloNTIA Apr 20, 2023
b934bdd
gnuradio/sigmf -> sigmf/SigMF in all links
aromanielloNTIA Apr 20, 2023
1f4734a
consistent datetime type documentation
aromanielloNTIA Apr 20, 2023
0b1e98c
Fix dataproducts link in algorithms extension and setFilePath -> setF…
dboulware Apr 21, 2023
0750366
Add back removed classes as deprecated.
dboulware Apr 21, 2023
08531a2
consistent doc titles
aromanielloNTIA Apr 21, 2023
be4f511
Always monospace extension names
aromanielloNTIA Apr 21, 2023
c467101
consistent formatting, define datatypes section, add collection info
aromanielloNTIA Apr 21, 2023
ae827d0
correct data type in ssd critical warning field
aromanielloNTIA Apr 21, 2023
ea15553
fix typo
aromanielloNTIA Apr 21, 2023
48c740e
fix "dBm" capitalization
aromanielloNTIA Apr 21, 2023
abcb67e
Add header_bytes field to capture object
aromanielloNTIA Apr 21, 2023
18db7d9
fix typo
aromanielloNTIA Apr 21, 2023
439ec92
typo fixes
aromanielloNTIA Apr 21, 2023
09ed26e
use all base SigMF fields in capture example
aromanielloNTIA Apr 21, 2023
d3a2412
remove rf_tray_powered from preselector diagnostics
aromanielloNTIA Apr 21, 2023
dc02cbb
remove preselector rf_tray_powered from schema
aromanielloNTIA Apr 21, 2023
49634dd
add missing set/get for scos_start_time and cpu_uptime
aromanielloNTIA Apr 21, 2023
534b078
use all fields in diagnostics example
aromanielloNTIA Apr 21, 2023
7cdcfbc
Use all ntia-scos fields in scos example
aromanielloNTIA Apr 21, 2023
37fa229
fix typo
aromanielloNTIA Apr 21, 2023
16ec5cc
move calibration, sigansettings to datatypes
aromanielloNTIA Apr 21, 2023
b2082b1
traces not used in APD object
aromanielloNTIA Apr 21, 2023
76b1bdd
APD downsampling fields not required unless downsampling
aromanielloNTIA Apr 21, 2023
e1efc56
do not require downsampling fields in APD java
aromanielloNTIA Apr 21, 2023
21a0b92
correct APD amplitude field names
aromanielloNTIA Apr 21, 2023
b7a282d
add APD probability units field to spec
aromanielloNTIA Apr 21, 2023
13bd1ab
fix markdown
aromanielloNTIA Apr 21, 2023
4fe1fe4
correct CPU clock speed field names
aromanielloNTIA Apr 21, 2023
4816b25
corrections to computer diagnostics fields
aromanielloNTIA Apr 21, 2023
d56974d
remove old drive_usage field
aromanielloNTIA Apr 21, 2023
1594a3b
setCpu -> setComputer correction
aromanielloNTIA Apr 21, 2023
01c2335
preselector internal_temp -> temp
aromanielloNTIA Apr 21, 2023
428c90b
deprecate ntia-sensor location field
aromanielloNTIA Apr 21, 2023
ba17c4e
remove incorrect ntia-sensor geolocation field
aromanielloNTIA Apr 21, 2023
ae2c115
deprecate ntia-sensor location get/set
aromanielloNTIA Apr 21, 2023
d6c7e48
remove ntia-sensor geolocation field from schema
aromanielloNTIA Apr 21, 2023
c41372f
add captures header_bytes to schema
aromanielloNTIA Apr 21, 2023
7b783d4
add UUID, deprecate lat/lon for annotations
aromanielloNTIA Apr 21, 2023
0f2a194
update annotation schema
aromanielloNTIA Apr 21, 2023
8ea9998
fix geolocation property name
aromanielloNTIA Apr 21, 2023
2df3154
add missing global fields from base SigMF
aromanielloNTIA Apr 21, 2023
f1da7dd
bring back deprecated sensor location schema
aromanielloNTIA Apr 24, 2023
e77876d
Fix Java errors.
dboulware Apr 24, 2023
fce04ce
Merge branch 'diagnostics_dataproducts' of https://github.com/NTIA/si…
dboulware Apr 24, 2023
b6c1432
Updated Jackson dependencies and schema.
dboulware Apr 24, 2023
1529f5a
remove measurement object
aromanielloNTIA Apr 24, 2023
0ebf49b
remove ntia-core measurement object in java
aromanielloNTIA Apr 24, 2023
a8f2968
Revert "remove ntia-core measurement object in java"
aromanielloNTIA Apr 24, 2023
a4f76a8
deprecate measurement object, move classification to global
aromanielloNTIA Apr 24, 2023
9daefd3
update example JSON
aromanielloNTIA Apr 24, 2023
b37012f
remove annotations, update examples
aromanielloNTIA Apr 24, 2023
af2c7d0
update ntia-environment example JSON
aromanielloNTIA Apr 24, 2023
f1c380f
update matlab readme for spec changes
aromanielloNTIA Apr 24, 2023
2f8ef67
mark fields as required based on spec documents
aromanielloNTIA Apr 24, 2023
1246953
update extensions format in example JSON
aromanielloNTIA Apr 24, 2023
203e627
Updated schema. Java updates: Improved nasctn sensor tests, corrected…
dboulware Apr 25, 2023
3841c32
update ntia-sensor datetime spec
aromanielloNTIA Apr 25, 2023
0a74793
fix markdown table formatting
aromanielloNTIA Apr 25, 2023
f30f2e0
update datetime key name in description
aromanielloNTIA Apr 25, 2023
9529fb9
update calibration object
aromanielloNTIA Apr 25, 2023
f0cbf45
add missing calibration fields to java
aromanielloNTIA Apr 25, 2023
f7ccaf1
Add sigmf data extension to filepath in getAcquisition
dboulware May 10, 2023
f77ef80
close input stream
dboulware May 11, 2023
67a1879
Add link to diagnostic extension.
dboulware May 16, 2023
1c80e5b
Add javadocs.
dboulware May 16, 2023
409f5f0
you -> your
dboulware May 16, 2023
6fdd253
Updated Extension object.
dboulware May 16, 2023
0dd199e
Add removeDigitalFilter and setDigitalFilters.
dboulware May 16, 2023
4ece3fb
Updated extension handling. Removed filepath from global to use core:…
dboulware May 16, 2023
dd5fdd7
Restore fields in deprecated SensorAnnotation. Fix typo in ScosExampl…
dboulware May 16, 2023
82d7e34
Add additional altitude support.
dboulware May 16, 2023
a161735
Delete commented out examples.
dboulware May 16, 2023
4d4118e
Replace rms and peak.
dboulware May 16, 2023
e857c04
update radar example.
dboulware May 16, 2023
23cf8ef
Removed duplicate length and reference fields from apd. Make length r…
dboulware May 16, 2023
7d72e84
Introduce AbstractUnitRequiredTraceDataProduct in Java implementation…
dboulware May 17, 2023
b89fff6
Remove redundant reference from TraceDataProduct. Reformat code and o…
dboulware May 17, 2023
05b6417
removeDetector -> removeTrace
dboulware May 17, 2023
07eb162
Serialize reference for DataProducts
dboulware May 17, 2023
a7fe8e5
Update javadocs and schema.
dboulware May 17, 2023
2784518
Refactored to make data products an array in which each object contai…
dboulware May 17, 2023
345153d
Manually created schema. Added test for schema validation.
dboulware May 18, 2023
579e368
Remove scos extension. Remove SchemaGenerator in favor of manually cr…
dboulware May 19, 2023
2063ac0
Add data_processing to schema and make data_products use Graph object…
dboulware May 23, 2023
0dbf11d
test link fix
dboulware May 23, 2023
889f2d0
test link fix
dboulware May 23, 2023
e04214a
Test link fix.
dboulware May 23, 2023
c84489e
test link fix
dboulware May 23, 2023
663f7d5
fix links in ntia-algorithm.
dboulware May 23, 2023
8f08981
Fix links.
dboulware May 23, 2023
2bd61eb
Restore scos extension to new object format.
dboulware May 23, 2023
d868235
Don't require scos entries in Global. Update schema with scos additio…
dboulware May 23, 2023
0bab23a
Add ntia-scos back into README.md.
dboulware May 23, 2023
8ac96a8
Add data products deserialization test.
dboulware May 23, 2023
6b04000
Add missing Graph, IDataProduct, IProcessing, FFT. Restore Action and…
dboulware May 23, 2023
30614e0
Fix getId in FFT. Add FFT deserialization test. Add optional descript…
dboulware May 23, 2023
9959f74
add description to fft schema definition.
dboulware May 23, 2023
75a3e4d
Restore getScheduleId implementation in Acquisition. Reformat code an…
dboulware May 23, 2023
71755a7
Refactor to group all extension objects within each extensions packag…
dboulware May 23, 2023
03abda4
Update example x-axis labels.
dboulware May 23, 2023
e89143f
Add support to pass in the entire x or y-axis into a Graph.
dboulware May 23, 2023
137936e
Removed depracated classes and properties.
dboulware May 24, 2023
4819691
remove deprecated.
dboulware May 24, 2023
f50e241
Removed duplicate lines.
dboulware May 25, 2023
6ee8779
update ntia-algorithm spec
aromanielloNTIA May 25, 2023
1cc8e81
Allow x and y axes to both be specified in Graphs
aromanielloNTIA May 25, 2023
2485299
json example formatting
aromanielloNTIA May 25, 2023
d756c10
update java for ntia-algorithm changes
aromanielloNTIA May 25, 2023
8375608
remove support for undocumented fields
aromanielloNTIA May 25, 2023
4d7c2a0
Update RadarExample.java
aromanielloNTIA May 25, 2023
ceb75be
fix java errors, update gitignore
aromanielloNTIA May 25, 2023
d90db25
update sensor ID and rf path ID handling in spec
aromanielloNTIA May 25, 2023
6d87ecc
Jave updates for sensor and rf path ID
aromanielloNTIA May 25, 2023
834f7f5
update examples and tests
aromanielloNTIA May 25, 2023
5efd09f
Update .gitignore
aromanielloNTIA May 25, 2023
ae4f1a3
update example metadata file
aromanielloNTIA May 25, 2023
125e226
Replace ArrayLists with Lists and remove old DigitalFilter related me…
dboulware May 25, 2023
c9eb1aa
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
aromanielloNTIA May 25, 2023
a75aa06
update and format JSON schema
aromanielloNTIA May 25, 2023
a5f5c4a
update javadocs
aromanielloNTIA May 25, 2023
e95eaa1
fix global schedule and action JsonProperties.
dboulware May 25, 2023
e182ca8
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
dboulware May 25, 2023
8eebd97
fix typo
aromanielloNTIA May 25, 2023
af223a4
Update version number in MATLAB docs example
aromanielloNTIA May 25, 2023
f116d68
Add all missing NotNull
aromanielloNTIA May 26, 2023
da0d844
fix ntia-algorithm global objects implementation
aromanielloNTIA May 26, 2023
383b659
Fix Schema.
dboulware May 26, 2023
e5002bd
update core SigMF version to 1.0.0 and update example JSON
aromanielloNTIA May 26, 2023
8d41f12
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
aromanielloNTIA May 26, 2023
850d924
Fix amplifier max power units
aromanielloNTIA May 26, 2023
0c33a7f
Add missing Valid annotations.
dboulware May 26, 2023
0b9a446
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
dboulware May 26, 2023
22ab4b4
fix ENR type in calsource object
aromanielloNTIA May 26, 2023
086cd13
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
aromanielloNTIA May 26, 2023
b209932
Introduce IBaseband to distinguish data products that may produce res…
dboulware May 26, 2023
99bc78d
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
dboulware May 26, 2023
4cb6b1c
Allow Graph to support different types for x and y axes. Update javadoc.
dboulware May 26, 2023
f43f52e
Add missing objects to datatypes table
aromanielloNTIA May 31, 2023
ab1d7f6
nasctn sea types to double[] from list<double>, add emitter helpers
aromanielloNTIA May 31, 2023
4884bae
Delete Filter.java from SCOS extension
aromanielloNTIA May 31, 2023
6c9a884
revert nasctn sea objects to List<Double> from Double[]
aromanielloNTIA May 31, 2023
d6a41d9
remove unique SensorCalibration and SiganCalibration classes
aromanielloNTIA May 31, 2023
9299cc0
Add Calibration and SiganSettings to schema
aromanielloNTIA May 31, 2023
7b567d7
Update examples
aromanielloNTIA May 31, 2023
7bf194e
update waveform example file name, remove unused import
aromanielloNTIA May 31, 2023
5234fa2
remove RadarExample
aromanielloNTIA May 31, 2023
57a7205
Revert "remove unique SensorCalibration and SiganCalibration classes"
aromanielloNTIA May 31, 2023
cbf7f57
update example to use SensorCalibration and SiganCalibration
aromanielloNTIA May 31, 2023
ccdd76f
update CaptureExample to use SensorCalibration
aromanielloNTIA May 31, 2023
c49cd7a
Remove unused imports
aromanielloNTIA May 31, 2023
6027248
add helpers to add/remove extensions to global
aromanielloNTIA May 31, 2023
e4b3036
Remove SensorCapture
aromanielloNTIA May 31, 2023
affd8b9
fix invalid and incomplete JSON
aromanielloNTIA May 31, 2023
e1e54b3
Fix typos in schema
dboulware May 31, 2023
71b3108
Add extensions objects to example generators
aromanielloNTIA May 31, 2023
736c113
Add helpers for schedule entry role add/remove
aromanielloNTIA May 31, 2023
9c8f90b
update examples
aromanielloNTIA May 31, 2023
541c283
Merge branch 'diagnostics_dataproducts_graphs' of https://github.com/…
aromanielloNTIA May 31, 2023
3a39c8e
Added missing @JsonInclude(JsonInclude.Include.NON_NULL) annotations …
dboulware Jun 1, 2023
1f5b1ab
add setCoordinates to GeoJsonPoint and update Javadocs.
dboulware Jun 1, 2023
848eb1f
Fix typo
dboulware Jun 5, 2023
ad18c04
Update hardware spec and antenna links. Fix cpu_uptime type in spec. …
dboulware Jun 5, 2023
688c591
Remove xstart, xstop, xstep, ystart, ystep, ystop and duplicate units…
dboulware Jun 5, 2023
4c55587
Restore getActionName in Acquisition and update Javadocs.
dboulware Jun 6, 2023
be79c3f
Fix scos_start in schema.
dboulware Jun 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,8 @@ fabric.properties
/dist/
/nbdist/
/.nb-gradle/

# gradle/intellij from java folder
java/.gradle
java/.idea
java/bin
132 changes: 56 additions & 76 deletions Matlab/README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,91 @@
# SigMF-NS-NTIA in Matlab

Working with the SigMF-NS-NTIA SigMF extensions in Matlab can be made much easier by using the Java libraries within this repository. The guide below provides useful tips to interact with the Java implementation of the SigMF-NS-NTIA extension within Matlab.
## Tips for using the SigMF-NS-NTIA Java implementation with Matlab.
Working with the SigMF-NS-NTIA SigMF extensions in Matlab can be made much easier by using the Java libraries within this repository. The guide below provides useful tips to interact with the Java implementation of the SigMF-NS-NTIA extension within Matlab.

## Tips for using the SigMF-NS-NTIA Java implementation with Matlab

The jar file is available for download in the GitHub [packages page](https://github.com/orgs/NTIA/packages?repo_name=sigmf-ns-ntia) of this repository.

### 1. Add the SigMF-NS_NTIA Jar file to Matlab

There are several alternative ways to add the jar file to Matlab.
There are several alternative ways to add the jar file to Matlab.

#### 1.1 Adding the jar file temporarily
#### 1.1 Adding the jar file temporarily

Adding the jar file to the dynamic path allows you to add the jar file to only you current session of Matlab. To add the jar file only to the current session, execute the following command in Matlab after replacing the path to the jar file with the path to the jar file on your computer.
Adding the jar file to the dynamic path allows you to add the jar file to only your current session of Matlab. To add the jar file only to the current session, execute the following command in Matlab after replacing the path to the jar file with the path to the jar file on your computer.

`javaclasspath({'C:\Users\dboulware\Documents\sigmf-ns-ntia\sigmf-ns-ntia\java\build\libs\sigmf-ns-ntia-0.0.4-SNAPSHOT.jar'});`
```matlab
javaclasspath({'C:\path\to\sigmf-ns-ntia-2.0.0.jar'});
```

#### 1.2 Adding the jar to the static path

#### 1.1 Adding the jar to the static path
Adding the jar file to Matlab's static path will allow the library to be used at anytime in Matlab. Add the jar to the Matlab's static path by: <br/>
Adding the jar file to Matlab's static path will allow the library to be used at anytime in Matlab. Add the jar to the Matlab's static path by:

1. Execute the `prefdir` command in Matlab to identify your preferences directory.
2. Close Matlab.
3. Go to your preferences directory identified by the above command and create an ASCII text file named `javaclasspath.txt`.
4. Add the full path to the `sigmf-ns-ntia` jar to the `javaclasspath.txt` file
5. Now you should be able to start and use the simf-ns-ntia java library from within Matlab as detailed below.

### Using the Java library from within Matlab

This section provides examples of the common ways to interact with the `sigmf-ns-ntia` java library within Matlab.

#### Java library Overview

The `sigmf-ns-ntia` java library consists of a number classes that define an object oriented approach to modeling the `sigmf-ns-ntia` extensions to SigMF. As such, to get and set values within the SigMF you will primarily be creating instances of the different objects defined within the library and calling various get and set methods on those objects to get and set the various values. In Java, classes can be organized into a set of packages and the `sigmf-ns-ntia` library is organized in packages that mimic the extensions defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia). The base package in the java library is `gov.doc.ntia.sigmf` so all objects you utilize will begin with `gov.doc.ntia.sigmf`. The `gov.doc.ntia.sigmf.ext.global` package includes subpackages to organize the global objects defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia) and `gov.doc.ntia.sigmf.ext.annotation` package includes subpackages to organize the annoation extensions defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia). The table below shows the mapping between Java packages and the extensions defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia)

|Package|Extension|Description|
|----|--------|-----------|
|`gov.doc.ntia.sigmf`|NA|Contains the objects that are part of the core [SigMF](https://github.com/gnuradio/SigMF/blob/master/sigmf-spec.md), including: `MetaDoc`, `Global`, and `Annotation`.|
|`gov.doc.ntia.sigmf.ext.global.algorithm`|[ntia-algorithm](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-algorithm.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-algorithm](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-algorithm.sigmf-ext.md) including `DigitalFilter`|
|`gov.doc.ntia.sigmf.ext.global.core`|[ntia-core](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-core.sigmf-ext.md)|Contains objects to represent global objects defined in [ntia-core](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-core.sigmf-ext.md) including `Measurement`, `Antenna`, and `HardwareSpec`|
|`gov.doc.ntia.sigmf.ext.global.emitter`|[ntia-emitter](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-emitter.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-emitter](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-emitter.sigmf-ext.md) including `Emitter`.|
|`gov.doc.ntia.sigmf.ext.global.environment`|[ntia-environment](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-environment.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-environment](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-environment.sigmf-ext.md) including `Environment`|
|`gov.doc.ntia.sigmf.ext.global.location`|[ntia-location](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-location.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-location](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-location.sigmf-ext.md) including `GeographicCoordinateSystem`, `ProjectedCoordinateSystem`, `Datum`, `Spheroid`, and `Location`|
|`gov.doc.ntia.sigmf.ext.global.sensor`|[ntia-sensor](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-sensor.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-sensor](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-sensor.sigmf-ext.md) including `Sensor`, `Preselector`, `SignalAnalyzer`, `Amplifier`, `Filter`, `CalSource` and `RFPath`|
|`gov.doc.ntia.sigmf.ext.global.waveform`|[ntia-waveform](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-waveform.sigmf-ext.md)|Contains objects to represent the global objects defined in [ntia-waveform](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-waveform.sigmf-ext.md) including `Waveform` and `IEEE80211p`|
|`gov.doc.ntia.sigmf.ext.annotation.algorithm`|[ntia-algorithm](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-algorithm.sigmf-ext.md)|Contains objects to represent the annotation objects defined in [ntia-algorithm](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-algorithm.sigmf-ext.md) including `TimeDomainDetection`, `FrequencyDomainDetection`, and `DigitalFilterAnnotation`|
|`gov.doc.ntia.sigmf.ext.annotation.sensor`|[ntia-sensor](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-sensor.sigmf-ext.md)|Contains objects to represent the annotation objects defined in [ntia-sensor](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-sensor.sigmf-ext.md) including `SensorAnnotation` and `CalibrationAnnotation`|


#### Using the Java library
### 2. Using the Java library from within Matlab

This section provides examples of the common ways to interact with the `sigmf-ns-ntia` java library within Matlab.

#### 2.1 Java library Overview

The `sigmf-ns-ntia` Java library consists of a number classes that define an object oriented approach to modeling the `sigmf-ns-ntia`
extensions to SigMF. As such, to get and set values within the SigMF you will primarily be creating instances of the
different objects defined within the library and calling various get and set methods on those objects to get and set
the various values. In Java, classes can be organized into a set of packages and the `sigmf-ns-ntia` library is
organized in packages that mimic the extensions defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia). The
base package in the Java library is `gov.doc.ntia.sigmf` so all objects you utilize will begin with `gov.doc.ntia.sigmf`.
The `gov.doc.ntia.sigmf.ext` package includes subpackages for each extension in
[sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia). The table below shows the mapping between Java packages and
the extensions defined in [sigmf-ns-ntia](https://github.com/NTIA/sigmf-ns-ntia). Extensions to the global object are
provided directly in the `gov.doc.ntia.sigmf.Global` class.

| Package |Extension|
|------------------------------------------|--------|
| `gov.doc.ntia.sigmf` |Base [SigMF](https://github.com/sigmf/SigMF/blob/sigmf-v1.x/sigmf-spec.md)|
| `gov.doc.ntia.sigmf.ext.algorithm` |[`ntia-algorithm`](../ntia-algorithm.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.core` |[`ntia-core`](../ntia-core.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.diagnostics` |[`ntia-diagnostics`](../ntia-diagnostics.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.emitter` |[`ntia-emitter`](../ntia-emitter.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.environment` |[`ntia-environment`](../ntia-environment.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.scos` |[`ntia-scos`](../ntia-scos.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.sensor` |[`ntia-sensor`](../ntia-sensor.sigmf-ext.md)|
| `gov.doc.ntia.sigmf.ext.waveform` |[`ntia-waveform`](../ntia-waveform.sigmf-ext.md)|

#### 2.2 Using the Java library

Utilizing the Java library from within Matlab mostly requires you to create instances of the objects and use the set and get methods on those objects to set or get the value of interest. Creating an instance of a Java object is as simple as calling the constructor with the full name (including the package) of the class as shown in the example below. Note: as shown below, certain types like long and double require you specify them as their java type.

```
```matlab
metaDoc = gov.doc.ntia.sigmf.MetaDoc();
globalExample = gov.doc.ntia.sigmf.Global();
sensor = gov.doc.ntia.sigmf.ext.global.sensor.Sensor();
antenna = gov.doc.ntia.sigmf.ext.global.core.Antenna();
sensor = gov.doc.ntia.sigmf.ext.sensor.Sensor();
antenna = gov.doc.ntia.sigmf.ext.core.Antenna();

setType(antenna, "dipole");
setGain(antenna, java.lang.Double(7));
hardwareSpec = gov.doc.ntia.sigmf.ext.global.core.HardwareSpec();
hardwareSpec = gov.doc.ntia.sigmf.ext.core.HardwareSpec();
setModel(hardwareSpec, "ARA CSB-16");
setId(hardwareSpec, "antenna_1");
setAntennaSpec(antenna, hardwareSpec);

setId(sensor, "greyhound-1");
setAntenna(sensor, antenna);

detection = gov.doc.ntia.sigmf.ext.annotation.algorithm.FrequencyDomainDetection();
setDetector(detection, "fft_mean_power");
setNumberOfFfts(detection, 1024);
setNumberOfSamplesInFft(detection, 1024);
setWindow(detection, "blackman-harris");
setSampleStart(detection, java.lang.Long(0));
setSampleCount(detection, java.lang.Long(1024));

setSensor(globalExample, sensor);
setGlobal(metaDoc, globalExample);

saveToFile(metaDoc, "C:\Users\dboulware\Documents\sigmf-ns-ntia\example.json");


saveToFile(metaDoc, "C:\path\to\example.json");
```

Now, if we open the file we will see the following:
```

```json
{
"global": {
"ntia-sensor:sensor": {
Expand All @@ -97,37 +100,14 @@ Now, if we open the file we will see the following:
}
}
},
"captures": [

],
"annotations": [
{
"ntia-core:annotation_type": "FrequencyDomainDetection",
"core:sample_start": 0,
"core:sample_count": 1024,
"ntia-algorithm:detector": "fft_mean_power",
"ntia-algorithm:number_of_ffts": 1024,
"ntia-algorithm:number_of_samples_in_fft": 1024,
"ntia-algorithm:window": "blackman-harris"
}
]
"captures": [],
"annotations": []
}

```
Finally, if we simply wanted to read the example.json in Matlab we would use the static read method provided by the SigMfReader class. Because it is a static method you must call it slightly differently, as shown below:


`readMetaDoc = javaMethod('read', 'gov.doc.ntia.sigmf.SigMfReader',' 'C:\Users\dboulware\Documents\sigmf-ns-ntia\example.json');`












Finally, if we simply wanted to read the `example.json` in Matlab we would use the static read method provided by the `SigMfReader` class. Because it is a static method you must call it slightly differently, as shown below:

```matlab
readMetaDoc = javaMethod('read', 'gov.doc.ntia.sigmf.SigMfReader', 'C:\path\to\example.json');
```
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# SigMF-NS-NTIA

This Signal Metadata Format [SigMF](https://github.com/gnuradio/SigMF) namespace extension describes the National
This Signal Metadata Format [SigMF](https://github.com/sigmf/SigMF) namespace extension describes the National
Telecommunications and Information Administration (NTIA)'s open data format for
recorded signal datasets.

## Introduction

SigMF is a simple, extensible standard for
storing recorded signal datasets. The
[Introduction](https://github.com/gnuradio/SigMF/blob/master/sigmf-spec.md#introduction)
[Introduction](https://github.com/sigmf/SigMF/blob/sigmf-v1.x/sigmf-spec.md#introduction)
to the core specification document explains why such a standard is useful:

> Sharing sets of recorded signal data is an important part of science and engineering. It enables multiple parties to collaborate, is often a necessary part of reproducing scientific results (a requirement of scientific rigor), and enables sharing data with those who do not have direct access to the equipment required to capture it.

>
> Unfortunately, these datasets have historically not been very portable, and there is not an agreed upon method of sharing metadata descriptions of the recorded data itself. This is the problem that SigMF solves.

>
> By providing a standard way to describe data recordings, SigMF facilitates the sharing of data, prevents the "bitrot" of datasets wherein details of the capture are lost over time, and makes it possible for different tools to operate on the same dataset, thus enabling data portability between tools and workflows.

At NTIA, we have traditionally used several proprietary or internally-designed
Expand All @@ -25,10 +25,10 @@ extensions to the core SigMF specification.

- [`ntia-algorithm`](ntia-algorithm.sigmf-ext.md) describes the measurement performed (detectors, algorithms, etc)
- [`ntia-core`](ntia-core.sigmf-ext.md) adds generally useful metadata fields
- [`ntia-diagnostics`](ntia-diagnostics.sigmf-ext.md) provides metadata to describe system diagnostic information.
- [`ntia-emitter`](ntia-emitter.sigmf-ext.md) gives information about the emitter being measured
- [`ntia-environment`](ntia-environment.sigmf-ext.md) gives information about the environment around a sensor or emitter
- [`ntia-location`](ntia-location.sigmf-ext.md) gives information about the types of coordinate systems used in the metadata.
- [`ntia-scos`](ntia-scos.sigmf-ext.md) provides metadata for the NTIA Spectrum Characterization and Occupancy Sensing (SCOS) implementation
- [`ntia-nasctn-sea`](ntia-nasctn-sea.sigmf-ext.md) provides metadata used within NASCTN Sharing Ecosystem Assessment project.
- [`ntia-scos`](ntia-scos.sigmf-ext.md) provides metadata for the NTIA Spectrum Characterization and Occupancy Sensing (SCOS) implementation
- [`ntia-sensor`](ntia-sensor.sigmf-ext.md) defines hardware components and settings
- [`ntia-waveform`](ntia-waveform.sigmf-ext.md) provides metadata to describe measured or transmitted waveforms

9 changes: 4 additions & 5 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def versions = [
def archiveBaseName= 'sigmf-ns-ntia'

group = 'gov.doc.ntia'
version = '1.0.1'
version = '2.0.0'

sourceCompatibility = 1.8

Expand All @@ -28,11 +28,10 @@ configurations {
}

dependencies {
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
implementation 'com.fasterxml.jackson.module:jackson-module-jsonSchema:2.9.0'
implementation 'com.kjetland:mbknor-jackson-jsonschema_2.12:1.0.36'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
implementation 'org.springframework.data:spring-data-commons-core:1.4.1.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.0'
implementation 'commons-io:commons-io:2.5'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
Expand Down
Loading