Skip to content

Commit e06dd34

Browse files
committed
restored some old gedi parameter names for backward compatibility
1 parent e3e8c33 commit e06dd34

File tree

7 files changed

+41
-17
lines changed

7 files changed

+41
-17
lines changed

clients/python/tests/test_defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def test_parms(self, init):
1616
assert len(d["core"]["samples"]) == 0, f'core has invalid samples parameters: {d["core"]["samples"]}'
1717
assert d["core"]["cluster_size_hint"] == 0, f'core has invalid cluster size hint: {d["core"]["cluster_size_hint"]}'
1818
assert d["icesat2"]["srt"] == "land_ice", f'icesat2 has invalid surface reference type: {d["icesat2"]["srt"]}'
19-
assert d["gedi"]["projection"] == "auto", f'gedi has invalid projection: {d["gedi"]["projection"]}'
19+
assert d["gedi"]["proj"] == "auto", f'gedi has invalid projection: {d["gedi"]["proj"]}'

clients/python/tests/test_subsetting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_180_edge_plate_carree(self, init):
5858
{ "lat": -73.0, "lon": -180.00 } ]
5959
parms = {
6060
"poly": poly,
61-
"projection": "plate_carree",
61+
"proj": "plate_carree",
6262
"srt": icesat2.SRT_LAND,
6363
"cnf": icesat2.CNF_SURFACE_LOW,
6464
"ats": 20.0,

datasets/gedi/package/GediFields.cpp

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,19 @@ int GediFields::luaCreate (lua_State* L)
7373
*----------------------------------------------------------------------------*/
7474
GediFields::GediFields(lua_State* L , uint64_t key_space, const char* default_asset_name, const char* default_resource):
7575
RequestFields (L, key_space,
76-
{ {"asset", &asset},
77-
{"resource", &resource},
78-
{"beams", &beams},
79-
{"degrade_filter", &degrade_filter},
80-
{"l2_quality_filter", &l2_quality_filter},
81-
{"l4_quality_filter", &l4_quality_filter},
82-
{"surface_filter", &surface_filter} }),
76+
{ {"asset", &asset},
77+
{"resource", &resource},
78+
{"beams", &beams},
79+
{"degrade_filter", &degrade_filter},
80+
{"l2_quality_filter", &l2_quality_filter},
81+
{"l4_quality_filter", &l4_quality_filter},
82+
{"surface_filter", &surface_filter},
83+
// backwards compatibility
84+
{"beam", &beams},
85+
{"degrade_flag", &degrade_flag},
86+
{"l2_quality_flag", &l2_quality_flag},
87+
{"l4_quality_flag", &l4_quality_flag},
88+
{"surface_flag", &surface_flag} }),
8389
asset(default_asset_name)
8490
{
8591
if(default_resource)
@@ -88,6 +94,19 @@ GediFields::GediFields(lua_State* L , uint64_t key_space, const char* default_as
8894
}
8995
}
9096

97+
/*----------------------------------------------------------------------------
98+
* fromLua
99+
*----------------------------------------------------------------------------*/
100+
void GediFields::fromLua (lua_State* L, int index)
101+
{
102+
RequestFields::fromLua(L, index);
103+
104+
if(degrade_flag == 1) degrade_filter = true;
105+
if(l2_quality_flag == 1) l2_quality_filter = true;
106+
if(l4_quality_flag == 1) l4_quality_filter = true;
107+
if(surface_flag == 1) surface_filter = true;
108+
}
109+
91110
/******************************************************************************
92111
* FUNCTIONS
93112
******************************************************************************/

datasets/gedi/package/GediFields.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,21 @@ class GediFields: public RequestFields
130130
FieldElement<bool> l4_quality_filter {false};
131131
FieldElement<bool> surface_filter {false};
132132

133+
// backwards compatibility
134+
FieldElement<int> degrade_flag {0};
135+
FieldElement<int> l2_quality_flag {0};
136+
FieldElement<int> l4_quality_flag {0};
137+
FieldElement<int> surface_flag {0};
138+
133139
private:
134140

135141
/*--------------------------------------------------------------------
136142
* Methods
137143
*--------------------------------------------------------------------*/
138144

139-
GediFields (lua_State* L, uint64_t key_space, const char* default_asset_name, const char* default_resource);
145+
GediFields (lua_State* L, uint64_t key_space, const char* default_asset_name, const char* default_resource);
140146
virtual ~GediFields (void) override = default;
147+
void fromLua (lua_State* L, int index) override;
141148
};
142149

143150
/******************************************************************************

docs/rtd/source/release_notes/release-v4-8-0.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ Bathy Version #5.
3434

3535
## General Changes
3636

37-
* GEDI parameters updated to be more accurate an intuitive.
37+
* GEDI parameters updated to be more accurate an intuitive (the old parameter names are still functional but have been DEPRECATED, please switch to using the new ones in your code).
3838
- `degrade_flag` changed to `degrade_filter` and instead of having to know what the flag values were; the user now just needs to set to True to filter out all degraded footprints.
3939
- `l2_quality_flag` changed to `l2_quality_filter` and instead of having to know what the flag values were; the user now just needs to set to True to filter out anything that does not meet the L2 quality criteria.
4040
- `l4_quality_flag` changed to `l4_quality_filter` and instead of having to know what the flag values were; the user now just needs to set to True to filter out anything that does not meet the L4 quality criteria.
4141
- `surface_flag` changed to `surface_filter` and instead of having to know what the flag values were; the user now just needs to set to True to filter out anything that isn't a surface footprint.
4242
- `beam` changed to `beams` to reflect that it is primarily a list of beams to process and not just a single beam (even though if the user only provides a single beam, the server side code will automatically promote it to a list of beams with only one element).
4343

44-
* Subsetting requests that use a rasterized geojson to perform the subsetting have been changed so that the geojson string is passed via a parameter named `region_mask` instead of `raster`. The original name was confusing with our increasing support for raster sampling. THe new name makes it clearer that the parameter is used as a mask for the region of interest.
45-
46-
* The `proj` field has changed to `projection` for clarity.
44+
* Subsetting requests that use a rasterized geojson to perform the subsetting have been changed so that the geojson string is passed via a parameter named `region_mask` instead of `raster`. The original name was confusing with our increasing support for raster sampling. The new name makes it clearer that the parameter is used as a mask for the region of interest.
4745

4846
## Getting This Release
4947

docs/rtd/source/user_guide/SlideRule.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Parameters are passed to the SlideRule endpoints as JSON data structures (or as
131131
All polygons provided to SlideRule must be provided as a list of dictionaries containing longitudes and latitudes in counter-clockwise order with the first and last point matching.
132132

133133
* ``"poly"``: polygon of region of interest
134-
* ``"projection"``: projection used when subsetting data ("north_polar", "south_polar", "plate_carree"). In most cases, do not specify and code will do the right thing.
134+
* ``"proj"``: projection used when subsetting data ("north_polar", "south_polar", "plate_carree"). In most cases, do not specify and code will do the right thing.
135135
* ``"ignore_poly_for_cmr"``: boolean for whether to use the polygon as a part of the request to CMR for obtaining the list of resources to process. By default the polygon is used and this is only here for unusual cases where SlideRule is able to handle a polygon for subsetting that CMR cannot, and the list of resources to process is obtained some other way.
136136

137137
For example:
@@ -303,7 +303,7 @@ The default set of parameters used by SlideRule are set to match anticipated use
303303
* - ``"poly"``
304304
- String, JSON
305305
-
306-
* - ``"projection"``
306+
* - ``"proj"``
307307
- String
308308
-
309309
* - ``"ignore_poly_for_cmr"``

packages/core/RequestFields.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ RequestFields::RequestFields(lua_State* L, uint64_t key_space, const std::initia
379379
LuaObject (L, OBJECT_TYPE, LUA_META_NAME, LUA_META_TABLE),
380380
FieldDictionary ({
381381
{"poly", &polygon},
382-
{"projection", &projection},
382+
{"proj", &projection},
383383
{"points_in_polygon", &pointsInPolygon},
384384
{"timeout", &timeout},
385385
{"rqst_timeout", &rqstTimeout},

0 commit comments

Comments
 (0)