From 76dafdbc5e0198f02a4a18520affbf392f09b6f6 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 17 Aug 2022 14:42:34 -0600 Subject: [PATCH] Per #1954, rename from unstructured grid to semilatlon grid to avoid confusion. --- .../vx_data2d_python/grid_from_python_dict.cc | 10 +-- src/libcode/vx_grid/Makefile.am | 4 +- src/libcode/vx_grid/Makefile.in | 34 ++++----- src/libcode/vx_grid/grid_base.cc | 35 +++++---- src/libcode/vx_grid/grid_base.h | 28 +++---- ...nstructured_grid.cc => semilatlon_grid.cc} | 74 +++++++++---------- ...{unstructured_grid.h => semilatlon_grid.h} | 21 +++--- ...red_grid_defs.h => semilatlon_grid_defs.h} | 10 +-- src/libcode/vx_grid/vx_grid.h | 2 +- src/libcode/vx_plot_util/vx_plot_util.cc | 6 +- 10 files changed, 112 insertions(+), 112 deletions(-) rename src/libcode/vx_grid/{unstructured_grid.cc => semilatlon_grid.cc} (76%) rename src/libcode/vx_grid/{unstructured_grid.h => semilatlon_grid.h} (80%) rename src/libcode/vx_grid/{unstructured_grid_defs.h => semilatlon_grid_defs.h} (79%) diff --git a/src/libcode/vx_data2d_python/grid_from_python_dict.cc b/src/libcode/vx_data2d_python/grid_from_python_dict.cc index f703898f30..4ca54413c7 100644 --- a/src/libcode/vx_data2d_python/grid_from_python_dict.cc +++ b/src/libcode/vx_data2d_python/grid_from_python_dict.cc @@ -30,7 +30,7 @@ static const char merc_string [] = "Mercator"; static const char latlon_string [] = "LatLon"; static const char rotated_latlon_string [] = "Rotated LatLon"; static const char gaussian_string [] = "Gaussian"; -static const char unstructured_string [] = "Unstructured"; +static const char semilatlon_string [] = "SemiLatLon"; //////////////////////////////////////////////////////////////////////// @@ -42,7 +42,7 @@ static void get_merc_grid (const Python3_Dict & dict, Grid & g); static void get_latlon_grid (const Python3_Dict & dict, Grid & g); static void get_rotated_latlon_grid (const Python3_Dict & dict, Grid & g); static void get_gaussian_grid (const Python3_Dict & dict, Grid & g); -static void get_unstructured_grid (const Python3_Dict & dict, Grid & g); +static void get_semilatlon_grid (const Python3_Dict & dict, Grid & g); static void lookup_python_num_array(const Python3_Dict &, const char *, NumArray &); @@ -78,7 +78,7 @@ else if ( proj_type == merc_string ) get_merc_grid (dict, g else if ( proj_type == latlon_string ) get_latlon_grid (dict, g); else if ( proj_type == rotated_latlon_string ) get_rotated_latlon_grid (dict, g); else if ( proj_type == gaussian_string ) get_gaussian_grid (dict, g); -else if ( proj_type == unstructured_string ) get_unstructured_grid (dict, g); +else if ( proj_type == semilatlon_string ) get_semilatlon_grid (dict, g); else { mlog << Error << "\ngrid_from_python_dict() -> " @@ -473,11 +473,11 @@ return; // times (array of double) // -void get_unstructured_grid (const Python3_Dict & dict, Grid & g) +void get_semilatlon_grid (const Python3_Dict & dict, Grid & g) { -UnstructuredData data; +SemiLatLonData data; ConcatString s; s = dict.lookup_string("name"); diff --git a/src/libcode/vx_grid/Makefile.am b/src/libcode/vx_grid/Makefile.am index 9eef7c118a..97130d15ef 100644 --- a/src/libcode/vx_grid/Makefile.am +++ b/src/libcode/vx_grid/Makefile.am @@ -30,7 +30,7 @@ libvx_grid_a_SOURCES = \ tcrmw_grid.cc tcrmw_grid.h \ goes_grid_defs.h \ goes_grid.cc goes_grid.h \ - unstructured_grid_defs.h \ - unstructured_grid.cc unstructured_grid.h \ + semilatlon_grid_defs.h \ + semilatlon_grid.cc semilatlon_grid.h \ vx_grid.h libvx_grid_a_CPPFLAGS = ${MET_CPPFLAGS} diff --git a/src/libcode/vx_grid/Makefile.in b/src/libcode/vx_grid/Makefile.in index c189cc64dd..7151c4fbca 100644 --- a/src/libcode/vx_grid/Makefile.in +++ b/src/libcode/vx_grid/Makefile.in @@ -119,7 +119,7 @@ am_libvx_grid_a_OBJECTS = libvx_grid_a-earth_rotation.$(OBJEXT) \ libvx_grid_a-rot_latlon_grid.$(OBJEXT) \ libvx_grid_a-tcrmw_grid.$(OBJEXT) \ libvx_grid_a-goes_grid.$(OBJEXT) \ - libvx_grid_a-unstructured_grid.$(OBJEXT) + libvx_grid_a-semilatlon_grid.$(OBJEXT) libvx_grid_a_OBJECTS = $(am_libvx_grid_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -148,7 +148,7 @@ am__depfiles_remade = ./$(DEPDIR)/libvx_grid_a-earth_rotation.Po \ ./$(DEPDIR)/libvx_grid_a-rot_latlon_grid.Po \ ./$(DEPDIR)/libvx_grid_a-st_grid.Po \ ./$(DEPDIR)/libvx_grid_a-tcrmw_grid.Po \ - ./$(DEPDIR)/libvx_grid_a-unstructured_grid.Po + ./$(DEPDIR)/libvx_grid_a-semilatlon_grid.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -374,8 +374,8 @@ libvx_grid_a_SOURCES = \ tcrmw_grid.cc tcrmw_grid.h \ goes_grid_defs.h \ goes_grid.cc goes_grid.h \ - unstructured_grid_defs.h \ - unstructured_grid.cc unstructured_grid.h \ + semilatlon_grid_defs.h \ + semilatlon_grid.cc semilatlon_grid.h \ vx_grid.h libvx_grid_a_CPPFLAGS = ${MET_CPPFLAGS} @@ -439,7 +439,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_grid_a-rot_latlon_grid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_grid_a-st_grid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_grid_a-tcrmw_grid.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_grid_a-unstructured_grid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_grid_a-semilatlon_grid.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -629,19 +629,19 @@ libvx_grid_a-goes_grid.obj: goes_grid.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_grid_a-goes_grid.obj `if test -f 'goes_grid.cc'; then $(CYGPATH_W) 'goes_grid.cc'; else $(CYGPATH_W) '$(srcdir)/goes_grid.cc'; fi` -libvx_grid_a-unstructured_grid.o: unstructured_grid.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_grid_a-unstructured_grid.o -MD -MP -MF $(DEPDIR)/libvx_grid_a-unstructured_grid.Tpo -c -o libvx_grid_a-unstructured_grid.o `test -f 'unstructured_grid.cc' || echo '$(srcdir)/'`unstructured_grid.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_grid_a-unstructured_grid.Tpo $(DEPDIR)/libvx_grid_a-unstructured_grid.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unstructured_grid.cc' object='libvx_grid_a-unstructured_grid.o' libtool=no @AMDEPBACKSLASH@ +libvx_grid_a-semilatlon_grid.o: semilatlon_grid.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_grid_a-semilatlon_grid.o -MD -MP -MF $(DEPDIR)/libvx_grid_a-semilatlon_grid.Tpo -c -o libvx_grid_a-semilatlon_grid.o `test -f 'semilatlon_grid.cc' || echo '$(srcdir)/'`semilatlon_grid.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_grid_a-semilatlon_grid.Tpo $(DEPDIR)/libvx_grid_a-semilatlon_grid.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='semilatlon_grid.cc' object='libvx_grid_a-semilatlon_grid.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_grid_a-unstructured_grid.o `test -f 'unstructured_grid.cc' || echo '$(srcdir)/'`unstructured_grid.cc +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_grid_a-semilatlon_grid.o `test -f 'semilatlon_grid.cc' || echo '$(srcdir)/'`semilatlon_grid.cc -libvx_grid_a-unstructured_grid.obj: unstructured_grid.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_grid_a-unstructured_grid.obj -MD -MP -MF $(DEPDIR)/libvx_grid_a-unstructured_grid.Tpo -c -o libvx_grid_a-unstructured_grid.obj `if test -f 'unstructured_grid.cc'; then $(CYGPATH_W) 'unstructured_grid.cc'; else $(CYGPATH_W) '$(srcdir)/unstructured_grid.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_grid_a-unstructured_grid.Tpo $(DEPDIR)/libvx_grid_a-unstructured_grid.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unstructured_grid.cc' object='libvx_grid_a-unstructured_grid.obj' libtool=no @AMDEPBACKSLASH@ +libvx_grid_a-semilatlon_grid.obj: semilatlon_grid.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_grid_a-semilatlon_grid.obj -MD -MP -MF $(DEPDIR)/libvx_grid_a-semilatlon_grid.Tpo -c -o libvx_grid_a-semilatlon_grid.obj `if test -f 'semilatlon_grid.cc'; then $(CYGPATH_W) 'semilatlon_grid.cc'; else $(CYGPATH_W) '$(srcdir)/semilatlon_grid.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_grid_a-semilatlon_grid.Tpo $(DEPDIR)/libvx_grid_a-semilatlon_grid.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='semilatlon_grid.cc' object='libvx_grid_a-semilatlon_grid.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_grid_a-unstructured_grid.obj `if test -f 'unstructured_grid.cc'; then $(CYGPATH_W) 'unstructured_grid.cc'; else $(CYGPATH_W) '$(srcdir)/unstructured_grid.cc'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_grid_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_grid_a-semilatlon_grid.obj `if test -f 'semilatlon_grid.cc'; then $(CYGPATH_W) 'semilatlon_grid.cc'; else $(CYGPATH_W) '$(srcdir)/semilatlon_grid.cc'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -780,7 +780,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libvx_grid_a-rot_latlon_grid.Po -rm -f ./$(DEPDIR)/libvx_grid_a-st_grid.Po -rm -f ./$(DEPDIR)/libvx_grid_a-tcrmw_grid.Po - -rm -f ./$(DEPDIR)/libvx_grid_a-unstructured_grid.Po + -rm -f ./$(DEPDIR)/libvx_grid_a-semilatlon_grid.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -838,7 +838,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libvx_grid_a-rot_latlon_grid.Po -rm -f ./$(DEPDIR)/libvx_grid_a-st_grid.Po -rm -f ./$(DEPDIR)/libvx_grid_a-tcrmw_grid.Po - -rm -f ./$(DEPDIR)/libvx_grid_a-unstructured_grid.Po + -rm -f ./$(DEPDIR)/libvx_grid_a-semilatlon_grid.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/libcode/vx_grid/grid_base.cc b/src/libcode/vx_grid/grid_base.cc index d147d9b918..8cccdbba66 100644 --- a/src/libcode/vx_grid/grid_base.cc +++ b/src/libcode/vx_grid/grid_base.cc @@ -226,12 +226,12 @@ mlog << Debug(grid_debug_level) //////////////////////////////////////////////////////////////////////// -void UnstructuredData::dump() +void SemiLatLonData::dump() { mlog << Debug(grid_debug_level) - << "\nUnstructured Grid Data:\n" + << "\nSemiLatLon Grid Data:\n" << " lats: " << lats.serialize() << "\n" << " lons: " << lons.serialize() << "\n" << " levels: " << levels.serialize() << "\n" @@ -316,7 +316,7 @@ m = (const MercatorData *) 0; g = (const GaussianData *) 0; gi = (const GoesImagerData *) 0; tc = (const TcrmwData *) 0; -ug = (const UnstructuredData *) 0; +sl = (const SemiLatLonData *) 0; clear(); @@ -340,7 +340,7 @@ if ( m ) { delete m; m = (const MercatorData *) 0; }; if ( g ) { delete g; g = (const GaussianData *) 0; }; if ( gi ) { delete gi; gi = (const GoesImagerData *) 0; }; if ( tc ) { delete tc; tc = (const TcrmwData *) 0; }; -if ( ug ) { delete ug; ug = (const UnstructuredData *) 0; }; +if ( sl ) { delete sl; sl = (const SemiLatLonData *) 0; }; return; @@ -361,7 +361,7 @@ if ( info.rll ) set( *(info.rll) ); if ( info.m ) set( *(info.m ) ); if ( info.g ) set( *(info.g ) ); if ( info.gi ) set( *(info.gi ) ); -if ( info.ug ) set( *(info.ug ) ); +if ( info.sl ) set( *(info.sl ) ); return; @@ -384,7 +384,7 @@ if ( rll ) ++count; if ( m ) ++count; if ( g ) ++count; if ( gi ) ++count; -if ( ug ) ++count; +if ( sl ) ++count; return ( count == 1 ); @@ -413,7 +413,7 @@ else if ( rll ) gg.set( *rll ); else if ( m ) gg.set( *m ); else if ( g ) gg.set( *g ); else if ( gi ) gg.set( *gi ); -else if ( ug ) gg.set( *ug ); +else if ( sl ) gg.set( *sl ); return; @@ -578,15 +578,15 @@ return; //////////////////////////////////////////////////////////////////////// -void GridInfo::set(const UnstructuredData & data) +void GridInfo::set(const SemiLatLonData & data) { clear(); -UnstructuredData * D = (UnstructuredData *) 0; +SemiLatLonData * D = (SemiLatLonData *) 0; -D = new UnstructuredData; +D = new SemiLatLonData; // // deep copy instead of memcpy because the struct @@ -595,7 +595,7 @@ D = new UnstructuredData; *D = data; -ug = D; D = (UnstructuredData *) 0; +sl = D; D = (SemiLatLonData *) 0; return; @@ -1141,13 +1141,12 @@ if ( info_new.lc ) { g_new.set(m_new); -} else if ( info_new.ug ) { +} else if ( info_new.sl ) { - UnstructuredData ug_new = *(info_new.ug); - - // JHG, define the subsetting logic here + mlog << Error << "\n\n Grid::subset_ll() const -> " + << "subsetting is not supported for SemiLatLon grids\n\n"; - g_new.set(ug_new); + exit ( 1 ); } else { @@ -1253,7 +1252,7 @@ else if ( i1.rll && i2.rll ) return ( is_eq(i1.rll, i2.rll) ); else if ( i1.m && i2.m ) return ( is_eq(i1.m, i2.m ) ); else if ( i1.g && i2.g ) return ( is_eq(i1.g, i2.g ) ); else if ( i1.gi && i2.gi ) return ( is_eq(i1.gi, i2.gi ) ); -else if ( i1.ug && i2.ug ) return ( is_eq(i1.ug, i2.ug ) ); +else if ( i1.sl && i2.sl ) return ( is_eq(i1.sl, i2.sl ) ); return ( false ); @@ -1459,7 +1458,7 @@ return ( status ); //////////////////////////////////////////////////////////////////////// -bool is_eq(const UnstructuredData * gi1, const UnstructuredData * gi2) +bool is_eq(const SemiLatLonData * gi1, const SemiLatLonData * gi2) { if ( !gi1 || !gi2 ) return ( false ); diff --git a/src/libcode/vx_grid/grid_base.h b/src/libcode/vx_grid/grid_base.h index 015c471718..23940e741d 100644 --- a/src/libcode/vx_grid/grid_base.h +++ b/src/libcode/vx_grid/grid_base.h @@ -32,7 +32,7 @@ #include "merc_grid_defs.h" #include "gaussian_grid_defs.h" #include "goes_grid_defs.h" -#include "unstructured_grid_defs.h" +#include "semilatlon_grid_defs.h" //////////////////////////////////////////////////////////////////////// @@ -65,15 +65,15 @@ class GridInfo { bool ok() const; - void set(const LambertData &); - void set(const StereographicData &); - void set(const LatLonData &); - void set(const RotatedLatLonData &); - void set(const MercatorData &); - void set(const GaussianData &); - void set(const GoesImagerData &); - void set(const TcrmwData &); - void set(const UnstructuredData &); + void set(const LambertData &); + void set(const StereographicData &); + void set(const LatLonData &); + void set(const RotatedLatLonData &); + void set(const MercatorData &); + void set(const GaussianData &); + void set(const GoesImagerData &); + void set(const TcrmwData &); + void set(const SemiLatLonData &); void create_grid(Grid &) const; @@ -89,7 +89,7 @@ class GridInfo { const GaussianData * g; // allocated const GoesImagerData * gi; // allocated const TcrmwData * tc; // allocated - const UnstructuredData * ug; // allocated + const SemiLatLonData * sl; // allocated }; @@ -208,7 +208,7 @@ class Grid : public GridInterface { Grid(const GaussianData &); Grid(const GoesImagerData &); Grid(const TcrmwData &); - Grid(const UnstructuredData &); + Grid(const SemiLatLonData &); virtual ~Grid(); Grid(const Grid &); Grid & operator=(const Grid &); @@ -226,7 +226,7 @@ class Grid : public GridInterface { void set (const GaussianData &); void set (const GoesImagerData &); void set (const TcrmwData &); - void set (const UnstructuredData &); + void set (const SemiLatLonData &); void set_swap_to_north(bool swap_to_north); bool get_swap_to_north() const; @@ -280,7 +280,7 @@ extern bool is_eq(const RotatedLatLonData *, const RotatedLatLonData *); extern bool is_eq(const MercatorData *, const MercatorData *); extern bool is_eq(const GaussianData *, const GaussianData *); extern bool is_eq(const GoesImagerData *, const GoesImagerData *); -extern bool is_eq(const UnstructuredData *, const UnstructuredData *); +extern bool is_eq(const SemiLatLonData *, const SemiLatLonData *); //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_grid/unstructured_grid.cc b/src/libcode/vx_grid/semilatlon_grid.cc similarity index 76% rename from src/libcode/vx_grid/unstructured_grid.cc rename to src/libcode/vx_grid/semilatlon_grid.cc index c8ee414dc4..1a841c238c 100644 --- a/src/libcode/vx_grid/unstructured_grid.cc +++ b/src/libcode/vx_grid/semilatlon_grid.cc @@ -23,21 +23,21 @@ using namespace std; #include "vx_math.h" #include "vx_util.h" #include "vx_log.h" -#include "unstructured_grid.h" +#include "semilatlon_grid.h" //////////////////////////////////////////////////////////////////////// // - // Code for class UnstructuredGrid + // Code for class SemiLatLonGrid // //////////////////////////////////////////////////////////////////////// -UnstructuredGrid::UnstructuredGrid() +SemiLatLonGrid::SemiLatLonGrid() { @@ -49,7 +49,7 @@ clear(); //////////////////////////////////////////////////////////////////////// -UnstructuredGrid::~UnstructuredGrid() +SemiLatLonGrid::~SemiLatLonGrid() { @@ -61,7 +61,7 @@ clear(); //////////////////////////////////////////////////////////////////////// -UnstructuredGrid::UnstructuredGrid(const UnstructuredData & data) +SemiLatLonGrid::SemiLatLonGrid(const SemiLatLonData & data) { @@ -84,7 +84,7 @@ add_dimension(data.times, Times); if ( !xDim || !yDim ) { - mlog << Error << "\nUnstructuredGrid::UnstructuredGrid(const UnstructuredData & data) -> " + mlog << Error << "\nSemiLatLonGrid::SemiLatLonGrid(const SemiLatLonData & data) -> " << "exactly two dimensions should have non-zero length: lats (" << Lats.n() << "), lons (" << Lons.n() << "), levels (" << Levels.n() << "), times (" << Times.n() << ")\n\n"; @@ -103,7 +103,7 @@ if ( Lats.n() > 0 && Lons.n() > 0 ) { if ( Lats.n() != Lons.n() ) { - mlog << Error << "\nUnstructuredGrid::UnstructuredGrid(const UnstructuredData & data) -> " + mlog << Error << "\nSemiLatLonGrid::SemiLatLonGrid(const SemiLatLonData & data) -> " << "for one dimensional arrays, the number lats and lons must match (" << Lats.n() << " != " << Lons.n() << ")!\n\n"; exit ( 1 ); @@ -132,7 +132,7 @@ return; //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::add_dimension(const NumArray &data, NumArray &dim) +void SemiLatLonGrid::add_dimension(const NumArray &data, NumArray &dim) { @@ -148,7 +148,7 @@ if ( dim.n() == 0 ) return; else if ( !yDim ) yDim = &dim; else { - mlog << Error << "\nvoid UnstructuredGrid::add_dimension() -> " + mlog << Error << "\nvoid SemiLatLonGrid::add_dimension() -> " << "more than two non-zero dimensions!\n\n"; exit ( 1 ); @@ -161,7 +161,7 @@ return; //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::clear() +void SemiLatLonGrid::clear() { @@ -188,12 +188,12 @@ return; //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::latlon_to_xy(double lat, double lon, double & x, double & y) const +void SemiLatLonGrid::latlon_to_xy(double lat, double lon, double & x, double & y) const { if ( !xDim || !yDim ) { - mlog << Error << "\nUnstructuredGrid::latlon_to_xy() -> " + mlog << Error << "\nSemiLatLonGrid::latlon_to_xy() -> " << "dimensions not defined!\n\n"; exit ( 1 ); } @@ -232,7 +232,7 @@ else { } if ( is_bad_data(x_int) || is_bad_data(y_int) ) { - mlog << Error << "\nUnstructuredGrid::latlon_to_xy() -> " + mlog << Error << "\nSemiLatLonGrid::latlon_to_xy() -> " << "no match found for (" << lat << ", " << lon << ").\n\n"; exit ( 1 ); } @@ -248,12 +248,12 @@ return; //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::xy_to_latlon(double x, double y, double & lat, double & lon) const +void SemiLatLonGrid::xy_to_latlon(double x, double y, double & lat, double & lon) const { if ( !xDim || !yDim ) { - mlog << Error << "\nUnstructuredGrid::xy_to_latlon() -> " + mlog << Error << "\nSemiLatLonGrid::xy_to_latlon() -> " << "dimensions not defined!\n\n"; exit ( 1 ); } @@ -263,7 +263,7 @@ int y_int = nint(y); if ( x_int < 0 || x_int >= Nx || y_int < 0 || y_int >= Ny ) { - mlog << Error << "\nUnstructuredGrid::xy_to_latlon() -> " + mlog << Error << "\nSemiLatLonGrid::xy_to_latlon() -> " << "(" << x_int << ", " << y_int << ") outside of the grid dimension (" << Nx << ", " << Ny <<")!\n\n"; exit ( 1 ); @@ -280,11 +280,11 @@ return; //////////////////////////////////////////////////////////////////////// -double UnstructuredGrid::calc_area(int x, int y) const +double SemiLatLonGrid::calc_area(int x, int y) const { - // Grid cell area is not defined for unstructured grids + // Grid cell area is not defined for semilatlon grids return ( bad_data_double ); @@ -294,7 +294,7 @@ return ( bad_data_double ); //////////////////////////////////////////////////////////////////////// -int UnstructuredGrid::nx() const +int SemiLatLonGrid::nx() const { @@ -306,7 +306,7 @@ return ( Nx ); //////////////////////////////////////////////////////////////////////// -int UnstructuredGrid::ny() const +int SemiLatLonGrid::ny() const { @@ -318,7 +318,7 @@ return ( Ny ); //////////////////////////////////////////////////////////////////////// -ConcatString UnstructuredGrid::name() const +ConcatString SemiLatLonGrid::name() const { @@ -330,7 +330,7 @@ return ( Name ); //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::dump(ostream & out, int depth) const +void SemiLatLonGrid::dump(ostream & out, int depth) const { @@ -344,7 +344,7 @@ else out << "(nul)\n"; out << '\n'; -out << prefix << "Projection = Unstructured\n"; +out << prefix << "Projection = SemiLatLon\n"; out << prefix << "Lats:\n"; Lats.dump(out, depth+1); @@ -376,13 +376,13 @@ return; //////////////////////////////////////////////////////////////////////// -ConcatString UnstructuredGrid::serialize(const char *sep) const +ConcatString SemiLatLonGrid::serialize(const char *sep) const { ConcatString a; -a << "Projection: Unstructured" << sep; +a << "Projection: SemiLatLon" << sep; a << "Nx: " << Nx << sep; a << "Ny: " << Ny << sep; @@ -404,7 +404,7 @@ return ( a ); //////////////////////////////////////////////////////////////////////// -GridInfo UnstructuredGrid::info() const +GridInfo SemiLatLonGrid::info() const { @@ -420,13 +420,13 @@ return ( i ); //////////////////////////////////////////////////////////////////////// -double UnstructuredGrid::rot_grid_to_earth(int x, int y) const +double SemiLatLonGrid::rot_grid_to_earth(int x, int y) const { // // The rotation angle from grid relative to earth relative -// does not apply to unstructured grids +// does not apply to semilatlon grids // return ( 0.0 ); @@ -437,7 +437,7 @@ return ( 0.0 ); //////////////////////////////////////////////////////////////////////// -bool UnstructuredGrid::wrap_lon() const +bool SemiLatLonGrid::wrap_lon() const { @@ -449,11 +449,11 @@ return ( false ); //////////////////////////////////////////////////////////////////////// -void UnstructuredGrid::shift_right(int N) +void SemiLatLonGrid::shift_right(int N) { -mlog << Error << "\nUnstructuredGrid::shift_right(int) -> " +mlog << Error << "\nSemiLatLonGrid::shift_right(int) -> " << "shifting is not allowed for non-global grids\n\n"; exit ( 1 ); @@ -466,11 +466,11 @@ return; //////////////////////////////////////////////////////////////////////// -GridRep * UnstructuredGrid::copy() const +GridRep * SemiLatLonGrid::copy() const { -UnstructuredGrid * p = new UnstructuredGrid (Data); +SemiLatLonGrid * p = new SemiLatLonGrid (Data); p->Name = Name; @@ -490,7 +490,7 @@ return ( p ); //////////////////////////////////////////////////////////////////////// -Grid::Grid(const UnstructuredData & data) +Grid::Grid(const SemiLatLonData & data) { @@ -504,17 +504,17 @@ set(data); //////////////////////////////////////////////////////////////////////// -void Grid::set(const UnstructuredData & data) +void Grid::set(const SemiLatLonData & data) { clear(); -rep = new UnstructuredGrid (data); +rep = new SemiLatLonGrid (data); if ( !rep ) { - mlog << Error << "\nGrid::set(const UnstructuredData &) -> " + mlog << Error << "\nGrid::set(const SemiLatLonData &) -> " << "memory allocation error\n\n"; exit ( 1 ); diff --git a/src/libcode/vx_grid/unstructured_grid.h b/src/libcode/vx_grid/semilatlon_grid.h similarity index 80% rename from src/libcode/vx_grid/unstructured_grid.h rename to src/libcode/vx_grid/semilatlon_grid.h index 863935a532..6c90d9a278 100644 --- a/src/libcode/vx_grid/unstructured_grid.h +++ b/src/libcode/vx_grid/semilatlon_grid.h @@ -10,8 +10,8 @@ //////////////////////////////////////////////////////////////////////// -#ifndef __MET_UNSTRUCTURED_GRID_H__ -#define __MET_UNSTRUCTURED_GRID_H__ +#ifndef __MET_SEMILATLON_GRID_H__ +#define __MET_SEMILATLON_GRID_H__ //////////////////////////////////////////////////////////////////////// @@ -23,15 +23,15 @@ //////////////////////////////////////////////////////////////////////// -class UnstructuredGrid : public GridRep { +class SemiLatLonGrid : public GridRep { friend class Grid; private: - UnstructuredGrid(); - ~UnstructuredGrid(); - UnstructuredGrid(const UnstructuredData &); + SemiLatLonGrid(); + ~SemiLatLonGrid(); + SemiLatLonGrid(const SemiLatLonData &); void add_dimension(const NumArray &, NumArray &); @@ -43,7 +43,8 @@ class UnstructuredGrid : public GridRep { ConcatString Name; - // Exactly 2 have non-zero length + // Lat and/or Lon are non-empty and Levels or Times are non-empty + // When Lat and Lon are specified, they must be the same length NumArray Lats; NumArray Lons; @@ -60,7 +61,7 @@ class UnstructuredGrid : public GridRep { int Nx; int Ny; - UnstructuredData Data; + SemiLatLonData Data; // // grid interface @@ -99,13 +100,13 @@ class UnstructuredGrid : public GridRep { //////////////////////////////////////////////////////////////////////// -inline double UnstructuredGrid::scale_km() const { return ( -1.0 ); } +inline double SemiLatLonGrid::scale_km() const { return ( -1.0 ); } //////////////////////////////////////////////////////////////////////// -#endif /* __MET_UNSTRUCTURED_GRID_H__ */ +#endif /* __MET_SEMILATLON_GRID_H__ */ //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_grid/unstructured_grid_defs.h b/src/libcode/vx_grid/semilatlon_grid_defs.h similarity index 79% rename from src/libcode/vx_grid/unstructured_grid_defs.h rename to src/libcode/vx_grid/semilatlon_grid_defs.h index e620de2da9..5511007469 100644 --- a/src/libcode/vx_grid/unstructured_grid_defs.h +++ b/src/libcode/vx_grid/semilatlon_grid_defs.h @@ -10,18 +10,18 @@ //////////////////////////////////////////////////////////////////////// -#ifndef __UNSTRUCTURED_GRID_DEFINITIONS_H__ -#define __UNSTRUCTURED_GRID_DEFINITIONS_H__ +#ifndef __SEMILATLON_GRID_DEFINITIONS_H__ +#define __SEMILATLON_GRID_DEFINITIONS_H__ //////////////////////////////////////////////////////////////////////// -struct UnstructuredData { +struct SemiLatLonData { const char * name; - // Exactly two are non-empty + // Arrays to define SemiLatLon dimensions NumArray lats; NumArray lons; @@ -35,7 +35,7 @@ struct UnstructuredData { //////////////////////////////////////////////////////////////////////// -#endif /* __UNSTRUCTURED_GRID_DEFINITIONS_H__ */ +#endif /* __SEMILATLON_GRID_DEFINITIONS_H__ */ //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_grid/vx_grid.h b/src/libcode/vx_grid/vx_grid.h index ed3e0f9818..b1769e7921 100644 --- a/src/libcode/vx_grid/vx_grid.h +++ b/src/libcode/vx_grid/vx_grid.h @@ -29,7 +29,7 @@ #include "merc_grid.h" #include "gaussian_grid.h" #include "tcrmw_grid.h" -#include "unstructured_grid.h" +#include "semilatlon_grid.h" #include "find_grid_by_name.h" diff --git a/src/libcode/vx_plot_util/vx_plot_util.cc b/src/libcode/vx_plot_util/vx_plot_util.cc index fcb5668313..cef6e6d74a 100644 --- a/src/libcode/vx_plot_util/vx_plot_util.cc +++ b/src/libcode/vx_plot_util/vx_plot_util.cc @@ -37,10 +37,10 @@ using namespace std; void draw_map(const Grid &gr, const Box &gr_bb, PSfile &p, const Box &dim, MetConfig *conf) { - // Skip plotting map data for unstructured grids - if ( gr.info().ug ) { + // Skip plotting map data for SemiLatLon grids + if ( gr.info().sl ) { mlog << Debug(4) << "draw_map() -> " - << "Map data is not plotted for unstructured grids.\n"; + << "Map data is not plotted for SemiLatLon grids.\n"; return; }