From 33ba41ed655a8711f9fad7b279bad799145a6f8b Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Fri, 17 May 2024 21:45:51 +0000 Subject: [PATCH] #2857 Added MetNcCFDataFile::build_grid_from_lat_lon_vars --- src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc | 8 ++++++++ src/libcode/vx_data2d_nc_cf/data2d_nc_cf.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc index 1a11af2b0d..8c4373a62c 100644 --- a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc @@ -673,4 +673,12 @@ long MetNcCFDataFile::convert_value_to_offset(double z_value, string z_dim_name) return z_offset; } +//////////////////////////////////////////////////////////////////////// + +Grid MetNcCFDataFile::build_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, + const long lat_counts, const long lon_counts) { + return (nullptr != _file) ? _file->build_grid_from_lat_lon_vars(lat_var, lon_var, lat_counts, lon_counts) : grid(); +} + + //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.h b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.h index a80b176c3a..05e68fc54f 100644 --- a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.h +++ b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.h @@ -102,6 +102,9 @@ class MetNcCFDataFile : public Met2dDataFile { void dump(std::ostream &, int = 0) const; + Grid build_grid_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var, + const long lat_counts, const long lon_counts); + };