diff --git a/modules/dmrpp_module/build_dmrpp_h4/build_dmrpp_util_h4.cc b/modules/dmrpp_module/build_dmrpp_h4/build_dmrpp_util_h4.cc index 4fbed88492..682784317e 100644 --- a/modules/dmrpp_module/build_dmrpp_h4/build_dmrpp_util_h4.cc +++ b/modules/dmrpp_module/build_dmrpp_h4/build_dmrpp_util_h4.cc @@ -1399,7 +1399,7 @@ bool get_chunks_for_an_array(const string& filename, int32 sd_id, int32 file_id, } // Currently this function is only for CF grid_mapping dummy variable. -bool handle_chunks_for_none_array(BaseType *btp, bool disable_missing_data, string &err_msg) { +bool handle_chunks_for_none_array(BaseType *btp, string &err_msg) { bool ret_value = false; @@ -1410,25 +1410,26 @@ bool handle_chunks_for_none_array(BaseType *btp, bool disable_missing_data, stri auto attr = d4_attrs->find("eos_cf_grid_mapping"); - if (disable_missing_data == false) { - // Here we don't bother to check the attribute value since this CF grid variable value is dummy. - if (attr) { - - auto db = dynamic_cast(btp); - if (!db) { - err_msg = "Expected to find a DmrppByte instance but did not in handle_chunks_for_none_array"; - return false; - } + // Since this is just a one-byte variable, regardless the disable_missing data flag, + // we always save the value in the dmrpp file rather than in the missing data side car file. - VERBOSE(cerr<<"For none_array cf dummy grid variable: var name: "<name() <set_missing_data(true); - db->set_value((dods_byte)buf); - db->set_read_p(true); - + auto db = dynamic_cast(btp); + if (!db) { + err_msg = "Expected to find a DmrppByte instance but did not in handle_chunks_for_none_array"; + return false; } + + VERBOSE(cerr<<"For none_array cf dummy grid variable: var name: "<name() <set_missing_data(true); + db->set_value((dods_byte)buf); + db->set_read_p(true); + } ret_value = true; } @@ -1456,7 +1457,7 @@ bool get_chunks_for_a_variable(const string& filename,int32 sd_id, int32 file_id return get_chunks_for_an_array(filename,sd_id,file_id, btp,disable_missing_data); default: { string err_msg; - bool ret_value = handle_chunks_for_none_array(btp,disable_missing_data,err_msg); + bool ret_value = handle_chunks_for_none_array(btp,err_msg); if (ret_value == false) { if (err_msg.empty() == false) { close_hdf4_file_ids(sd_id,file_id); diff --git a/modules/dmrpp_module/build_dmrpp_util.cc b/modules/dmrpp_module/build_dmrpp_util.cc index e7a304a587..6a0fbf6147 100644 --- a/modules/dmrpp_module/build_dmrpp_util.cc +++ b/modules/dmrpp_module/build_dmrpp_util.cc @@ -59,6 +59,7 @@ #include "DmrppD4Group.h" #include "DmrppArray.h" #include "DmrppStructure.h" +#include "DmrppByte.h" #include "D4ParserSax2.h" #include "UnsupportedTypeException.h" @@ -2188,19 +2189,25 @@ hid_t get_h5_dataset_id(hid_t file, BaseType *btp, const unordered_set & dataset = H5Dopen2(file, real_path_candidate.c_str(), H5P_DEFAULT); } - // Here we need to handle a special case for a dmr file generated by the EnableCF option in the HDF5 handler. - // The netCDF-4's pure dimension is mapped to a fake coordinate by the EnableCF option and is ignored by the default option. - // However, netCDF-4 still stores this dimension as an HDF5 variable with 0 values. The EnableCF option replaces - // those 0 values with 0,1,2... as the fake coordinate. So here we need to ignore this kind of variables and let the - // code after this call to handle it as the EnableCF required. - VERBOSE(cerr << prolog << "Working on: " << FQN << endl); + // Note for the majority of cases, we haven't called H5Dopen2 to open this HDF5 dataset(variable) yet, so we need to do it. if (dataset < 0) { dataset = H5Dopen2(file, FQN.c_str(), H5P_DEFAULT); + + // Here we need to handle a special case for a dmr file generated by the EnableCF option in the HDF5 handler. + // The netCDF-4's pure dimension is mapped to a fake coordinate by the EnableCF option and is ignored by the default option. + // However, netCDF-4 still stores this dimension as an HDF5 variable with 0 values. The EnableCF option replaces + // those 0 values with 0,1,2... as the fake coordinate. So here we need to ignore this kind of variables and let the + // code after this call to handle it as the EnableCF required. + + // It is possible that this is a variable that contains data outside the original HDF5 file. + // That means this variable is added to the dmr not based on the original HDF5 file. If this is the case, it should also be handled later. if (dataset < 0) { VERBOSE(cerr << prolog << "WARNING: HDF5 dataset '" << FQN << "' cannot be opened." << endl); + VERBOSE(cerr << prolog << "However, this maybe is a variable that contains the missing data." << endl); + VERBOSE(cerr << prolog << "Check the generated dmrpp file." << endl); } - else if(check_enable_cf_fake_cv(btp, FQN) == true) + else if(check_enable_cf_fake_cv(btp, FQN) == true)// Here dataset = -1 is not an error; it will be handled later. dataset = -1; } } @@ -2301,6 +2308,27 @@ void get_chunks_for_all_variables(hid_t file, D4Group *group, bool disable_dio) if (d4_attrs->empty() == false) { + if (btp->type() == dods_byte_c) { + + auto attr = d4_attrs->find("grid_mapping_name"); + + // Since this is just a one-byte variable, we always save the value in the dmrpp file rather than in the missing data side car file. + if (attr) { + + auto db = dynamic_cast(btp); + if (!db) { + string err_msg = "Expected to find a DmrppByte instance but did not."; + throw BESInternalError(err_msg, __FILE__, __LINE__); + } + VERBOSE(cerr<<"For none_array cf dummy grid variable: var name: "<name() <set_missing_data(true); + db->set_value((dods_byte)buf); + db->set_read_p(true); + + } + } D4Attribute *attr = d4_attrs->find("units"); if (attr) { string attr_value = attr->value(0); diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py b/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py index 8d9596570f..ca0c3ffa07 100644 --- a/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py +++ b/modules/dmrpp_module/get_dmrpp/unit-tests/gen_dmrpp_side_car_test.py @@ -35,8 +35,10 @@ def test_gen_dmrpp_side_car(self): # Hacky removal of lines that otherwise show spurious failure # due to test brittleness. (Better fix would be to run same version # stripping as on non-python tests) - dmrpp_lines_after_79.pop(220) - baseline_lines_after_79.pop(220) + # Although the above statement may be true, + # the following two lines may cause IndexError,however, github macOS build keeps throwing errors. + dmrpp_lines_after_79.pop(216) + baseline_lines_after_79.pop(216) self.assertEqual(dmrpp_lines_after_79 ,baseline_lines_after_79) @@ -56,8 +58,10 @@ def test_gen_dmrpp_side_car2(self): # Hacky removal of lines that otherwise show spurious failure # due to test brittleness. (Better fix would be to run same version # stripping as on non-python tests) - dmrpp_lines_after_19.pop(221) - baseline_lines_after_19.pop(221) + # The following two lines may cause IndexError and they are not necessary since the testing file should not be changed. + # If the testing file is changed, the right way is to update the baseline file. + #dmrpp_lines_after_19.pop(221) + #baseline_lines_after_19.pop(221) self.assertEqual(dmrpp_lines_after_19 ,baseline_lines_after_19) @@ -68,7 +72,7 @@ def test_gen_dmrpp_side_car_h4_nsc(self): if not os.environ.get('PRESERVE_TEST_ASSETS'): self.addCleanup(os.remove, "grid_1_2d.hdf.dmrpp") - # Since we also add the dmrpp metadata generation informatio for the HDF4 files, + # Since we also add the dmrpp metadata generation information for the HDF4 files, # we need to ignore those information when doing comparision. with open('grid_1_2d.hdf.dmrpp') as f: dmrpp_lines_after_54 = f.readlines()[54:] @@ -95,8 +99,9 @@ def test_gen_dmrpp_side_car_h5_cf(self): # Hacky removal of lines that otherwise show spurious failure # due to test brittleness. (Better fix would be to run same version # stripping as on non-python tests) - dmrpp_minus_18_lines.pop(62) - baseline_minus_18_lines.pop(62) + # Although the above statement may be true, the following lines may cause IndexError.So comment them out. + #dmrpp_minus_18_lines.pop(62) + #baseline_minus_18_lines.pop(62) self.assertEqual(dmrpp_minus_18_lines ,baseline_minus_18_lines) diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline index a413b17c16..4b10a9ead5 100644 --- a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline +++ b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf.dmrpp.baseline @@ -61,7 +61,7 @@ END - 2025-06-16T11:59:01Z + 2026-03-25T20:48:03Z 3.21.1 @@ -73,7 +73,7 @@ END libdap-3.21.1 - build_dmrpp_h4 -f /Users/myang6/work/opendap/hyrax-1781/bes/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf -r grid_2_2d_ps.hdf.dmr -u OPeNDAP_DMRpp_DATA_ACCESS_URL -D -M + build_dmrpp_h4 -f /Users/myang6/work/opendap/hyrax-2043/bes/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_ps.hdf -r grid_2_2d_ps.hdf.dmr -u OPeNDAP_DMRpp_DATA_ACCESS_URL -D -M @@ -102,9 +102,7 @@ END NPGrid eos_cf_projection - - - + cA== @@ -125,7 +123,7 @@ END 4 - + @@ -147,7 +145,7 @@ END 5 - + @@ -161,7 +159,7 @@ END 5 4 - + @@ -175,7 +173,7 @@ END 5 4 - + @@ -224,9 +222,7 @@ END SPGrid eos_cf_projection - - - + cA== @@ -247,7 +243,7 @@ END 3 - + @@ -269,7 +265,7 @@ END 4 - + @@ -283,7 +279,7 @@ END 4 3 - + @@ -297,7 +293,7 @@ END 4 3 - + diff --git a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5.dmrpp.baseline b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5.dmrpp.baseline index 8628331167..2f7d45a7c6 100644 --- a/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5.dmrpp.baseline +++ b/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5.dmrpp.baseline @@ -2,7 +2,7 @@ - 2025-11-11T13:44:28Z + 2026-03-26T14:41:34Z 3.21.1 @@ -14,7 +14,7 @@ libdap-3.21.1 - build_dmrpp -f /Users/myang6/work/opendap/hyrax-1913-test/bes/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5 -r grid_2_2d_sin.h5.dmr -u OPeNDAP_DMRpp_DATA_ACCESS_URL -M + build_dmrpp -f /Users/myang6/work/opendap/hyrax-2043/bes/modules/dmrpp_module/get_dmrpp/unit-tests/grid_2_2d_sin.h5 -r grid_2_2d_sin.h5.dmr -u OPeNDAP_DMRpp_DATA_ACCESS_URL -M @@ -38,9 +38,7 @@ GeoX GeoY - - - + cA== @@ -58,7 +56,7 @@ 2 - + @@ -77,7 +75,7 @@ 2 - + @@ -88,7 +86,7 @@ 2 2 - + @@ -99,7 +97,7 @@ 2 2 - + @@ -140,9 +138,7 @@ GeoX GeoY - - - + cA== @@ -160,7 +156,7 @@ 4 - + @@ -179,7 +175,7 @@ 4 - + @@ -190,7 +186,7 @@ 4 4 - + @@ -201,7 +197,7 @@ 4 4 - + @@ -238,7 +234,7 @@ - HDFEOS_5.1.13 + HDFEOS_5.1.17 diff --git a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr index d52eee0434..5d7ec5353c 100644 --- a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr +++ b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr @@ -1,5 +1,5 @@ - + @@ -60,7 +60,7 @@ END - + polar_stereographic @@ -82,8 +82,11 @@ END GeoX GeoY + + NPGrid eos_cf_projection + - + projection_x_coordinate @@ -97,8 +100,11 @@ END GeoX + + NPGrid XDim + - + projection_y_coordinate @@ -112,6 +118,9 @@ END GeoY + + NPGrid YDim + @@ -151,7 +160,7 @@ END - + polar_stereographic @@ -173,8 +182,11 @@ END GeoX GeoY + + SPGrid eos_cf_projection + - + projection_x_coordinate @@ -188,8 +200,11 @@ END GeoX + + SPGrid XDim + - + projection_y_coordinate @@ -203,6 +218,9 @@ END GeoY + + SPGrid YDim + diff --git a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr.nmd.baseline b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr.nmd.baseline index 34bf6aedbf..24eb470c9b 100644 --- a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr.nmd.baseline +++ b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/grid_2_2d_ps.hdf.dmr.nmd.baseline @@ -60,7 +60,7 @@ END - + polar_stereographic @@ -82,8 +82,12 @@ END GeoX GeoY + + NPGrid eos_cf_projection + + cA== - + projection_x_coordinate @@ -97,8 +101,11 @@ END GeoX + + NPGrid XDim + - + projection_y_coordinate @@ -112,6 +119,9 @@ END GeoY + + NPGrid YDim + @@ -154,7 +164,7 @@ END - + polar_stereographic @@ -176,8 +186,12 @@ END GeoX GeoY + + SPGrid eos_cf_projection + + cA== - + projection_x_coordinate @@ -191,8 +205,11 @@ END GeoX + + SPGrid XDim + - + projection_y_coordinate @@ -206,6 +223,9 @@ END GeoY + + SPGrid YDim + diff --git a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/sinusoid.hdf.dmr.nmd.baseline b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/sinusoid.hdf.dmr.nmd.baseline index 36b016047d..23cb5f0f4e 100644 --- a/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/sinusoid.hdf.dmr.nmd.baseline +++ b/modules/dmrpp_module/tests/hdf4_build_dmrpp/no_missing_data/sinusoid.hdf.dmr.nmd.baseline @@ -53,6 +53,7 @@ END grid1 eos_cf_projection + cA== diff --git a/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_data_comp.baseline b/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_data_comp.baseline index 9c6f8a389a..23e9629ae5 100644 --- a/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_data_comp.baseline +++ b/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_data_comp.baseline @@ -9,11 +9,6 @@ group: HDFEOS { XDim = 2 ; YDim = 2 ; variables: - ubyte eos5_cf_projection ; - eos5_cf_projection:grid_mapping_name = "sinusoidal" ; - eos5_cf_projection:longitude_of_central_meridian = 0. ; - eos5_cf_projection:earth_radius = 6371007.181 ; - eos5_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; double XDim(XDim) ; XDim:standard_name = "projection_x_coordinate" ; XDim:long_name = "x coordinate of projection " ; @@ -30,8 +25,6 @@ group: HDFEOS { Longitude:units = "degrees_east" ; data: - eos5_cf_projection = 112 ; - XDim = -8895604.157333, -8339628.8975 ; YDim = 5559752.598333, 5003777.3385 ; @@ -50,11 +43,6 @@ group: HDFEOS { XDim = 4 ; YDim = 4 ; variables: - ubyte eos5_cf_projection ; - eos5_cf_projection:grid_mapping_name = "sinusoidal" ; - eos5_cf_projection:longitude_of_central_meridian = 0. ; - eos5_cf_projection:earth_radius = 6371007.181 ; - eos5_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; double XDim(XDim) ; XDim:standard_name = "projection_x_coordinate" ; XDim:long_name = "x coordinate of projection " ; @@ -71,8 +59,6 @@ group: HDFEOS { Longitude:units = "degrees_east" ; data: - eos5_cf_projection = 112 ; - XDim = -8895604.157333, -8617616.5274165, -8339628.8975, -8061641.2675835 ; diff --git a/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_dmrpp_comp.baseline b/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_dmrpp_comp.baseline index ccf11cf6cb..199726dfc2 100644 --- a/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_dmrpp_comp.baseline +++ b/modules/dmrpp_module/tests_build_dmrpp/get_dmrpp_baselines/missing_group_dmrpp_comp.baseline @@ -58,9 +58,7 @@ H5.EnableCheckNameClashing=true GeoX GeoY - - - + cA== @@ -78,7 +76,7 @@ H5.EnableCheckNameClashing=true 2 - + @@ -97,7 +95,7 @@ H5.EnableCheckNameClashing=true 2 - + @@ -108,7 +106,7 @@ H5.EnableCheckNameClashing=true 2 2 - + @@ -119,7 +117,7 @@ H5.EnableCheckNameClashing=true 2 2 - + @@ -160,9 +158,7 @@ H5.EnableCheckNameClashing=true GeoX GeoY - - - + cA== @@ -180,7 +176,7 @@ H5.EnableCheckNameClashing=true 4 - + @@ -199,7 +195,7 @@ H5.EnableCheckNameClashing=true 4 - + @@ -210,7 +206,7 @@ H5.EnableCheckNameClashing=true 4 4 - + @@ -221,7 +217,7 @@ H5.EnableCheckNameClashing=true 4 4 - + diff --git a/modules/fileout_netcdf/data/grid_2_2d_ps.hdf_mvs.h5 b/modules/fileout_netcdf/data/grid_2_2d_ps.hdf_mvs.h5 index 7272039de2..698c2c7e2a 100644 Binary files a/modules/fileout_netcdf/data/grid_2_2d_ps.hdf_mvs.h5 and b/modules/fileout_netcdf/data/grid_2_2d_ps.hdf_mvs.h5 differ diff --git a/modules/fileout_netcdf/data/grid_2_2d_ps_nmd.hdf.dmrpp b/modules/fileout_netcdf/data/grid_2_2d_ps_nmd.hdf.dmrpp index 0dc31bc19b..a544ae9492 100644 --- a/modules/fileout_netcdf/data/grid_2_2d_ps_nmd.hdf.dmrpp +++ b/modules/fileout_netcdf/data/grid_2_2d_ps_nmd.hdf.dmrpp @@ -1,5 +1,5 @@ - + @@ -85,11 +85,9 @@ END NPGrid eos_cf_projection - - - + cA== - + projection_x_coordinate @@ -108,10 +106,10 @@ END 4 - + - + projection_y_coordinate @@ -130,7 +128,7 @@ END 5 - + @@ -144,7 +142,7 @@ END 5 4 - + @@ -158,7 +156,7 @@ END 5 4 - + @@ -207,11 +205,9 @@ END SPGrid eos_cf_projection - - - + cA== - + projection_x_coordinate @@ -230,10 +226,10 @@ END 3 - + - + projection_y_coordinate @@ -252,7 +248,7 @@ END 4 - + @@ -266,7 +262,7 @@ END 4 3 - + @@ -280,7 +276,7 @@ END 4 3 - + diff --git a/modules/fileout_netcdf/data/grid_2_2d_sin.h5.dmrpp b/modules/fileout_netcdf/data/grid_2_2d_sin.h5.dmrpp new file mode 100644 index 0000000000..c7cd3a43a4 --- /dev/null +++ b/modules/fileout_netcdf/data/grid_2_2d_sin.h5.dmrpp @@ -0,0 +1,223 @@ + + + + + + + + + + + + + sinusoidal + + + 0.0 + + + 6371007.181 + + + GeoX GeoY + + cA== + + + + + projection_x_coordinate + + + x coordinate of projection + + + meter + + + GeoX + + + 2 + + + + + + + projection_y_coordinate + + + y coordinate of projection + + + meter + + + GeoY + + + 2 + + + + + + + + degrees_north + + + 2 2 + + + + + + + + degrees_east + + + 2 2 + + + + + + + + + K + + + /HDFEOS/GRIDS/SinGrid1/Data Fields/Temperature + + + /HDFEOS/GRIDS/SinGrid1/Latitude /HDFEOS/GRIDS/SinGrid1/Longitude + + + /HDFEOS/GRIDS/SinGrid1/eos5_cf_projection + + + + + + + + + + + + + sinusoidal + + + 0.0 + + + 6371007.181 + + + GeoX GeoY + + cA== + + + + + projection_x_coordinate + + + x coordinate of projection + + + meter + + + GeoX + + + 4 + + + + + + + projection_y_coordinate + + + y coordinate of projection + + + meter + + + GeoY + + + 4 + + + + + + + + degrees_north + + + 4 4 + + + + + + + + degrees_east + + + 4 4 + + + + + + + + + K + + + /HDFEOS/GRIDS/SinGrid2/Data Fields/Temperature + + + /HDFEOS/GRIDS/SinGrid2/Latitude /HDFEOS/GRIDS/SinGrid2/Longitude + + + /HDFEOS/GRIDS/SinGrid2/eos5_cf_projection + + + + + + + + + + + + + /HDFEOS INFORMATION/StructMetadata.0 + + + + + + + HDFEOS_5.1.17 + + + diff --git a/modules/fileout_netcdf/data/grid_2_2d_sin.h5_mvs.h5 b/modules/fileout_netcdf/data/grid_2_2d_sin.h5_mvs.h5 new file mode 100644 index 0000000000..db93bad698 Binary files /dev/null and b/modules/fileout_netcdf/data/grid_2_2d_sin.h5_mvs.h5 differ diff --git a/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd b/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd new file mode 100644 index 0000000000..23ccbfe5c0 --- /dev/null +++ b/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd @@ -0,0 +1,9 @@ + + + dap2 + /data/grid_2_2d_sin.h5.dmrpp + + + + + diff --git a/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd.baseline.header b/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd.baseline.header new file mode 100644 index 0000000000..2eef741604 --- /dev/null +++ b/modules/fileout_netcdf/tests/bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd.baseline.header @@ -0,0 +1,99 @@ +netcdf test { + +// global attributes: + :history = "removed date-timex grid_2_2d_sin.h5.dmrpp\n" ; + :history_json = "[{\"$schema\":\"https://harmony.earthdata.nasa.gov/schemas/history/0.1.0/history-0.1.0.json\",\"date_time\":\"removed date-time\",\"program\":\"hyrax\",\"version\":\"1.16.3\",\"parameters\":[{\"request_url\":\"grid_2_2d_sin.h5.dmrpp\"}]}]" ; + +group: HDFEOS { + + group: ADDITIONAL { + + group: FILE_ATTRIBUTES { + } // group FILE_ATTRIBUTES + } // group ADDITIONAL + + group: GRIDS { + + group: SinGrid1 { + dimensions: + XDim = 2 ; + YDim = 2 ; + variables: + ubyte eos5_cf_projection ; + eos5_cf_projection:grid_mapping_name = "sinusoidal" ; + eos5_cf_projection:longitude_of_central_meridian = 0. ; + eos5_cf_projection:earth_radius = 6371007.181 ; + eos5_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; + double XDim(XDim) ; + XDim:standard_name = "projection_x_coordinate" ; + XDim:long_name = "x coordinate of projection " ; + XDim:units = "meter" ; + XDim:_CoordinateAxisType = "GeoX" ; + double YDim(YDim) ; + YDim:standard_name = "projection_y_coordinate" ; + YDim:long_name = "y coordinate of projection " ; + YDim:units = "meter" ; + YDim:_CoordinateAxisType = "GeoY" ; + double Latitude(YDim, XDim) ; + Latitude:units = "degrees_north" ; + double Longitude(YDim, XDim) ; + Longitude:units = "degrees_east" ; + + group: Data_Fields { + variables: + float Temperature(YDim, XDim) ; + Temperature:units = "K" ; + Temperature:fullnamepath = "/HDFEOS/GRIDS/SinGrid1/Data Fields/Temperature" ; + Temperature:coordinates = "/HDFEOS/GRIDS/SinGrid1/Latitude /HDFEOS/GRIDS/SinGrid1/Longitude" ; + Temperature:grid_mapping = "/HDFEOS/GRIDS/SinGrid1/eos5_cf_projection" ; + } // group Data_Fields + } // group SinGrid1 + + group: SinGrid2 { + dimensions: + XDim = 4 ; + YDim = 4 ; + variables: + ubyte eos5_cf_projection ; + eos5_cf_projection:grid_mapping_name = "sinusoidal" ; + eos5_cf_projection:longitude_of_central_meridian = 0. ; + eos5_cf_projection:earth_radius = 6371007.181 ; + eos5_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; + double XDim(XDim) ; + XDim:standard_name = "projection_x_coordinate" ; + XDim:long_name = "x coordinate of projection " ; + XDim:units = "meter" ; + XDim:_CoordinateAxisType = "GeoX" ; + double YDim(YDim) ; + YDim:standard_name = "projection_y_coordinate" ; + YDim:long_name = "y coordinate of projection " ; + YDim:units = "meter" ; + YDim:_CoordinateAxisType = "GeoY" ; + double Latitude(YDim, XDim) ; + Latitude:units = "degrees_north" ; + double Longitude(YDim, XDim) ; + Longitude:units = "degrees_east" ; + + group: Data_Fields { + variables: + float Temperature(YDim, XDim) ; + Temperature:units = "K" ; + Temperature:fullnamepath = "/HDFEOS/GRIDS/SinGrid2/Data Fields/Temperature" ; + Temperature:coordinates = "/HDFEOS/GRIDS/SinGrid2/Latitude /HDFEOS/GRIDS/SinGrid2/Longitude" ; + Temperature:grid_mapping = "/HDFEOS/GRIDS/SinGrid2/eos5_cf_projection" ; + } // group Data_Fields + } // group SinGrid2 + } // group GRIDS + } // group HDFEOS + +group: HDFEOS_INFORMATION { + dimensions: + StructMetadata_0_len1 = 1321 ; + variables: + char StructMetadata_0(StructMetadata_0_len1) ; + StructMetadata_0:fullnamepath = "/HDFEOS INFORMATION/StructMetadata.0" ; + + // group attributes: + :HDFEOSVersion = "HDFEOS_5.1.17" ; + } // group HDFEOS_INFORMATION +} diff --git a/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.data b/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.data index f9264271e4..1b2753237f 100644 --- a/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.data +++ b/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.data @@ -22,18 +22,18 @@ group: NPGrid { eos_cf_projection:latitude_of_projection_origin = 90. ; eos_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; eos_cf_projection:eos_cf_grid_mapping = "NPGrid eos_cf_projection" ; - double XDim(XDim_NPGrid) ; - XDim:standard_name = "projection_x_coordinate" ; - XDim:long_name = "x coordinate of projection " ; - XDim:units = "meter" ; - XDim:_CoordinateAxisType = "GeoX" ; - XDim:eos_cf_grid = "NPGrid XDim" ; - double YDim(YDim_NPGrid) ; - YDim:standard_name = "projection_y_coordinate" ; - YDim:long_name = "y coordinate of projection " ; - YDim:units = "meter" ; - YDim:_CoordinateAxisType = "GeoY" ; - YDim:eos_cf_grid = "NPGrid YDim" ; + double XDim_NPGrid(XDim_NPGrid) ; + XDim_NPGrid:standard_name = "projection_x_coordinate" ; + XDim_NPGrid:long_name = "x coordinate of projection " ; + XDim_NPGrid:units = "meter" ; + XDim_NPGrid:_CoordinateAxisType = "GeoX" ; + XDim_NPGrid:eos_cf_grid = "NPGrid XDim" ; + double YDim_NPGrid(YDim_NPGrid) ; + YDim_NPGrid:standard_name = "projection_y_coordinate" ; + YDim_NPGrid:long_name = "y coordinate of projection " ; + YDim_NPGrid:units = "meter" ; + YDim_NPGrid:_CoordinateAxisType = "GeoY" ; + YDim_NPGrid:eos_cf_grid = "NPGrid YDim" ; double Latitude(YDim_NPGrid, XDim_NPGrid) ; Latitude:units = "degrees_north" ; Latitude:eos_latlon = "NPGrid lat" ; @@ -44,9 +44,9 @@ group: NPGrid { eos_cf_projection = 112 ; - XDim = -3850000, -1950000, -50000, 1850000 ; + XDim_NPGrid = -3850000, -1950000, -50000, 1850000 ; - YDim = 5850000, 3610000, 1370000, -870000, -3110000 ; + YDim_NPGrid = 5850000, 3610000, 1370000, -870000, -3110000 ; Latitude = 41.7398419197265, 47.373789621672, 47.5323926970798, 42.1396105077464, @@ -93,18 +93,18 @@ group: SPGrid { eos_cf_projection:latitude_of_projection_origin = -90. ; eos_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; eos_cf_projection:eos_cf_grid_mapping = "SPGrid eos_cf_projection" ; - double XDim(XDim_SPGrid) ; - XDim:standard_name = "projection_x_coordinate" ; - XDim:long_name = "x coordinate of projection " ; - XDim:units = "meter" ; - XDim:_CoordinateAxisType = "GeoX" ; - XDim:eos_cf_grid = "SPGrid XDim" ; - double YDim(YDim_SPGrid) ; - YDim:standard_name = "projection_y_coordinate" ; - YDim:long_name = "y coordinate of projection " ; - YDim:units = "meter" ; - YDim:_CoordinateAxisType = "GeoY" ; - YDim:eos_cf_grid = "SPGrid YDim" ; + double XDim_SPGrid(XDim_SPGrid) ; + XDim_SPGrid:standard_name = "projection_x_coordinate" ; + XDim_SPGrid:long_name = "x coordinate of projection " ; + XDim_SPGrid:units = "meter" ; + XDim_SPGrid:_CoordinateAxisType = "GeoX" ; + XDim_SPGrid:eos_cf_grid = "SPGrid XDim" ; + double YDim_SPGrid(YDim_SPGrid) ; + YDim_SPGrid:standard_name = "projection_y_coordinate" ; + YDim_SPGrid:long_name = "y coordinate of projection " ; + YDim_SPGrid:units = "meter" ; + YDim_SPGrid:_CoordinateAxisType = "GeoY" ; + YDim_SPGrid:eos_cf_grid = "SPGrid YDim" ; double Latitude(YDim_SPGrid, XDim_SPGrid) ; Latitude:units = "degrees_north" ; Latitude:eos_latlon = "SPGrid lat" ; @@ -115,9 +115,9 @@ group: SPGrid { eos_cf_projection = 112 ; - XDim = -3950000, -1316666.66666667, 1316666.66666667 ; + XDim_SPGrid = -3950000, -1316666.66666667, 1316666.66666667 ; - YDim = 4350000, 2275000, 200000, -1875000 ; + YDim_SPGrid = 4350000, 2275000, 200000, -1875000 ; Latitude = -52.3034622684233, -60.0926788355531, -52.3034622684233, diff --git a/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.header b/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.header index b12b13445b..c1a82dc377 100644 --- a/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.header +++ b/modules/fileout_netcdf/tests/bescmd/grid_2_2d_ps_nmd.hdf.dmrpp.bescmd.baseline.header @@ -22,18 +22,18 @@ group: NPGrid { eos_cf_projection:latitude_of_projection_origin = 90. ; eos_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; eos_cf_projection:eos_cf_grid_mapping = "NPGrid eos_cf_projection" ; - double XDim(XDim_NPGrid) ; - XDim:standard_name = "projection_x_coordinate" ; - XDim:long_name = "x coordinate of projection " ; - XDim:units = "meter" ; - XDim:_CoordinateAxisType = "GeoX" ; - XDim:eos_cf_grid = "NPGrid XDim" ; - double YDim(YDim_NPGrid) ; - YDim:standard_name = "projection_y_coordinate" ; - YDim:long_name = "y coordinate of projection " ; - YDim:units = "meter" ; - YDim:_CoordinateAxisType = "GeoY" ; - YDim:eos_cf_grid = "NPGrid YDim" ; + double XDim_NPGrid(XDim_NPGrid) ; + XDim_NPGrid:standard_name = "projection_x_coordinate" ; + XDim_NPGrid:long_name = "x coordinate of projection " ; + XDim_NPGrid:units = "meter" ; + XDim_NPGrid:_CoordinateAxisType = "GeoX" ; + XDim_NPGrid:eos_cf_grid = "NPGrid XDim" ; + double YDim_NPGrid(YDim_NPGrid) ; + YDim_NPGrid:standard_name = "projection_y_coordinate" ; + YDim_NPGrid:long_name = "y coordinate of projection " ; + YDim_NPGrid:units = "meter" ; + YDim_NPGrid:_CoordinateAxisType = "GeoY" ; + YDim_NPGrid:eos_cf_grid = "NPGrid YDim" ; double Latitude(YDim_NPGrid, XDim_NPGrid) ; Latitude:units = "degrees_north" ; Latitude:eos_latlon = "NPGrid lat" ; @@ -64,18 +64,18 @@ group: SPGrid { eos_cf_projection:latitude_of_projection_origin = -90. ; eos_cf_projection:_CoordinateAxisTypes = "GeoX GeoY" ; eos_cf_projection:eos_cf_grid_mapping = "SPGrid eos_cf_projection" ; - double XDim(XDim_SPGrid) ; - XDim:standard_name = "projection_x_coordinate" ; - XDim:long_name = "x coordinate of projection " ; - XDim:units = "meter" ; - XDim:_CoordinateAxisType = "GeoX" ; - XDim:eos_cf_grid = "SPGrid XDim" ; - double YDim(YDim_SPGrid) ; - YDim:standard_name = "projection_y_coordinate" ; - YDim:long_name = "y coordinate of projection " ; - YDim:units = "meter" ; - YDim:_CoordinateAxisType = "GeoY" ; - YDim:eos_cf_grid = "SPGrid YDim" ; + double XDim_SPGrid(XDim_SPGrid) ; + XDim_SPGrid:standard_name = "projection_x_coordinate" ; + XDim_SPGrid:long_name = "x coordinate of projection " ; + XDim_SPGrid:units = "meter" ; + XDim_SPGrid:_CoordinateAxisType = "GeoX" ; + XDim_SPGrid:eos_cf_grid = "SPGrid XDim" ; + double YDim_SPGrid(YDim_SPGrid) ; + YDim_SPGrid:standard_name = "projection_y_coordinate" ; + YDim_SPGrid:long_name = "y coordinate of projection " ; + YDim_SPGrid:units = "meter" ; + YDim_SPGrid:_CoordinateAxisType = "GeoY" ; + YDim_SPGrid:eos_cf_grid = "SPGrid YDim" ; double Latitude(YDim_SPGrid, XDim_SPGrid) ; Latitude:units = "degrees_north" ; Latitude:eos_latlon = "SPGrid lat" ; diff --git a/modules/fileout_netcdf/tests/testsuite.at b/modules/fileout_netcdf/tests/testsuite.at index 44fb81ed98..b9539ea0e5 100644 --- a/modules/fileout_netcdf/tests/testsuite.at +++ b/modules/fileout_netcdf/tests/testsuite.at @@ -206,6 +206,7 @@ AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP(bescmd/eos5_2_grids.h5.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP(bescmd/eos5_2_grids_dap4constraint.h5.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP_HDR(bescmd/eos5_ps_grp.h5.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP_HDR(bescmd/eos5_sin_grp.h5.bescmd) +AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP_HDR(bescmd/eos5_sin_grp_nmd.h5.dmrpp.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP(bescmd/grid_1_3d_xyz_aug_dap4.h5.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP(bescmd/grid_1_2d_dap4.h5.bescmd) AT_BESCMD_NETCDF_RESPONSE_TEST_NC4_ENHANCED_GRP(bescmd/swath_1_2d_xyz_special_char.h5.bescmd) diff --git a/modules/hdf5_handler/bes-testsuite/h5.nasa/airsm_utm.h5.das.bescmd.baseline b/modules/hdf5_handler/bes-testsuite/h5.nasa/airsm_utm.h5.das.bescmd.baseline index 064d49c3f5..9b40d16577 100644 --- a/modules/hdf5_handler/bes-testsuite/h5.nasa/airsm_utm.h5.das.bescmd.baseline +++ b/modules/hdf5_handler/bes-testsuite/h5.nasa/airsm_utm.h5.das.bescmd.baseline @@ -364,7 +364,7 @@ Last Changed Date: 2017-04-20 12:48:45 -0700 (Thu, 20 Apr 2017) HDFEOS_GRIDS_Ancillary_Data_Fields { } HDFEOS_INFORMATION { - String HDFEOSVersion "HDFEOS_5.1.13"; + String HDFEOSVersion "HDFEOS_5.1.15"; String fullnamepath "/HDFEOS INFORMATION"; } Channel_Information_Center_wavelength { diff --git a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5_sin_multi_grids.das.bescmd.baseline b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5_sin_multi_grids.das.bescmd.baseline index e721b4103d..d401980745 100644 --- a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5_sin_multi_grids.das.bescmd.baseline +++ b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5_sin_multi_grids.das.bescmd.baseline @@ -120,7 +120,7 @@ Attributes { HDFEOS_GRIDS_VNP_Grid_500m_2D_Data_Fields { } HDFEOS_INFORMATION { - String HDFEOSVersion "HDFEOS_5.1.13"; + String HDFEOSVersion "HDFEOS_5.1.15"; String fullnamepath "/HDFEOS INFORMATION"; } VNP_Grid_1km_2D_SensorAzimuth_1 { diff --git a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5lamaz.h5.das.bescmd.baseline b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5lamaz.h5.das.bescmd.baseline index 7916df3b67..2a4f7c427c 100644 --- a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5lamaz.h5.das.bescmd.baseline +++ b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5lamaz.h5.das.bescmd.baseline @@ -19,7 +19,7 @@ Attributes { HDFEOS_GRIDS_Southern_Hemisphere_Data_Fields { } HDFEOS_INFORMATION { - String HDFEOSVersion "HDFEOS_5.1.13"; + String HDFEOSVersion "HDFEOS_5.1.15"; String fullnamepath "/HDFEOS INFORMATION"; } Northern_Hemisphere_Flags_NorthernDaily { diff --git a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5ps.h5.das.bescmd.baseline b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5ps.h5.das.bescmd.baseline index 71baf01c11..7686a43c11 100644 --- a/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5ps.h5.das.bescmd.baseline +++ b/modules/hdf5_handler/bes-testsuite/h5.nasa/eos5ps.h5.das.bescmd.baseline @@ -19,7 +19,7 @@ Attributes { HDFEOS_GRIDS_SpPolarGrid12km_Data_Fields { } HDFEOS_INFORMATION { - String HDFEOSVersion "HDFEOS_5.1.13"; + String HDFEOSVersion "HDFEOS_5.1.15"; String fullnamepath "/HDFEOS INFORMATION"; } NpPolarGrid12km_SI_12km_NH_18H_ASC {