From c46125b6ba72464016fbb94b6daff82deb56ebca Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 18 Jul 2023 12:16:55 -0600 Subject: [PATCH] Per #2565, add LaeaNetcdfData::dump() function and update nccf_file.cc to dump the grid data structs that are parsed, just like we do for other file formats (GRIB2, MET NetCDF, ...) --- src/libcode/vx_data2d_nccf/nccf_file.cc | 13 +++++++++++++ src/libcode/vx_grid/grid_base.cc | 25 +++++++++++++++++++++++++ src/libcode/vx_grid/laea_grid_defs.h | 2 ++ 3 files changed, 40 insertions(+) diff --git a/src/libcode/vx_data2d_nccf/nccf_file.cc b/src/libcode/vx_data2d_nccf/nccf_file.cc index e6925dbbee..e6247766a0 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.cc +++ b/src/libcode/vx_data2d_nccf/nccf_file.cc @@ -1741,10 +1741,13 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m data.nx = _xDim->getSize(); data.ny = _yDim->getSize(); + data.dump(); + // Instantiate grid grid.set(data); if (dy_m < 0) grid.set_swap_to_north(true); + } @@ -2034,6 +2037,8 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin data.ny = _yDim->getSize(); data.so2_angle = 0.0; + data.dump(); + grid.set(data); if (dy_m < 0) grid.set_swap_to_north(true); @@ -2531,6 +2536,8 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va data.false_east = false_east; data.false_north = false_north; + data.dump(); + grid.set(data); //Note: do not set grid.set_swap_to_north() @@ -2833,6 +2840,8 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map data.aux_rotation = 0; + data.dump(); + grid.set(data); grid.set_swap_to_north(swap_to_north); @@ -3143,6 +3152,8 @@ void NcCfFile::get_grid_mapping_geostationary( data.scene_id = scene_id_str; } + data.dump(); + // Note: Computing lat/lon was deferred because it took 1 minutes grid.set(data); @@ -3426,6 +3437,8 @@ void NcCfFile::get_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, lat_counts, lon_counts, swap_to_north); + data.dump(); + grid.set(data); // resets swap_to_north to false if (swap_to_north) grid.set_swap_to_north(true); } diff --git a/src/libcode/vx_grid/grid_base.cc b/src/libcode/vx_grid/grid_base.cc index e129a49ae4..9e5dd32607 100644 --- a/src/libcode/vx_grid/grid_base.cc +++ b/src/libcode/vx_grid/grid_base.cc @@ -221,6 +221,31 @@ mlog << Debug(grid_debug_level) //////////////////////////////////////////////////////////////////////// +void LaeaNetcdfData::dump() const + +{ + +mlog << Debug(grid_debug_level) + << "\nLaea NetCDF Grid Data:\n" + << " name: " << name << "\n" + << " prime_meridian_lon: " << prime_meridian_lon << "\n" + << " semi_major_axis_km: " << semi_major_axis_km << "\n" + << " semi_minor_axis_km: " << semi_minor_axis_km << "\n" + << " proj_origin_lat: " << proj_origin_lat << "\n" + << " proj_origin_lon: " << proj_origin_lon << "\n" + << " x_pin: " << x_pin << "\n" + << " y_pin: " << y_pin << "\n" + << " dx_km: " << dx_km << "\n" + << " dy_km: " << dy_km << "\n" + << " nx: " << nx << "\n" + << " ny: " << ny << "\n\n"; + +} + + +//////////////////////////////////////////////////////////////////////// + + void LaeaData::dump() const { diff --git a/src/libcode/vx_grid/laea_grid_defs.h b/src/libcode/vx_grid/laea_grid_defs.h index 786dbfbb0e..5382aa752b 100644 --- a/src/libcode/vx_grid/laea_grid_defs.h +++ b/src/libcode/vx_grid/laea_grid_defs.h @@ -38,6 +38,8 @@ struct LaeaNetcdfData { int nx; int ny; + void dump() const; + };