Skip to content

Commit

Permalink
removed OpenOceans++ parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Oct 17, 2024
1 parent 0465956 commit e363941
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 69 deletions.
2 changes: 1 addition & 1 deletion datasets/bathy/package/BathyCoastnetClassifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BathyCoastnetClassifier: public GeoDataFrame::FrameRunner
* Methods
*--------------------------------------------------------------------*/

BathyCoastnetClassifier (lua_State* L, BathyFields* _fields);
BathyCoastnetClassifier (lua_State* L, BathyFields* _parms);
~BathyCoastnetClassifier (void) override;

/*--------------------------------------------------------------------
Expand Down
41 changes: 1 addition & 40 deletions datasets/bathy/package/BathyFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,51 +145,12 @@ struct OpenOceansPPFields: public FieldDictionary
FieldElement<bool> setSurface {false};
FieldElement<bool> usePredictions {false};
FieldElement<bool> verbose {true};
FieldElement<double> xResolution {10.0};
FieldElement<double> zResolution {0.2};
FieldElement<double> zMin {-50};
FieldElement<double> zMax {30};
FieldElement<double> surfaceZMin {-20};
FieldElement<double> surfaceZMax {20};
FieldElement<double> bathyMinDepth {0.5};
FieldElement<double> verticalSmoothingSigma {0.5};
FieldElement<double> surfaceSmoothingSigma {200.0};
FieldElement<double> bathySmoothingSigma {100.0};
FieldElement<double> minPeakProminence {0.01};
FieldElement<size_t> minPeakDistance {2};

size_t minSurfacePhotonsPerWindow;
size_t minBathyPhotonsPerWindow;

void updatePhotonsPerWindow(void) {
minSurfacePhotonsPerWindow = 0.25 * (xResolution.value / 0.7);
minBathyPhotonsPerWindow = 0.25 * (xResolution.value / 0.7);
}

void fromLua (lua_State* L, int index) override {
FieldDictionary::fromLua(L, index);
updatePhotonsPerWindow();
}

OpenOceansPPFields(void):
FieldDictionary({ {"set_class", &setClass},
{"set_surface", &setSurface},
{"use_predictions", &usePredictions},
{"verbose", &verbose},
{"x_resolution", &xResolution},
{"z_resolution", &zResolution},
{"z_min", &zMin},
{"z_max", &zMax},
{"surface_z_min", &surfaceZMin},
{"surface_z_max", &surfaceZMax},
{"bathy_min_depth", &bathyMinDepth},
{"vertical_smoothing_sigma", &verticalSmoothingSigma},
{"surface_smoothing_sigma", &surfaceSmoothingSigma},
{"bathy_smoothing_sigma", &bathySmoothingSigma},
{"min_peak_prominence", &minPeakProminence},
{"min_peak_distance", &minPeakDistance} }) {
updatePhotonsPerWindow();
};
{"verbose", &verbose} }) {};

virtual ~OpenOceansPPFields(void) override = default;
};
Expand Down
25 changes: 2 additions & 23 deletions datasets/bathy/package/BathyOpenOceansPPClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// NOLINTBEGIN

/******************************************************************************
* INCLUDES
Expand Down Expand Up @@ -120,7 +119,7 @@ bool BathyOpenOceansPPClassifier::run (GeoDataFrame* dataframe)
for(size_t i = 0; i < number_of_samples; i++)
{
// Populate photon
oopp::photon photon = {
const oopp::photon photon = {
.h5_index = 0,
.x = x_atc[i],
.z = geoid_corr_h[i],
Expand All @@ -138,27 +137,8 @@ bool BathyOpenOceansPPClassifier::run (GeoDataFrame* dataframe)
}
}

// Initialize Parameters
oopp::params params = {
.x_resolution = args.xResolution.value,
.z_resolution = args.zResolution.value,
.z_min = args.zMin.value,
.z_max = args.zMax.value,
.surface_z_min = args.surfaceZMin.value,
.surface_z_max = args.surfaceZMax.value,
.bathy_min_depth = args.bathyMinDepth.value,
.vertical_smoothing_sigma = args.verticalSmoothingSigma.value,
.surface_smoothing_sigma = args.surfaceSmoothingSigma.value,
.bathy_smoothing_sigma = args.bathySmoothingSigma.value,
.min_peak_prominence = args.minPeakProminence.value,
.min_peak_distance = args.minPeakDistance.value,
.min_surface_photons_per_window = args.minSurfacePhotonsPerWindow,
.min_bathy_photons_per_window = args.minBathyPhotonsPerWindow,
.surface_n_stddev = 3.0,
.bathy_n_stddev = 3.0
};

// Run classification
const oopp::params params;
samples = classify (samples, params, args.usePredictions);

// Update extents
Expand All @@ -183,4 +163,3 @@ bool BathyOpenOceansPPClassifier::run (GeoDataFrame* dataframe)
return true;
}

// NOLINTEND
6 changes: 1 addition & 5 deletions datasets/bathy/package/BathyQtreesClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// NOLINTBEGIN

/******************************************************************************
* INCLUDES
******************************************************************************/
Expand Down Expand Up @@ -124,7 +122,7 @@ bool BathyQtreesClassifier::run (GeoDataFrame* dataframe)
for(size_t i = 0; i < number_of_samples; i++)
{
// Populate sample
utils::sample s = {
const utils::sample s = {
.dataset_id = 0,
.h5_index = 0,
.x = x_atc[i],
Expand Down Expand Up @@ -168,5 +166,3 @@ bool BathyQtreesClassifier::run (GeoDataFrame* dataframe)
updateRunTime(TimeLib::latchtime() - start);
return true;
}

// NOLINTEND

0 comments on commit e363941

Please sign in to comment.