Skip to content

Commit

Permalink
added geoid filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Nov 12, 2024
1 parent de92be8 commit 1a31301
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datasets/bathy/endpoints/atl24g.lua
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@ arrow.send2user(crenv.host_sandbox_directory.."/"..tmp_filename, parms, rspq)
-- send ISO XML file to user
-------------------------------------------------------
if parms["output"]["format"] == "h5" then
local xml_filename = rqst["parms"]["output"]["path"]
xml_filename = xml_filename:sub(0, xml_filename:find(".h5")).."iso.xml"
local xml_parms = core.parms({
output = {
asset=rqst["parms"]["output"]["asset"], -- use original request asset
path=rqst["parms"]["output"]["path"]..".iso.xml" -- modify the original requested path
path=xml_filename -- modify the original requested path
}
})
arrow.send2user(crenv.host_sandbox_directory.."/"..tmp_filename..".iso.xml", xml_parms, rspq)
Expand Down
7 changes: 7 additions & 0 deletions datasets/bathy/package/BathyDataFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,13 @@ void* BathyDataFrame::subsettingThread (void* parm)
break;
}

/* Calculate Geoid Corrected Height and Check Delta */
const float geoid_corr_h = atl03.h_ph[current_photon] - atl03.geoid[current_segment];
if(geoid_corr_h > parms.maxGeoidDelta.value || geoid_corr_h < parms.minGeoidDelta.value)
{
break;
}

/* Calculate UTM Coordinates */
const double latitude = atl03.lat_ph[current_photon];
const double longitude = atl03.lon_ph[current_photon];
Expand Down
2 changes: 2 additions & 0 deletions datasets/bathy/package/BathyFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ BathyFields::BathyFields(lua_State* L, uint64_t key_space, const char* default_a
{ {"asset09", &atl09AssetName},
{"max_dem_delta", &maxDemDelta},
{"min_dem_delta", &minDemDelta},
{"max_geoid_delta", &maxGeoidDelta},
{"min_geoid_delta", &minGeoidDelta},
{"ph_in_extent", &phInExtent},
{"generate_ndwi", &generateNdwi},
{"use_bathy_mask", &useBathyMask},
Expand Down
2 changes: 2 additions & 0 deletions datasets/bathy/package/BathyFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ class BathyFields: public Icesat2Fields
FieldElement<string> atl09AssetName {"icesat2"}; // name of the asset in the asset directory for the ATL09 granules
FieldElement<double> maxDemDelta {50.0}; // initial filter of heights against DEM (For removing things like clouds)
FieldElement<double> minDemDelta {-100.0}; // initial filter of heights against DEM (For removing things like clouds)
FieldElement<double> maxGeoidDelta {50.0}; // initial filter of heights against geoid (For removing things like clouds)
FieldElement<double> minGeoidDelta {-100.0}; // initial filter of heights against geoid (For removing things like clouds)
FieldElement<int> phInExtent {8192}; // number of photons in each extent
FieldElement<bool> generateNdwi {false}; // use HLS data to generate NDWI for each segment lat,lon
FieldElement<bool> useBathyMask {true}; // global bathymetry mask downloaded in atl24 init lua routine
Expand Down

0 comments on commit 1a31301

Please sign in to comment.