diff --git a/clients/nodejs/sliderule/package.json b/clients/nodejs/sliderule/package.json index 8950cdd4..b5d73ccb 100644 --- a/clients/nodejs/sliderule/package.json +++ b/clients/nodejs/sliderule/package.json @@ -2,7 +2,7 @@ "name": "@sliderule/sliderule", "type": "module", "description": "client for the SlideRule on-demand science data processing service", - "version": "4.8.1", + "version": "4.8.3", "keywords": [ "sliderule" ], diff --git a/clients/python/sliderule/sliderule.py b/clients/python/sliderule/sliderule.py index 8debc13b..0a277c4d 100644 --- a/clients/python/sliderule/sliderule.py +++ b/clients/python/sliderule/sliderule.py @@ -1414,7 +1414,7 @@ def toregion(source, tolerance=0.0, cellsize=0.01, n_clusters=1): "poly": [{"lat": , "lon": }, ...], - "region_mask": {"data": , + "raster": {"data": , "clusters": [[{"lat": , "lon": }, ...], [{"lat": , "lon": }, ...]] } @@ -1564,7 +1564,7 @@ def toregion(source, tolerance=0.0, cellsize=0.01, n_clusters=1): "gdf": gdf, "poly": polygon, # convex hull of polygons "clusters": clusters, # list of polygon clusters for cmr request - "region_mask": { + "raster": { "geojson": datafile, # geojson file "length": len(datafile), # geojson file length "cellsize": cellsize # units are in crs/projection diff --git a/clients/python/tests/test_geojson.py b/clients/python/tests/test_geojson.py index f9c1f326..d655925d 100644 --- a/clients/python/tests/test_geojson.py +++ b/clients/python/tests/test_geojson.py @@ -15,7 +15,7 @@ def test_atl03(self, init): region = sliderule.toregion(os.path.join(TESTDIR, testfile)) parms = { "poly": region["poly"], - "region_mask": region["region_mask"], + "region_mask": region["raster"], "srt": icesat2.SRT_LAND, "cnf": icesat2.CNF_SURFACE_HIGH, "ats": 10.0, diff --git a/clients/python/tests/test_subsetting.py b/clients/python/tests/test_subsetting.py index c3755fa6..6ca45b3c 100644 --- a/clients/python/tests/test_subsetting.py +++ b/clients/python/tests/test_subsetting.py @@ -15,7 +15,7 @@ def test_rasterize(self, init): region = sliderule.toregion(os.path.join(TESTDIR, "data/grandmesa.geojson")) parms = { "poly": region['poly'], - "region_mask": region['region_mask'], + "region_mask": region['raster'], "srt": icesat2.SRT_LAND, "cnf": icesat2.CNF_SURFACE_LOW, "ats": 20.0, diff --git a/clients/python/utils/benchmark.py b/clients/python/utils/benchmark.py index 2ce912cd..5453b034 100644 --- a/clients/python/utils/benchmark.py +++ b/clients/python/utils/benchmark.py @@ -235,7 +235,7 @@ def atl06_no_sample_arcticdem(): def atl03_rasterized_subset(): parms = { "poly": region['poly'], - "region_mask": region['region_mask'], + "region_mask": region['raster'], "srt": icesat2.SRT_LAND, "cnf": icesat2.CNF_SURFACE_LOW, "ats": 20.0, diff --git a/clients/python/utils/utils.py b/clients/python/utils/utils.py index 7a1635c3..beb67650 100644 --- a/clients/python/utils/utils.py +++ b/clients/python/utils/utils.py @@ -111,7 +111,7 @@ def initialize_client(args): region = sliderule.toregion(cfg["region"]) parms["poly"] = region['poly'] if cfg["region_mask"]: - parms["region_mask"] = region['region_mask'] + parms["region_mask"] = region['raster'] # Add Ancillary Fields if len(cfg['atl03_geo_fields']) > 0: diff --git a/clients/python/version.txt b/clients/python/version.txt index c1577fb8..8fb83c6e 100644 --- a/clients/python/version.txt +++ b/clients/python/version.txt @@ -1 +1 @@ -v4.8.1 +v4.8.3 diff --git a/datasets/bathy/package/BathyCoastnetClassifier.cpp b/datasets/bathy/package/BathyCoastnetClassifier.cpp index d633ce67..c534f11d 100644 --- a/datasets/bathy/package/BathyCoastnetClassifier.cpp +++ b/datasets/bathy/package/BathyCoastnetClassifier.cpp @@ -35,8 +35,6 @@ * INCLUDES ******************************************************************************/ -#include -#include #include #include "ContainerRunner.h" diff --git a/docs/rtd/source/user_guide/SlideRule.rst b/docs/rtd/source/user_guide/SlideRule.rst index effcfa6d..43449359 100644 --- a/docs/rtd/source/user_guide/SlideRule.rst +++ b/docs/rtd/source/user_guide/SlideRule.rst @@ -156,7 +156,7 @@ There is no limit to the number of points in the polygon, but note that as the n One of the outputs of the ``sliderule.toregion`` function is a GeoJSON object that describes the region of interest. It is available under the ``"region_mask"`` element of the returned dictionary. -* ``"region_mask"``: geojson describing region of interest, enables use of rasterized region for subsetting +* ``"raster"``: geojson describing region of interest, enables use of rasterized region for subsetting When supplied in the parameters sent in the request, the server side software forgoes using the polygon for subsetting operations, and instead builds a raster of the GeoJSON object using the specified cellsize, and then uses that raster image as a mask to determine which points in the source datasets are included in the region of interest. @@ -169,7 +169,7 @@ The example code below shows how this option can be enabled and used (note, the region = sliderule.toregion('examples/grandmesa.geojson', cellsize=0.02) parms = { "poly": region['poly'], - "region_mask": region['region_mask'] + "region_mask": region['raster'] } 5.3 Time diff --git a/packages/core/RequestFields.cpp b/packages/core/RequestFields.cpp index 0b7c5f60..45508c15 100644 --- a/packages/core/RequestFields.cpp +++ b/packages/core/RequestFields.cpp @@ -397,6 +397,8 @@ RequestFields::RequestFields(lua_State* L, uint64_t key_space, const std::initia #ifdef __geo__ {GeoFields::PARMS, &samplers}, #endif + // deprecated + {"raster", ®ionMask}, }) { // set key space diff --git a/scripts/extensions/proxy.lua b/scripts/extensions/proxy.lua index 09008252..39eb5767 100644 --- a/scripts/extensions/proxy.lua +++ b/scripts/extensions/proxy.lua @@ -40,6 +40,18 @@ local function proxy(resources, parms_tbl, endpoint, rec) end end + -- Populate Resources via CMR Request -- + if not resources then + local rc, rsps = earthdata.cmr(parms_tbl) + if rc == earthdata.SUCCESS then + resources = rsps + userlog:alert(core.INFO, core.RTE_INFO, string.format("request <%s> retrieved %d resources from CMR", rspq, #resources)) + else + userlog:alert(core.CRITICAL, core.RTE_SIMPLIFY, string.format("request <%s> failed to make CMR request <%d>: %s", rspq, rc, rsps)) + return + end + end + -- Create Request Parameters -- local parms = core.parms(parms_tbl) @@ -73,18 +85,6 @@ local function proxy(resources, parms_tbl, endpoint, rec) -- Determine Locks per Node -- local locks_per_node = (parms["poly"] and not parms["ignore_poly_for_cmr"]) and 1 or core.MAX_LOCKS_PER_NODE - -- Populate Resources via CMR Request -- - if not resources then - local rc, rsps = earthdata.cmr(parms) - if rc == earthdata.SUCCESS then - resources = rsps - userlog:alert(core.INFO, core.RTE_INFO, string.format("request <%s> retrieved %d resources from CMR", rspq, #resources)) - else - userlog:alert(core.CRITICAL, core.RTE_SIMPLIFY, string.format("request <%s> failed to make CMR request <%d>: %s", rspq, rc, rsps)) - return - end - end - -- Proxy Request -- local endpoint_proxy = core.proxy(endpoint, resources, json.encode(parms_tbl), node_timeout, locks_per_node, rsps_from_nodes, terminate_proxy_stream, cluster_size_hint) diff --git a/version.txt b/version.txt index c1577fb8..8fb83c6e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v4.8.1 +v4.8.3