Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Jul 28, 2022
1 parent d8baa83 commit c0aefe9
Show file tree
Hide file tree
Showing 6 changed files with 338 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<h3 align="center">

![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=release/1.3.1)
![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=develop)
[![NuGet](https://img.shields.io/nuget/vpre/DotNetStac)](https://www.nuget.org/packages/DotNetStac/)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/release/1.3.1/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/develop/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![Gitter](https://img.shields.io/gitter/room/SpatioTemporal-Asset-Catalog/Lobby?color=yellow)](https://gitter.im/SpatioTemporal-Asset-Catalog/Lobby)
[![License](https://img.shields.io/badge/license-AGPL3-blue.svg)](LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Terradue/DotNetStac/master?filepath=example.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac.Test/Catalog/CatalogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void CanDeserializeMinimalSample()

ValidateJson(json);

var catalog = StacConvert.Deserialize<StacCatalog>(json);
var catalog = JsonConvert.DeserializeObject<StacCatalog>(json);

Assert.NotNull(catalog);

Expand Down
8 changes: 8 additions & 0 deletions src/DotNetStac.Test/Collection/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,13 @@ public void UpdateCollection()
JsonAssert.AreEqual(expectedJson, actualJson);
}

[Fact]
public void CollectionSentinel1()
{
var simpleJson = GetJson("Collection", "sentinel-1-grd");
ValidateJson(simpleJson);
StacCollection simpleCollection = StacConvert.Deserialize<StacCollection>(simpleJson);
}

}
}
11 changes: 11 additions & 0 deletions src/DotNetStac.Test/Item/ItemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,16 @@ public void NullGeometry()
Assert.Throws<InvalidStacDataException>(() => ValidateJson(json));

}

[Fact]
public void EmptyProviders()
{
var json = GetJson("Item");

var item = StacConvert.Deserialize<StacItem>(json);

Assert.NotNull(item.Providers);

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
{
"id": "sentinel-1-grd",
"type": "Collection",
"links": [
{
"rel": "license",
"href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice",
"title": "Copernicus Sentinel data terms"
}
],
"title": "Sentinel 1 Level-1 Ground Range Detected (GRD)",
"assets": {
"thumbnail": {
"href": "https://ai4edatasetspublicassets.blob.core.windows.net/assets/pc_thumbnails/sentinel-1-grd.png",
"type": "image/png",
"roles": [
"thumbnail"
],
"title": "Sentinel 1 GRD"
}
},
"extent": {
"spatial": {
"bbox": [
[
-180,
-90,
180,
90
]
]
},
"temporal": {
"interval": [
[
"2014-10-10T00:28:21Z",
null
]
]
}
},
"license": "proprietary",
"keywords": [
"ESA",
"Copernicus",
"Sentinel",
"C-Band",
"SAR",
"GRD"
],
"providers": [
{
"url": "https://earth.esa.int/web/guest/home",
"name": "ESA",
"roles": [
"producer",
"processor",
"licensor"
]
}
],
"summaries": {
"platform": [
"SENTINEL-1A",
"SENTINEL-1B"
],
"constellation": [
"Sentinel-1"
],
"sar:looks_range": [
5,
6,
3,
2
],
"sat:orbit_state": [
"ascending",
"descending"
],
"sar:product_type": [
"GRD"
],
"sar:looks_azimuth": [
1,
6,
2
],
"sar:polarizations": [
[
"VV",
"VH"
],
[
"HH",
"HV"
],
[
"VV"
],
[
"VH"
],
[
"HH"
],
[
"HV"
]
],
"sar:frequency_band": [
"C"
],
"sar:instrument_mode": [
"IW",
"EW",
"SM"
],
"sar:center_frequency": [
5.405
],
"sar:resolution_range": [
20,
23,
50,
93,
9
],
"sar:resolution_azimuth": [
22,
23,
50,
87,
9
],
"sar:pixel_spacing_range": [
10,
25,
40,
3.5
],
"sar:observation_direction": [
"right"
],
"sar:pixel_spacing_azimuth": [
10,
25,
40,
3.5
],
"sar:looks_equivalent_number": [
4.4,
29.7,
2.7,
10.7,
3.7
],
"sat:platform_international_designator": [
"2014-016A",
"2016-025A",
"0000-000A"
]
},
"description": "The [Sentinel-1](https://sentinel.esa.int/web/sentinel/missions/sentinel-1) mission is a constellation of two polar-orbiting satellites, operating day and night performing C-band synthetic aperture radar imaging. The Level-1 Ground Range Detected (GRD) products in this Collection consist of focused SAR data that has been detected, multi-looked and projected to ground range using the Earth ellipsoid model WGS84. The ellipsoid projection of the GRD products is corrected using the terrain height specified in the product general annotation. The terrain height used varies in azimuth but is constant in range (but can be different for each IW/EW sub-swath).\n\nGround range coordinates are the slant range coordinates projected onto the ellipsoid of the Earth. Pixel values represent detected amplitude. Phase information is lost. The resulting product has approximately square resolution pixels and square pixel spacing with reduced speckle at a cost of reduced spatial resolution.\n\nFor the IW and EW GRD products, multi-looking is performed on each burst individually. All bursts in all sub-swaths are then seamlessly merged to form a single, contiguous, ground range, detected image per polarization.\n\nFor more information see the [ESA documentation](https://sentinel.esa.int/web/sentinel/user-guides/sentinel-1-sar/product-types-processing-levels/level-1)\n\n### Terrain Correction\n\nUsers might want to geometrically or radiometrically terrain correct the Sentinel-1 GRD data from this collection. The [Sentinel-1-RTC Collection](https://planetarycomputer.microsoft.com/dataset/sentinel-1-rtc) collection is a global radiometrically terrain corrected dataset derived from Sentinel-1 GRD. Additionally, users can terrain-correct on the fly using [any DEM available on the Planetary Computer](https://planetarycomputer.microsoft.com/catalog?tags=DEM). See [Customizable radiometric terrain correction](https://planetarycomputer.microsoft.com/docs/tutorials/customizable-rtc-sentinel1/) for more.",
"item_assets": {
"hh": {
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
"roles": [
"data"
],
"title": "HH: horizontal transmit, horizontal receive",
"description": "Amplitude of signal transmitted with horizontal polarization and received with horizontal polarization with radiometric terrain correction applied."
},
"hv": {
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
"roles": [
"data"
],
"title": "HV: horizontal transmit, vertical receive",
"description": "Amplitude of signal transmitted with horizontal polarization and received with vertical polarization with radiometric terrain correction applied."
},
"vh": {
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
"roles": [
"data"
],
"title": "VH: vertical transmit, horizontal receive",
"description": "Amplitude of signal transmitted with vertical polarization and received with horizontal polarization with radiometric terrain correction applied."
},
"vv": {
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
"roles": [
"data"
],
"title": "VV: vertical transmit, vertical receive",
"description": "Amplitude of signal transmitted with vertical polarization and received with vertical polarization with radiometric terrain correction applied."
},
"thumbnail": {
"type": "image/png",
"roles": [
"thumbnail"
],
"title": "Preview Image",
"description": "An averaged, decimated preview image in PNG format. Single polarisation products are represented with a grey scale image. Dual polarisation products are represented by a single composite colour image in RGB with the red channel (R) representing the co-polarisation VV or HH), the green channel (G) represents the cross-polarisation (VH or HV) and the blue channel (B) represents the ratio of the cross an co-polarisations."
},
"safe-manifest": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Manifest File",
"description": "General product metadata in XML format. Contains a high-level textual description of the product and references to all of product's components, the product metadata, including the product identification and the resource references, and references to the physical location of each component file contained in the product."
},
"schema-noise-hh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Noise Schema",
"description": "Estimated thermal noise look-up tables"
},
"schema-noise-hv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Noise Schema",
"description": "Estimated thermal noise look-up tables"
},
"schema-noise-vh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Noise Schema",
"description": "Estimated thermal noise look-up tables"
},
"schema-noise-vv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Noise Schema",
"description": "Estimated thermal noise look-up tables"
},
"schema-product-hh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Product Schema",
"description": "Describes the main characteristics corresponding to the band: state of the platform during acquisition, image properties, Doppler information, geographic location, etc."
},
"schema-product-hv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Product Schema",
"description": "Describes the main characteristics corresponding to the band: state of the platform during acquisition, image properties, Doppler information, geographic location, etc."
},
"schema-product-vh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Product Schema",
"description": "Describes the main characteristics corresponding to the band: state of the platform during acquisition, image properties, Doppler information, geographic location, etc."
},
"schema-product-vv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Product Schema",
"description": "Describes the main characteristics corresponding to the band: state of the platform during acquisition, image properties, Doppler information, geographic location, etc."
},
"schema-calibration-hh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Calibration Schema",
"description": "Calibration metadata including calibration information and the beta nought, sigma nought, gamma and digital number look-up tables that can be used for absolute product calibration."
},
"schema-calibration-hv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Calibration Schema",
"description": "Calibration metadata including calibration information and the beta nought, sigma nought, gamma and digital number look-up tables that can be used for absolute product calibration."
},
"schema-calibration-vh": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Calibration Schema",
"description": "Calibration metadata including calibration information and the beta nought, sigma nought, gamma and digital number look-up tables that can be used for absolute product calibration."
},
"schema-calibration-vv": {
"type": "application/xml",
"roles": [
"metadata"
],
"title": "Calibration Schema",
"description": "Calibration metadata including calibration information and the beta nought, sigma nought, gamma and digital number look-up tables that can be used for absolute product calibration."
}
},
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/sar/v1.0.0/schema.json",
"https://stac-extensions.github.io/sat/v1.0.0/schema.json"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"stac_version":"1.0.0","stac_extensions":["https://stac-extensions.github.io/version/v1.0.0/schema.json","https://terradue.github.io/disaster/v1.0.0/schema.json"],"type":"Feature","id":"act-2","geometry":{"type":"Point","coordinates":[3.009,43.192]},"properties":{"disaster:class":"Activation","cpe:status":{"stage":"notificationNew","message":null,"link":null},"updated":"2022-06-23T12:31:13.5064407Z","title":"[Act-2/Call-2] ONF Fires Monitoring","disaster:activation_id":2,"disaster:call_ids":[2],"cpe:pm_user_id":"fpacini","disaster:type":["Fire"],"disaster:region":["South France"],"disaster:country":"FRA","datetime":"2022-06-21T07:30:00Z","cpe:cos2_xml":"<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<disaster xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <callId>2</callId>\n <provider>gdaonf</provider>\n <disasterDate>2022-06-21T07:30:00Z</disasterDate>\n <recordUpdated>2022-06-21T07:55:39Z</recordUpdated>\n <title language=\"en\">ONF Fires Monitoring</title>\n <description language=\"en\">desc</description>\n <activationId>2</activationId>\n <pmUserId>fpacini</pmUserId>\n <type>fire</type>\n <webPageUrl>https://www.terradue.com</webPageUrl>\n <country>FRA</country>\n <region language=\"en\">South France</region>\n <area>\n <isAreaPrivate>false</isAreaPrivate>\n <kmlFileUrl>s3://mcube-catalog/activations/act-2/act-2.kml</kmlFileUrl>\n </area>\n <location>\n <latitude>43.192</latitude>\n <longitude>3.009</longitude>\n </location>\n <isClosed>false</isClosed>\n</disaster>","created":"2022-06-21T07:30:00Z","cpe:activation_status":"open","description":"<div style=\"float: left; width: 80px;\"><img src=\"https://store.terradue.com/api/cos2/various/icons/fire.png\" /></div>\n\n## [Act-2/Call-2] ONF Fires Monitoring\n\n**21/06/2022 07:30:00**\n\n[Link on disastercharter.org](https://www.terradue.com/)\n\n<div>desc</div>","providers":[{"name":"gdaonf","roles":["producer"]}],"cpe:notified":["2022-06-21T15:08:45.7088154Z","2022-06-23T12:30:21.3505743Z"],"cpe:notification_source":"cos2","version":"6"},"bbox":[3.009,43.192,3.009,43.192],"assets":{"icon":{"type":"image/png","roles":["thumbnail"],"title":"placemark","href":"s3://mcube-catalog/activations/act-2/fire.png","file:size":11452},"area1":{"type":"application/vnd.google-earth.kml+xml","roles":["area","metadata"],"title":"Area 1","href":"s3://mcube-catalog/activations/act-2/act-2.kml","file:size":1591}},"links":[{"type":"text/html","rel":"about","title":"Disaster Charter Web Page","href":"https://www.terradue.com"},{"type":"application/geo+json","rel":"item","title":"[Area] South of France","href":"areas/South_of_France.json"},{"type":"application/geo+json","rel":"item","title":"[Area] Corse","href":"areas/Corse.json"},{"type":"application/geo+json","rel":"self","href":"s3://mcube-catalog/activations/act-2/act-2.json"},{"type":"application/json","rel":"root","href":"s3://mcube-catalog/catalog.json"}]}

0 comments on commit c0aefe9

Please sign in to comment.