Skip to content

Commit

Permalink
Iteratively get working on github.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed May 20, 2024
1 parent 0a5f6a9 commit ed69d3f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion check-code-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ datacube product add https://raw.githubusercontent.com/GeoscienceAustralia/dea-c

datacube product add https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/master/products/baseline_satellite_data/geomedian-au/ga_ls8c_nbart_gm_cyear_3.odc-product.yaml

# S2 datasets from us-west-2
# S2 datasets from us-west-2 (might not work)
MDL=./integration_tests/metadata
python ${MDL}/metadata_importer.py <<EOF
${MDL}/s2_l2a_ds_01.yaml https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/51/L/XD/2021/12/S2B_51LXD_20211231_0_L2A/S2B_51LXD_20211231_0_L2A.json
Expand Down
2 changes: 2 additions & 0 deletions datacube_ows/feature_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def get_s3_browser_uris(datasets: dict[ProductBandQuery, xarray.DataArray],
if ds.crs != last_crs:
pt_native = pt.to_crs(ds.crs)
last_crs = ds.crs
else:
pt_native = pt
if ds.extent.contains(pt_native):
uris.append(ds.uris)
else:
Expand Down
2 changes: 1 addition & 1 deletion datacube_ows/ogc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def create_geobox(
if width is not None:
scale_x = (float(maxx) - float(minx)) / width
else:
scale_x = -scale_y
scale_x = -scale_y # pylint: disable=possibly-used-before-assignment
width = int(round((float(maxx) - float(minx)) / scale_x))
if height is None:
scale_y = - scale_x
Expand Down
2 changes: 0 additions & 2 deletions integration_tests/metadata/metadata_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import fileinput
import yaml
from datacube import Datacube
from datacube.model import Dataset
from datacube.index.hl import Doc2Dataset

dc = Datacube()
Expand All @@ -25,4 +24,3 @@
else:
print("Dataset add failed:", err)
exit(1)

46 changes: 22 additions & 24 deletions integration_tests/metadata/s2_l2a_prod.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
name: s2_l2a
name: s2_l2a
metadata:
product:
name: s2_l2a
name: s2_l2a
description: Sentinel-2a and Sentinel-2b imagery, processed to Level 2A (Surface Reflectance) and converted to Cloud Optimized GeoTIFFs
measurements:
- name: B01
dtype: uint16,
units: "1",
nodata: 0,
- name: B01
dtype: uint16
units: "1"
nodata: 0
aliases:
- band_01
- coastal_aerosol
- name": B02
dtype: uint16
- name: B02
dtype: uint16
units: "1"
nodata: 0
aliases:
Expand Down Expand Up @@ -101,7 +100,7 @@ measurements:
- mask
- qa
flags_definition:
qa:
qa:
bits:
- 0
- 1
Expand All @@ -111,19 +110,19 @@ measurements:
- 5
- 6
- 7
values:
"0": no data
"1": saturated or defective
"2": dark area pixels
"3": cloud shadows
"4": vegetation
"5": bare soils
"6": water
"7": unclassified
"8": cloud medium probability
"9": cloud high probability
"10": thin cirrus
"11": snow or ice
values:
'0': no data
'1': saturated or defective
'2': dark area pixels
'3': cloud shadows
'4': vegetation
'5': bare soils
'6': water
'7': unclassified
'8': cloud medium probability
'9': cloud high probability
'10': thin cirrus
'11': snow or ice
description: Sen2Cor Scene Classification
- name: AOT
dtype: uint16
Expand All @@ -138,4 +137,3 @@ measurements:
aliases:
- scene_average_water_vapour
metadata_type: eo3
...

0 comments on commit ed69d3f

Please sign in to comment.