Skip to content

Commit

Permalink
Pull request #218: Release/4.15.0
Browse files Browse the repository at this point in the history
Merge in MAG/magics from release/4.15.0 to master

* commit '6fdbe62f6eae52bef90b489f2e94ccebb43965d4': (28 commits)
  Issue with contour-min/max and contour_shade_min/max
  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
  Add few opition for CAMS symbol plotting
  ...
  • Loading branch information
sylvielamythepaut committed Dec 11, 2023
2 parents 4a45cbe + 6fdbe62 commit ee107c9
Show file tree
Hide file tree
Showing 62 changed files with 2,437 additions and 390 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
6 changes: 6 additions & 0 deletions share/magics/styles/ecmwf/test/styles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"red_lines" : {
"contour" : "on",
"contour_line_colour" : "red"
}
}
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
42 changes: 42 additions & 0 deletions src/attributes/EpsPlumeAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ using namespace magics;
EpsPlumeAttributes::EpsPlumeAttributes():
method_(ParameterManager::getString("eps_plume_method")),
legend_(ParameterManager::getBool("eps_plume_legend")),
legend_grey_style_(ParameterManager::getBool("eps_plume_legend_grey_style")),
line_(ParameterManager::getBool("eps_plume_members")),
line_thickness_(ParameterManager::getInt("eps_plume_line_thickness")),
forecast_(ParameterManager::getBool("eps_plume_forecast")),
Expand All @@ -35,6 +36,11 @@ EpsPlumeAttributes::EpsPlumeAttributes():
control_line_thickness_(ParameterManager::getInt("eps_plume_control_line_thickness")),
median_(ParameterManager::getBool("eps_plume_median")),
median_line_thickness_(ParameterManager::getInt("eps_plume_median_line_thickness")),
percentiles_(ParameterManager::getBool("eps_plume_percentiles")),
percentiles_list_(ParameterManager::getDoubleArray("eps_plume_percentiles_list")),
percentiles_line_colour_list_(ParameterManager::getStringArray("eps_plume_percentiles_line_colour_list")),
percentiles_line_style_list_(ParameterManager::getStringArray("eps_plume_percentiles_line_style_list")),
percentiles_line_thickness_list_(ParameterManager::getIntArray("eps_plume_percentiles_line_thickness_list")),
shading_(ParameterManager::getBool("eps_plume_shading")),
shading_levels_(ParameterManager::getDoubleArray("eps_plume_shading_level_list")),
shading_colours_(ParameterManager::getStringArray("eps_plume_shading_colour_list")),
Expand Down Expand Up @@ -74,6 +80,7 @@ void EpsPlumeAttributes::set(const std::map<string, string>& params)

setAttribute(prefix, "eps_plume_method", method_, params);
setAttribute(prefix, "eps_plume_legend", legend_, params);
setAttribute(prefix, "eps_plume_legend_grey_style", legend_grey_style_, params);
setAttribute(prefix, "eps_plume_members", line_, params);
setAttribute(prefix, "eps_plume_line_thickness", line_thickness_, params);
setAttribute(prefix, "eps_plume_forecast", forecast_, params);
Expand All @@ -82,6 +89,11 @@ void EpsPlumeAttributes::set(const std::map<string, string>& params)
setAttribute(prefix, "eps_plume_control_line_thickness", control_line_thickness_, params);
setAttribute(prefix, "eps_plume_median", median_, params);
setAttribute(prefix, "eps_plume_median_line_thickness", median_line_thickness_, params);
setAttribute(prefix, "eps_plume_percentiles", percentiles_, params);
setAttribute(prefix, "eps_plume_percentiles_list", percentiles_list_, params);
setAttribute(prefix, "eps_plume_percentiles_line_colour_list", percentiles_line_colour_list_, params);
setAttribute(prefix, "eps_plume_percentiles_line_style_list", percentiles_line_style_list_, params);
setAttribute(prefix, "eps_plume_percentiles_line_thickness_list", percentiles_line_thickness_list_, params);
setAttribute(prefix, "eps_plume_shading", shading_, params);
setAttribute(prefix, "eps_plume_shading_level_list", shading_levels_, params);
setAttribute(prefix, "eps_plume_shading_colour_list", shading_colours_, params);
Expand All @@ -108,6 +120,7 @@ void EpsPlumeAttributes::copy(const EpsPlumeAttributes& other)
{
method_ = other.method_;
legend_ = other.legend_;
legend_grey_style_ = other.legend_grey_style_;
line_ = other.line_;
line_thickness_ = other.line_thickness_;
forecast_ = other.forecast_;
Expand All @@ -116,6 +129,11 @@ void EpsPlumeAttributes::copy(const EpsPlumeAttributes& other)
control_line_thickness_ = other.control_line_thickness_;
median_ = other.median_;
median_line_thickness_ = other.median_line_thickness_;
percentiles_ = other.percentiles_;
percentiles_list_ = other.percentiles_list_;
percentiles_line_colour_list_ = other.percentiles_line_colour_list_;
percentiles_line_style_list_ = other.percentiles_line_style_list_;
percentiles_line_thickness_list_ = other.percentiles_line_thickness_list_;
shading_ = other.shading_;
shading_levels_ = other.shading_levels_;
shading_colours_ = other.shading_colours_;
Expand Down Expand Up @@ -174,6 +192,7 @@ void EpsPlumeAttributes::print(ostream& out) const
out << "Attributes[";
out << " method = " << method_;
out << " legend = " << legend_;
out << " legend_grey_style = " << legend_grey_style_;
out << " line = " << line_;
out << " line_thickness = " << line_thickness_;
out << " forecast = " << forecast_;
Expand All @@ -182,6 +201,11 @@ void EpsPlumeAttributes::print(ostream& out) const
out << " control_line_thickness = " << control_line_thickness_;
out << " median = " << median_;
out << " median_line_thickness = " << median_line_thickness_;
out << " percentiles = " << percentiles_;
out << " percentiles_list = " << percentiles_list_;
out << " percentiles_line_colour_list = " << percentiles_line_colour_list_;
out << " percentiles_line_style_list = " << percentiles_line_style_list_;
out << " percentiles_line_thickness_list = " << percentiles_line_thickness_list_;
out << " shading = " << shading_;
out << " shading_levels = " << shading_levels_;
out << " shading_colours = " << shading_colours_;
Expand Down Expand Up @@ -211,6 +235,8 @@ void EpsPlumeAttributes::toxml(ostream& out) const
niceprint(out,method_);
out << ", \"eps_plume_legend\":";
niceprint(out,legend_);
out << ", \"eps_plume_legend_grey_style\":";
niceprint(out,legend_grey_style_);
out << ", \"eps_plume_members\":";
niceprint(out,line_);
out << ", \"eps_plume_line_thickness\":";
Expand All @@ -227,6 +253,16 @@ void EpsPlumeAttributes::toxml(ostream& out) const
niceprint(out,median_);
out << ", \"eps_plume_median_line_thickness\":";
niceprint(out,median_line_thickness_);
out << ", \"eps_plume_percentiles\":";
niceprint(out,percentiles_);
out << ", \"eps_plume_percentiles_list\":";
niceprint(out,percentiles_list_);
out << ", \"eps_plume_percentiles_line_colour_list\":";
niceprint(out,percentiles_line_colour_list_);
out << ", \"eps_plume_percentiles_line_style_list\":";
niceprint(out,percentiles_line_style_list_);
out << ", \"eps_plume_percentiles_line_thickness_list\":";
niceprint(out,percentiles_line_thickness_list_);
out << ", \"eps_plume_shading\":";
niceprint(out,shading_);
out << ", \"eps_plume_shading_level_list\":";
Expand Down Expand Up @@ -268,6 +304,7 @@ void EpsPlumeAttributes::toxml(ostream& out) const

static MagicsParameter<string> eps_plume_method("eps_plume_method", "time_serie");
static MagicsParameter<string> eps_plume_legend("eps_plume_legend", "on");
static MagicsParameter<string> eps_plume_legend_grey_style("eps_plume_legend_grey_style", "on");
static MagicsParameter<string> eps_plume_members("eps_plume_members", "on");
static MagicsParameter<int> eps_plume_line_thickness("eps_plume_line_thickness", 1);
static MagicsParameter<string> eps_plume_forecast("eps_plume_forecast", "on");
Expand All @@ -276,6 +313,11 @@ static MagicsParameter<string> eps_plume_control("eps_plume_control", "on");
static MagicsParameter<int> eps_plume_control_line_thickness("eps_plume_control_line_thickness", 5);
static MagicsParameter<string> eps_plume_median("eps_plume_median", "off");
static MagicsParameter<int> eps_plume_median_line_thickness("eps_plume_median_line_thickness", 5);
static MagicsParameter<string> eps_plume_percentiles("eps_plume_percentiles", "off");
static MagicsParameter<doublearray> eps_plume_percentiles_list("eps_plume_percentiles_list", floatarray());
static MagicsParameter<stringarray> eps_plume_percentiles_line_colour_list("eps_plume_percentiles_line_colour_list", stringarray());
static MagicsParameter<stringarray> eps_plume_percentiles_line_style_list("eps_plume_percentiles_line_style_list", stringarray());
static MagicsParameter<intarray> eps_plume_percentiles_line_thickness_list("eps_plume_percentiles_line_thickness_list", intarray());
static MagicsParameter<string> eps_plume_shading("eps_plume_shading", "off");
static MagicsParameter<doublearray> eps_plume_shading_level_list("eps_plume_shading_level_list", floatarray());
static MagicsParameter<stringarray> eps_plume_shading_colour_list("eps_plume_shading_colour_list", stringarray());
Expand Down
6 changes: 6 additions & 0 deletions src/attributes/EpsPlumeAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class EpsPlumeAttributes
string tag_;
string method_;
bool legend_;
bool legend_grey_style_;
bool line_;
int line_thickness_;
bool forecast_;
Expand All @@ -61,6 +62,11 @@ class EpsPlumeAttributes
int control_line_thickness_;
bool median_;
int median_line_thickness_;
bool percentiles_;
doublearray percentiles_list_;
stringarray percentiles_line_colour_list_;
stringarray percentiles_line_style_list_;
intarray percentiles_line_thickness_list_;
bool shading_;
doublearray shading_levels_;
stringarray shading_colours_;
Expand Down
32 changes: 32 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 Expand Up @@ -105,6 +111,32 @@ void EpsPlumeWrapper::set(const MagRequest& request)
int median_line_thickness_value = request("EPS_PLUME_MEDIAN_LINE_THICKNESS");
epsplume_->median_line_thickness_ = median_line_thickness_value;
}
if (request.countValues("EPS_PLUME_PERCENTILES") ) {
string percentiles_value = request("EPS_PLUME_PERCENTILES");

epsplume_->percentiles_ = MagTranslator<string, bool>()(percentiles_value);

}
doublearray percentiles_list_value;
for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LIST"); i++)
percentiles_list_value.push_back((double)request("EPS_PLUME_PERCENTILES_LIST", i));
if ( !percentiles_list_value.empty() )
epsplume_->percentiles_list_ = percentiles_list_value;
stringarray percentiles_line_colour_list_value;
for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_COLOUR_LIST"); i++)
percentiles_line_colour_list_value.push_back((string)request("EPS_PLUME_PERCENTILES_LINE_COLOUR_LIST", i));
if ( !percentiles_line_colour_list_value.empty() )
epsplume_->percentiles_line_colour_list_ = percentiles_line_colour_list_value;
stringarray percentiles_line_style_list_value;
for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_STYLE_LIST"); i++)
percentiles_line_style_list_value.push_back((string)request("EPS_PLUME_PERCENTILES_LINE_STYLE_LIST", i));
if ( !percentiles_line_style_list_value.empty() )
epsplume_->percentiles_line_style_list_ = percentiles_line_style_list_value;
intarray percentiles_line_thickness_list_value;
for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_THICKNESS_LIST"); i++)
percentiles_line_thickness_list_value.push_back((int)request("EPS_PLUME_PERCENTILES_LINE_THICKNESS_LIST", i));
if ( !percentiles_line_thickness_list_value.empty() )
epsplume_->percentiles_line_thickness_list_ = percentiles_line_thickness_list_value;
if (request.countValues("EPS_PLUME_SHADING") ) {
string shading_value = request("EPS_PLUME_SHADING");

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
Loading

0 comments on commit ee107c9

Please sign in to comment.