Skip to content

Commit

Permalink
fix: add "1" to unitless strings
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Oct 6, 2022
1 parent 9629d27 commit 78c58c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
{
"nodata": 255,
"data_type": "uint8",
"unit": "1",
"scale": 0.009999999776482582
}
],
Expand All @@ -101,8 +100,7 @@
"raster:bands": [
{
"nodata": 255,
"data_type": "uint8",
"unit": "1"
"data_type": "uint8"
}
],
"roles": [
Expand All @@ -116,7 +114,6 @@
{
"nodata": 255,
"data_type": "uint8",
"unit": "1",
"scale": 0.009999999776482582
}
],
Expand All @@ -131,7 +128,6 @@
{
"nodata": 255,
"data_type": "uint8",
"unit": "1",
"scale": 0.009999999776482582
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/stactools/noaa_cdr/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from rasterio import Affine
from xarray import DataArray, Dataset

UNITLESS = ["unitless"]
UNITLESS = ["unitless", "1"]


@dataclass
Expand Down
6 changes: 6 additions & 0 deletions tests/sea_ice_concentration/test_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ def test_create_collection() -> None:

collection.set_self_href("")
collection.validate()


def test_unitless(tmp_path: Path) -> None:
path = test_data.get_path("data-files/seaice_conc_daily_nh_20211231_f17_v04r00.nc")
assets = cog.cogify(path, str(tmp_path))
assert "unit" not in assets["cdr_seaice_conc"].extra_fields["raster:bands"][0]

0 comments on commit 78c58c7

Please sign in to comment.