From 5950f3540b16882e368fde93e4f81ca8125a95bb Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Wed, 22 Nov 2023 17:47:20 +0000 Subject: [PATCH] Revert in progress --- src/basic/FortranMagics.cc | 10 +++-- src/decoders/GribDecoder.cc | 16 +++++--- src/decoders/GribRegularInterpretor.cc | 2 +- src/visualisers/GradientsColourTechnique.cc | 8 ++-- src/visualisers/IntervalSelectionType.cc | 44 +++++++++++---------- 5 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/basic/FortranMagics.cc b/src/basic/FortranMagics.cc index bf0ea4110..cfd91bc10 100644 --- a/src/basic/FortranMagics.cc +++ b/src/basic/FortranMagics.cc @@ -8,7 +8,7 @@ * nor does it submit to any jurisdiction. */ -/*! \file FortranMagics.cc +/*! \file ics.cc \brief Implementation of the Template class FortranMagics. Magics Team - ECMWF 2007 @@ -435,7 +435,9 @@ void FortranMagics::pobs() { if (!action_ || obsinput_todo_ ) { action_ = new VisualAction(); ObsDecoder* obs = new ObsDecoder(); + cout << "OBS" << endl; if (obs->defined()) { + cout << "defined" << endl; action_->data(obs); top()->push_back(action_); @@ -446,9 +448,9 @@ void FortranMagics::pobs() { top()->push_back(action_); } } - action_ = new VisualAction(); - action_->data(new ObsJSon()); - top()->push_back(action_); + // action_ = new VisualAction(); + // action_->data(new ObsJSon()); + // top()->push_back(action_); action_->visdef(new ObsPlotting()); } diff --git a/src/decoders/GribDecoder.cc b/src/decoders/GribDecoder.cc index a794082ec..fca87cbbe 100644 --- a/src/decoders/GribDecoder.cc +++ b/src/decoders/GribDecoder.cc @@ -760,20 +760,21 @@ void GribDecoder::openField() { void GribDecoder::openFirstComponent() { current_position_ = position_1_; - - if (second_file_name_ == "grib_input_file_name") { - current_position_ = ( position_2_ == -1 ) ? 2 : position_2_; + + if (first_file_name_ == "grib_input_file_name") { current_file_name_= file_name_; } else { - current_position_ = ( position_2_ == -1 ) ? 1 : position_2_; - current_file_name_= second_file_name_; + current_file_name_= first_file_name_; } + MagLog::debug() << "received-> " << current_position_ << " from file " << current_file_name_ < " << position_2_ << " from file " << second_file_name_ < levels; - double lmax, lmin; - if (shading) { - if (max_shade_ < min_shade_) - MagLog::warning() << "contour_shade_max_level (" << max_shade_ << ") < contour_shade_min_level (" - << min_shade_ << "): Please check your code" << endl; - if (same(max_, 1.0e+21)) { - max_ = max_shade_; - } - if (same(min_, -1.0e+21)) { - min_ = min_shade_; - } - } - + double min_level=min; + double max_level=max; - lmax = same(max_, 1.0e+21) ? max : max_; - lmin = same(min_, -1.0e+21) ? min : min_; + if ( MINSET(min_) ) + min_level = min_; + + if ( MAXSET(max_) ) + max_level = max_; + if ( shading && MINSET(min_shade_) ) + min_level = min_shade_; + + if ( shading && MAXSET(max_shade_) ) + max_level = max_shade_; + - levels.insert(lmin); - levels.insert(lmax); + levels.insert(min_level); + levels.insert(max_level); + double level = reference_; double newref; int i = 1; - while (level < lmax && !same(level, lmax)) { - if (level > lmin) + while (level < max_level && !same(level, max_level)) { + if (level > min_level) levels.insert(level); level = reference_ + (i * interval_); i++; } level = reference_; i = 1; - while (level > lmin && !same(level, lmin)) { - if (level < lmax) + while (level > min_level && !same(level, min_level)) { + if (level < max_level) levels.insert(level); level = reference_ - (i * interval_); i++;