Skip to content

Commit

Permalink
Per #2565, add LaeaNetcdfData::dump() function and update nccf_file.c…
Browse files Browse the repository at this point in the history
…c to dump the grid data structs that are parsed, just like we do for other file formats (GRIB2, MET NetCDF, ...)
  • Loading branch information
JohnHalleyGotway committed Jul 18, 2023
1 parent f952f15 commit c46125b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libcode/vx_data2d_nccf/nccf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}


Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
25 changes: 25 additions & 0 deletions src/libcode/vx_grid/grid_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

{
Expand Down
2 changes: 2 additions & 0 deletions src/libcode/vx_grid/laea_grid_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct LaeaNetcdfData {
int nx;
int ny;

void dump() const;

};


Expand Down

0 comments on commit c46125b

Please sign in to comment.