Skip to content

Commit

Permalink
Visvility graph : adding wrepjson_y_axis_value to allow more that one…
Browse files Browse the repository at this point in the history
… parameters on the same graph.
  • Loading branch information
sylvielamythepaut committed Feb 16, 2023
1 parent 935385f commit ae70789
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/attributes/WrepJSonAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ WrepJSonAttributes::WrepJSonAttributes():
profile_quantile_(ParameterManager::getString("wrepjson_profile_quantile")),
hodograph_grid_(ParameterManager::getBool("wrepjson_hodograph_grid")),
hodograph_tephi_(ParameterManager::getBool("wrepjson_hodograph_tephi")),
hodograph_member_(ParameterManager::getInt("wrepjson_hodograph_member"))
hodograph_member_(ParameterManager::getInt("wrepjson_hodograph_member")),
y_axis_value_(ParameterManager::getDouble("wrepjson_y_axis_value"))


{
Expand Down Expand Up @@ -105,6 +106,7 @@ void WrepJSonAttributes::set(const std::map<string, string>& params)
setAttribute(prefix, "wrepjson_hodograph_grid", hodograph_grid_, params);
setAttribute(prefix, "wrepjson_hodograph_tephi", hodograph_tephi_, params);
setAttribute(prefix, "wrepjson_hodograph_member", hodograph_member_, params);
setAttribute(prefix, "wrepjson_y_axis_value", y_axis_value_, params);


}
Expand Down Expand Up @@ -142,6 +144,7 @@ void WrepJSonAttributes::copy(const WrepJSonAttributes& other)
hodograph_grid_ = other.hodograph_grid_;
hodograph_tephi_ = other.hodograph_tephi_;
hodograph_member_ = other.hodograph_member_;
y_axis_value_ = other.y_axis_value_;

}

Expand Down Expand Up @@ -211,6 +214,7 @@ void WrepJSonAttributes::print(ostream& out) const
out << " hodograph_grid = " << hodograph_grid_;
out << " hodograph_tephi = " << hodograph_tephi_;
out << " hodograph_member = " << hodograph_member_;
out << " y_axis_value = " << y_axis_value_;

out << "]" << "\n";
}
Expand Down Expand Up @@ -280,6 +284,8 @@ void WrepJSonAttributes::toxml(ostream& out) const
niceprint(out,hodograph_tephi_);
out << ", \"wrepjson_hodograph_member\":";
niceprint(out,hodograph_member_);
out << ", \"wrepjson_y_axis_value\":";
niceprint(out,y_axis_value_);

}

Expand Down Expand Up @@ -314,3 +320,4 @@ static MagicsParameter<string> wrepjson_profile_quantile("wrepjson_profile_quant
static MagicsParameter<string> wrepjson_hodograph_grid("wrepjson_hodograph_grid", "off");
static MagicsParameter<string> wrepjson_hodograph_tephi("wrepjson_hodograph_tephi", "off");
static MagicsParameter<int> wrepjson_hodograph_member("wrepjson_hodograph_member", -1);
static MagicsParameter<double> wrepjson_y_axis_value("wrepjson_y_axis_value", 1);
1 change: 1 addition & 0 deletions src/attributes/WrepJSonAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class WrepJSonAttributes
bool hodograph_grid_;
bool hodograph_tephi_;
int hodograph_member_;
double y_axis_value_;


private:
Expand Down
4 changes: 4 additions & 0 deletions src/attributes/WrepJSonWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ void WrepJSonWrapper::set(const MagRequest& request)
int hodograph_member_value = request("WREPJSON_HODOGRAPH_MEMBER");
wrepjson_->hodograph_member_ = hodograph_member_value;
}
if (request.countValues("WREPJSON_Y_AXIS_VALUE") ) {
double y_axis_value_value = request("WREPJSON_Y_AXIS_VALUE");
wrepjson_->y_axis_value_ = y_axis_value_value;
}


}
Expand Down
7 changes: 7 additions & 0 deletions src/params/WrepJSon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,12 @@ does it submit to any jurisdiction.
visible='off'>
<documentation>slecet only one member</documentation>
</parameter>
<parameter member="y_axis_value"
to="float"
default="1"
from="float"
name="wrepjson_y_axis_value">
<documentation>Used in the visibility product to define the y value</documentation>
</parameter>
</class>
</magics>
4 changes: 2 additions & 2 deletions src/web/WrepJSon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ void WrepJSon::points(const Transformation& transformation, vector<UserPoint>& p
}
// doubble v = (*point)->find("value") != (*point)->end() ) : (**point)["value"] : 0;
if ( family_ == "visibility")
points.push_back(UserPoint(x, 1, (**point)["y"]));
points.push_back(UserPoint(x, y_axis_value_, (**point)["y"]));
else
points.push_back(UserPoint(x, (**point)["y"], (**point)["value"]));

Expand All @@ -1982,7 +1982,7 @@ PointsHandler& WrepJSon::points(const Transformation& transformation, bool) {
}

if ( family_ == "visibility")
list_.push_back(new UserPoint(x, 1, (**point)["y"]));
list_.push_back(new UserPoint(x, y_axis_value_, (**point)["y"]));
else
list_.push_back(new UserPoint(x, (**point)["y"], (**point)["value"]));
if ((*point)->missing())
Expand Down

0 comments on commit ae70789

Please sign in to comment.