Skip to content

Commit

Permalink
Pull request #215: Feature/revert
Browse files Browse the repository at this point in the history
Merge in MAG/magics from feature/revert to develop

* commit '5087dcb05daaecf9191d8702314bd25a2a55caf8':
  Fix issues with colour setting
  Revert OutofBond
  Revert OutofBond
  Revert OutofBond
  Revert OutofBond
  Compilation issues aftre the merge
  Adding Point and SegmentJoiner in the Magics namespace to avoid confusion with other definitions.
  Symbol Plotting legend for CAMS plots.
  Reverting grib_wind_large_position and
  Reverting grib_field_large_position
  Revert in progress
  Opencharts : Symbol Plotting by property
  Fix grib decoding
  Wind fix
  Opencharts : Symbol Plotting by property
  Prepare version 4.15.0
  Rmove out-of-bon functionalities
  Revert out_of_bound parameter family t Please enter the commit message for your changes. Lines starting
  • Loading branch information
sylvielamythepaut committed Dec 5, 2023
2 parents 131bb99 + 5087dcb commit 66a126f
Show file tree
Hide file tree
Showing 52 changed files with 1,818 additions and 394 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake")
find_package( ecbuild 3.4 REQUIRED )


# In prepaation for hotfix of 4.14.0
project( magics LANGUAGES CXX )

project( magics VERSION 4.15.0 LANGUAGES CXX )

# make sure that the header files are installed into include/magics
# note that this needs to be done before ecbuild_declare_project()
Expand Down
16 changes: 1 addition & 15 deletions src/attributes/ColourTechniqueAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@

using namespace magics;

ColourTechniqueAttributes::ColourTechniqueAttributes():
oob_min_colour_(ParameterManager::getString("contour_out_of_bound_min_colour")),
oob_max_colour_(ParameterManager::getString("contour_out_of_bound_max_colour"))
ColourTechniqueAttributes::ColourTechniqueAttributes()


{
Expand All @@ -45,16 +43,12 @@ void ColourTechniqueAttributes::set(const std::map<string, string>& params)
int i = 0;
prefix[i++] = "";

setAttribute(prefix, "contour_out_of_bound_min_colour", oob_min_colour_, params);
setAttribute(prefix, "contour_out_of_bound_max_colour", oob_max_colour_, params);


}

void ColourTechniqueAttributes::copy(const ColourTechniqueAttributes& other)
{
oob_min_colour_ = other.oob_min_colour_;
oob_max_colour_ = other.oob_max_colour_;

}

Expand Down Expand Up @@ -93,21 +87,13 @@ void ColourTechniqueAttributes::set(const XmlNode& node)
void ColourTechniqueAttributes::print(ostream& out) const
{
out << "Attributes[";
out << " oob_min_colour = " << oob_min_colour_;
out << " oob_max_colour = " << oob_max_colour_;

out << "]" << "\n";
}

void ColourTechniqueAttributes::toxml(ostream& out) const
{
out << "\"\"";
out << ", \"contour_out_of_bound_min_colour\":";
niceprint(out,oob_min_colour_);
out << ", \"contour_out_of_bound_max_colour\":";
niceprint(out,oob_max_colour_);

}

static MagicsParameter<string> contour_out_of_bound_min_colour("contour_out_of_bound_min_colour", "automatic");
static MagicsParameter<string> contour_out_of_bound_max_colour("contour_out_of_bound_max_colour", "automatic");
2 changes: 0 additions & 2 deletions src/attributes/ColourTechniqueAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class ColourTechniqueAttributes
virtual void toxml(std::ostream& out) const;
// -- members:
string tag_;
string oob_min_colour_;
string oob_max_colour_;


private:
Expand Down
8 changes: 0 additions & 8 deletions src/attributes/ColourTechniqueWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ void ColourTechniqueWrapper::set(const MagRequest& request)



if (request.countValues("CONTOUR_OUT_OF_BOUND_MIN_COLOUR") ) {
string oob_min_colour_value = request("CONTOUR_OUT_OF_BOUND_MIN_COLOUR");
colourtechnique_->oob_min_colour_ = oob_min_colour_value;
}
if (request.countValues("CONTOUR_OUT_OF_BOUND_MAX_COLOUR") ) {
string oob_max_colour_value = request("CONTOUR_OUT_OF_BOUND_MAX_COLOUR");
colourtechnique_->oob_max_colour_ = oob_max_colour_value;
}


}
Expand Down
6 changes: 6 additions & 0 deletions src/attributes/EpsPlumeWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ void EpsPlumeWrapper::set(const MagRequest& request)

epsplume_->legend_ = MagTranslator<string, bool>()(legend_value);

}
if (request.countValues("EPS_PLUME_LEGEND_GREY_STYLE") ) {
string legend_grey_style_value = request("EPS_PLUME_LEGEND_GREY_STYLE");

epsplume_->legend_grey_style_ = MagTranslator<string, bool>()(legend_grey_style_value);

}
if (request.countValues("EPS_PLUME_MEMBERS") ) {
string line_value = request("EPS_PLUME_MEMBERS");
Expand Down
3 changes: 1 addition & 2 deletions src/attributes/GeoJSonAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GeoJSonAttributes::GeoJSonAttributes():
input_(ParameterManager::getString("geojson_input")),
binning_resolution_(ParameterManager::getDouble("geojson_binning_grid_resolution")),
value_(ParameterManager::getString("geojson_value_property"))


{
}
Expand All @@ -54,7 +54,6 @@ void GeoJSonAttributes::set(const std::map<string, string>& params)
setAttribute(prefix, "geojson_binning_grid_resolution", binning_resolution_, params);
setAttribute(prefix, "geojson_value_property", value_, params);

cout << value_ << endl;

}

Expand Down
28 changes: 0 additions & 28 deletions src/attributes/GribDecoderAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@ GribDecoderAttributes::GribDecoderAttributes():
expver_(ParameterManager::getBool("grib_text_experiment")),
units_(ParameterManager::getBool("grib_text_units")),
field_position_(ParameterManager::getInt("grib_field_position")),
large_field_position_(ParameterManager::getULong("grib_field_large_position")),
position_1_(ParameterManager::getInt("grib_wind_position_1")),
position_2_(ParameterManager::getInt("grib_wind_position_2")),
colour_position_(ParameterManager::getInt("grib_wind_position_colour")),
large_position_1_(ParameterManager::getULong("grib_wind_large_position_1")),
large_position_2_(ParameterManager::getULong("grib_wind_large_position_2")),
large_colour_position_(ParameterManager::getULong("grib_wind_large_position_colour")),
missing_value_(ParameterManager::getDouble("grib_missing_value_indicator")),
wind_style_(ParameterManager::getBool("grib_wind_style"))
,
Expand Down Expand Up @@ -87,13 +83,9 @@ void GribDecoderAttributes::set(const std::map<string, string>& params)
setAttribute(prefix, "grib_text_experiment", expver_, params);
setAttribute(prefix, "grib_text_units", units_, params);
setAttribute(prefix, "grib_field_position", field_position_, params);
setAttribute(prefix, "grib_field_large_position", large_field_position_, params);
setAttribute(prefix, "grib_wind_position_1", position_1_, params);
setAttribute(prefix, "grib_wind_position_2", position_2_, params);
setAttribute(prefix, "grib_wind_position_colour", colour_position_, params);
setAttribute(prefix, "grib_wind_large_position_1", large_position_1_, params);
setAttribute(prefix, "grib_wind_large_position_2", large_position_2_, params);
setAttribute(prefix, "grib_wind_large_position_colour", large_colour_position_, params);
setAttribute(prefix, "grib_missing_value_indicator", missing_value_, params);
setAttribute(prefix, "grib_wind_style", wind_style_, params);

Expand All @@ -120,13 +112,9 @@ void GribDecoderAttributes::copy(const GribDecoderAttributes& other)
expver_ = other.expver_;
units_ = other.units_;
field_position_ = other.field_position_;
large_field_position_ = other.large_field_position_;
position_1_ = other.position_1_;
position_2_ = other.position_2_;
colour_position_ = other.colour_position_;
large_position_1_ = other.large_position_1_;
large_position_2_ = other.large_position_2_;
large_colour_position_ = other.large_colour_position_;
missing_value_ = other.missing_value_;
wind_style_ = other.wind_style_;
address_mode_ = unique_ptr<GribAddressMode>(other.address_mode_->clone());
Expand Down Expand Up @@ -193,13 +181,9 @@ void GribDecoderAttributes::print(ostream& out) const
out << " expver = " << expver_;
out << " units = " << units_;
out << " field_position = " << field_position_;
out << " large_field_position = " << large_field_position_;
out << " position_1 = " << position_1_;
out << " position_2 = " << position_2_;
out << " colour_position = " << colour_position_;
out << " large_position_1 = " << large_position_1_;
out << " large_position_2 = " << large_position_2_;
out << " large_colour_position = " << large_colour_position_;
out << " missing_value = " << missing_value_;
out << " wind_style = " << wind_style_;
out << " address_mode = " << *address_mode_;
Expand Down Expand Up @@ -243,20 +227,12 @@ void GribDecoderAttributes::toxml(ostream& out) const
niceprint(out,units_);
out << ", \"grib_field_position\":";
niceprint(out,field_position_);
out << ", \"grib_field_large_position\":";
niceprint(out,large_field_position_);
out << ", \"grib_wind_position_1\":";
niceprint(out,position_1_);
out << ", \"grib_wind_position_2\":";
niceprint(out,position_2_);
out << ", \"grib_wind_position_colour\":";
niceprint(out,colour_position_);
out << ", \"grib_wind_large_position_1\":";
niceprint(out,large_position_1_);
out << ", \"grib_wind_large_position_2\":";
niceprint(out,large_position_2_);
out << ", \"grib_wind_large_position_colour\":";
niceprint(out,large_colour_position_);
out << ", \"grib_missing_value_indicator\":";
niceprint(out,missing_value_);
out << ", \"grib_wind_style\":";
Expand Down Expand Up @@ -284,13 +260,9 @@ static MagicsParameter<int> grib_interpolation_method_missing_fill_count("grib_i
static MagicsParameter<string> grib_text_experiment("grib_text_experiment", "off");
static MagicsParameter<string> grib_text_units("grib_text_units", "off");
static MagicsParameter<int> grib_field_position("grib_field_position", 1);
static MagicsParameter<unsigned long long> grib_field_large_position("grib_field_large_position", 0);
static MagicsParameter<int> grib_wind_position_1("grib_wind_position_1", 1);
static MagicsParameter<int> grib_wind_position_2("grib_wind_position_2", -1);
static MagicsParameter<int> grib_wind_position_colour("grib_wind_position_colour", -1);
static MagicsParameter<unsigned long long> grib_wind_large_position_1("grib_wind_large_position_1", 0);
static MagicsParameter<unsigned long long> grib_wind_large_position_2("grib_wind_large_position_2", 0);
static MagicsParameter<unsigned long long> grib_wind_large_position_colour("grib_wind_large_position_colour", 0);
static MagicsParameter<double> grib_missing_value_indicator("grib_missing_value_indicator", -1.5e+21);
static MagicsParameter<string> grib_wind_style("grib_wind_style", "off");
static MagicsParameter<string> grib_file_address_mode("grib_file_address_mode", "record");
Expand Down
4 changes: 0 additions & 4 deletions src/attributes/GribDecoderAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ class GribDecoderAttributes
bool expver_;
bool units_;
int field_position_;
unsigned long long large_field_position_;
int position_1_;
int position_2_;
int colour_position_;
unsigned long long large_position_1_;
unsigned long long large_position_2_;
unsigned long long large_colour_position_;
double missing_value_;
bool wind_style_;
unique_ptr<GribAddressMode> address_mode_;
Expand Down
16 changes: 0 additions & 16 deletions src/attributes/GribDecoderWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ void GribDecoderWrapper::set(const MagRequest& request)
int field_position_value = request("GRIB_FIELD_POSITION");
gribdecoder_->field_position_ = field_position_value;
}
if (request.countValues("GRIB_FIELD_LARGE_POSITION") ) {
// unsigned long long large_field_position_value = request("GRIB_FIELD_LARGE_POSITION");
// gribdecoder_->large_field_position_ = large_field_position_value;
}
if (request.countValues("GRIB_WIND_POSITION_1") ) {
int position_1_value = request("GRIB_WIND_POSITION_1");
gribdecoder_->position_1_ = position_1_value;
Expand All @@ -145,18 +141,6 @@ void GribDecoderWrapper::set(const MagRequest& request)
int colour_position_value = request("GRIB_WIND_POSITION_COLOUR");
gribdecoder_->colour_position_ = colour_position_value;
}
if (request.countValues("GRIB_WIND_LARGE_POSITION_1") ) {
// unsigned long long large_position_1_value = request("GRIB_WIND_LARGE_POSITION_1");
// gribdecoder_->large_position_1_ = large_position_1_value;
}
if (request.countValues("GRIB_WIND_LARGE_POSITION_2") ) {
// unsigned long long large_position_2_value = request("GRIB_WIND_LARGE_POSITION_2");
// gribdecoder_->large_position_2_ = large_position_2_value;
}
if (request.countValues("GRIB_WIND_LARGE_POSITION_COLOUR") ) {
// unsigned long long large_colour_position_value = request("GRIB_WIND_LARGE_POSITION_COLOUR");
// gribdecoder_->large_colour_position_ = large_colour_position_value;
}
if (request.countValues("GRIB_MISSING_VALUE_INDICATOR") ) {
double missing_value_value = request("GRIB_MISSING_VALUE_INDICATOR");
gribdecoder_->missing_value_ = missing_value_value;
Expand Down
10 changes: 9 additions & 1 deletion src/attributes/MagicsSettingsWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
#include "MagicsParameter.h"
#include "Factory.h"
#include "MagTranslator.h"
#include "MagicsSettings.h"
#include "MagicsGlobal.h"

using namespace magics;



MagicsSettingsWrapper::MagicsSettingsWrapper(): magicssettings_(new MagicsSettings())


{


Expand All @@ -55,15 +57,21 @@ void MagicsSettingsWrapper::set(const MagRequest& request)

if (request.countValues("MAGICS_SILENT") ) {
string silent_value = request("MAGICS_SILENT");

magicssettings_->silent_ = MagTranslator<string, bool>()(silent_value);

}
if (request.countValues("MAGICS_BACKWARD_COMPATIBILITY") ) {
string compatibility_value = request("MAGICS_BACKWARD_COMPATIBILITY");

magicssettings_->compatibility_ = MagTranslator<string, bool>()(compatibility_value);

}
if (request.countValues("MAGICS_STRICT_MODE") ) {
string strict_value = request("MAGICS_STRICT_MODE");

magicssettings_->strict_ = MagTranslator<string, bool>()(strict_value);

}


Expand Down
99 changes: 99 additions & 0 deletions src/attributes/NoBoxPlotAttributes.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@

/****************************** LICENSE *******************************
* (C) Copyright 1996-2017 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
******************************* LICENSE *******************************/

/*! \\file NoBoxPlotAttributes.h
\\brief Definition of NoBoxPlot Attributes class.
This file is automatically generated.
Do Not Edit!
*/

#include "NoBoxPlotAttributes.h"
#include "MagicsParameter.h"
#include "ParameterSettings.h"

using namespace magics;

NoBoxPlotAttributes::NoBoxPlotAttributes()


{
}


NoBoxPlotAttributes::~NoBoxPlotAttributes()
{

}


void NoBoxPlotAttributes::set(const std::map<string, string>& params)
{
vector<string> prefix(1);
int i = 0;
prefix[i++] = "boxplot";



}

void NoBoxPlotAttributes::copy(const NoBoxPlotAttributes& other)
{

}


bool NoBoxPlotAttributes::accept(const string& node)
{

if ( magCompare(node, "boxplot") )
return true;

return false;
}

void NoBoxPlotAttributes::set(const XmlNode& node)
{
bool apply = false;

if ( this->accept(node.name()) == false )
return;

if ( magCompare(node.name(), "boxplot") )
apply = true;


if ( apply )
set(node.attributes());
else {

}
for (auto &elt : node.elements())
{

}
}

void NoBoxPlotAttributes::print(ostream& out) const
{
out << "Attributes[";

out << "]" << "\n";
}

void NoBoxPlotAttributes::toxml(ostream& out) const
{
out << "\"boxplot\"";

}

Loading

0 comments on commit 66a126f

Please sign in to comment.