Skip to content

Commit

Permalink
Pull request #195: Develop
Browse files Browse the repository at this point in the history
Merge in MAG/magics from develop to master

* commit '78636d96a2050b782f35d5ca6fecc19269dc9978':
  Update Version to 4.10.1 : Hotfix in preparation of the opendata
  Remove warining message for the keyword description.
  Better error message
  Added styles accumulated_tp_1 accumulated_tp_2 accumulated_tp_3 for Accumulated precipitation
  • Loading branch information
sylvielamythepaut committed Jan 10, 2022
2 parents 653f812 + 78636d9 commit a80fc9c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": false,
"files.associations": {
"*.make": "makefile",
"vector": "cpp",
"utility": "cpp",
"ostream": "cpp",
"iostream": "cpp",
"map": "cpp",
"iosfwd": "cpp"
"iosfwd": "cpp",
"filesystem": "cpp"
}
}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +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 )

project( magics VERSION 4.10.0 LANGUAGES CXX )
project( magics VERSION 4.10.1 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
42 changes: 42 additions & 0 deletions share/magics/styles/ecmwf/styles.json
Original file line number Diff line number Diff line change
Expand Up @@ -9422,6 +9422,48 @@
"contour_shade_technique" : "cell_shading",
"contour_title" : "Transparency grey (rgbA)"
},
"accumulated_tp_1" : {
"contour_highlight": "off",
"contour_hilo": "off",
"contour_label": "off",
"contour_legend_text": "Contour shade (Range: 1 / 2000)",
"contour_level_list": "1/4/10/20/30/50/100/250/1000/2000",
"contour_level_selection_type": "level_list",
"contour_shade": "on",
"contour_shade_colour_list": "rgb(0.9,0.85,0.95)/rgb(0.7,0.75,0.95)/rgb(0.7,0.95,0.95)/rgb(0.7,0.95,0.6)/rgb(0.95,0.85,0.6)/red/rgb(0.95,0.6,0.9)/rgb(0.35,0.35,0.35)/violet",
"contour_shade_colour_method": "list",
"contour_shade_method": "area_fill",
"contour_shade_min_level": "1",
"contour_shade_max_level": "2000"
},
"accumulated_tp_2" : {
"contour_highlight": "off",
"contour_hilo": "off",
"contour_label": "off",
"contour_legend_text": "Contour shade (Range: 1/2000)",
"contour_level_list": "1/2/5/10/15/20/30/40/50/75/100/125/150/175/200/250/300/500/2000",
"contour_level_selection_type": "level_list",
"contour_shade": "on",
"contour_shade_colour_list": "RGB(0.5,0.97,0.67)/RGB(0.41,0.93,0.74)/RGB(0.11,0.84,0.94)/RGB(0.04,0.57,1)/RGB(0,0.28,1)/RGB(0.04,0.05,0.99)/RGB(0.04,0.04,0.81)/RGB(0.04,0.04,0.62)/RGB(0.04,0.04,0.44)/RGB(0.27,0.04,0.25)/RGB(0.57,0.04,0.06)/RGB(0.72,0.13,0.04)/RGB(0.85,0.27,0.04)/RGB(0.99,0.40,0.04)/RGB(0.82,0.23,0.30)/RGB(0.62,0.05,0.58)/RGB(0.8,0.30,0.70)/RGB(1,0.76,0.8)",
"contour_shade_colour_method": "list",
"contour_shade_method": "area_fill",
"contour_shade_min_level": "1",
"contour_shade_max_level": "2000"
},
"accumulated_tp_3" : {
"contour_highlight": "off",
"contour_hilo": "off",
"contour_label": "off",
"contour_legend_text": "Contour shade (Range: 0.1/1000)",
"contour_level_list": "0.1/1/2/5/10/15/20/30/40/50/100/300/1000",
"contour_level_selection_type": "level_list",
"contour_shade_colour_list": "RGB(0.94,0.86,0.72)/RGB(0.71,0.98,0.67)/RGB(0.47,0.96,0.45)/RGB(0.71,0.94,0.98)/RGB(0.47,0.73,0.98)/RGB(0.24,0.59,0.96)/RGB(0.12,0.43,0.93)/RGB(1,0.91,0.47)/RGB(1,0.63,0)/red/RGB(0.64,0.13,0.13)/magenta/grey",
"contour_shade": "on",
"contour_shade_colour_method": "list",
"contour_shade_method": "area_fill",
"contour_shade_min_level": "0.1",
"contour_shade_max_level": "1000"
},
"coloured_flags" : {
"legend" : "on",
"wind_field_type" : "flags",
Expand Down
12 changes: 6 additions & 6 deletions src/decoders/NetcdfData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ void TypedAccessor<F, T>::operator()(vector<T>& to, vector<size_t>& start, vecto
std::transform(from.begin(), from.begin() + to.size(), to.begin(), Convertor<F, T>(var));
// for (auto x = start.begin(); x != start.end(); ++x) { cout << "start " << *x << endl; }
// for (auto x = edges.begin(); x != edges.end(); ++x) { cout << "edges " << *x << endl; }

}

template <class F, class T>
void TypedAccessor<F, T>::get(vector<F>& from, vector<size_t>& start, vector<size_t>& edges, NetVariable& var) const {
var.get(&from.front(), start, edges);


}

Netcdf::Netcdf(const string& path, const string& method) : file_(-1) {
int status = nc_open(path.c_str(), NC_NOWRITE, &file_);

if (status != NC_NOERR) {
fprintf(stderr, "ERROR while opening NetCDF file - %s\n", nc_strerror(status));
throw NoSuchNetcdfFile(path);
throw NoSuchNetcdfFile(path, nc_strerror(status));
}

int num_var;
Expand Down Expand Up @@ -157,11 +157,11 @@ int NetDimension::index(const string& val) {
}

int NetDimension::value(const string& val) {

if (variable_ != -1) {
// int index = Index::get(variable_->type(), val, variable_->values(), variable_->num_vals());
NetVariable var(name_, variable_, parent_, "index");

return var.find(val);
}

Expand Down
4 changes: 2 additions & 2 deletions src/decoders/NetcdfData.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class NoSuchNetcdfDimension : public MagicsException {

class NoSuchNetcdfFile : public MagicsException {
public:
NoSuchNetcdfFile(const string& file) :
MagicsException("Netcdf MagException: The file " + file + " does not exist or is not a valid netcdf file") {
NoSuchNetcdfFile(const string& file, const string& why) :
MagicsException("Netcdf MagException: Cannot open " + file + ": " + why) {
MagLog::error() << what() << "\n";
}
};
Expand Down
1 change: 1 addition & 0 deletions src/web/MagConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ void Style::set(const ValueMap& object) {
methods_["eccharts_layer"] = &Style::name;
methods_["visdef"] = &Style::style;
methods_["scaling"] = &Style::ignore;
methods_["description"] = &Style::ignore;
}

for (auto entry = object.begin(); entry != object.end(); ++entry) {
Expand Down

0 comments on commit a80fc9c

Please sign in to comment.