Skip to content

Commit 1cdaf14

Browse files
committed
added initial sampler test
1 parent bf6ae4b commit 1cdaf14

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_arcticdem.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
"""Tests for sliderule-python arcticdem raster support."""
22

33
import pytest
4+
from pathlib import Path
5+
import os.path
46
import sliderule
57
from sliderule import icesat2
68

9+
TESTDIR = Path(__file__).parent
10+
711
@pytest.mark.network
812
class TestVrt:
913
def test_vrt(self, domain, organization):
@@ -12,3 +16,17 @@ def test_vrt(self, domain, organization):
1216
rsps = sliderule.source("samples", rqst)
1317
assert abs(rsps["samples"][0][0]["value"] - 80.713500976562) < 0.001
1418
assert rsps["samples"][0][0]["file"] == '/vsis3/pgc-opendata-dems/arcticdem/mosaics/v3.0/2m/70_09/70_09_2_1_2m_v3.0_reg_dem.tif'
19+
20+
def test_sampler(self, domain, asset, organization):
21+
icesat2.init(domain, organization=organization)
22+
resource = "ATL03_20190314093716_11600203_005_01.h5"
23+
region = icesat2.toregion(os.path.join(TESTDIR, "data/dicksonfjord.geojson"))
24+
parms = { "poly": region['poly'],
25+
"cnf": "atl03_high",
26+
"ats": 20.0,
27+
"cnt": 10,
28+
"len": 40.0,
29+
"res": 20.0,
30+
"maxi": 1,
31+
"samples": ["arcticdem-mosaic"] }
32+
gdf = icesat2.atl06p(parms, asset=asset, resources=[resource])

0 commit comments

Comments
 (0)