diff --git a/met/src/libcode/vx_nc_util/nc_utils.cc b/met/src/libcode/vx_nc_util/nc_utils.cc index eea6bb495c..a0c302b96c 100644 --- a/met/src/libcode/vx_nc_util/nc_utils.cc +++ b/met/src/libcode/vx_nc_util/nc_utils.cc @@ -1404,7 +1404,7 @@ void _apply_scale_factor(float *data, const T *packed_data, else { if (raw_min_val > packed_data[idx]) raw_min_val = packed_data[idx]; if (raw_max_val < packed_data[idx]) raw_max_val = packed_data[idx]; - data[idx] = (packed_data[idx] * scale_factor) + add_offset; + data[idx] = ((float)packed_data[idx] * scale_factor) + add_offset; if (data[idx] > 0) positive_cnt++; if (min_value > data[idx]) min_value = data[idx]; if (max_value < data[idx]) max_value = data[idx]; @@ -1667,7 +1667,7 @@ template int _apply_scale_factor(double *data, const T *packed_data, const int cell_count, const T fill_value, T &raw_min_val, T &raw_max_val, const char *data_type, - float add_offset, float scale_factor) { + double add_offset, double scale_factor) { int positive_cnt = 0; int unpacked_count = 0; double min_value = 10e10; @@ -1680,7 +1680,7 @@ int _apply_scale_factor(double *data, const T *packed_data, else { if (raw_min_val > packed_data[idx]) raw_min_val = packed_data[idx]; if (raw_max_val < packed_data[idx]) raw_max_val = packed_data[idx]; - data[idx] = (packed_data[idx] * scale_factor) + add_offset; + data[idx] = ((double)packed_data[idx] * scale_factor) + add_offset; if (data[idx] > 0) positive_cnt++; if (min_value > data[idx]) min_value = data[idx]; if (max_value < data[idx]) max_value = data[idx]; diff --git a/test/xml/unit_plot_data_plane.xml b/test/xml/unit_plot_data_plane.xml index 5a606bcea4..d3e99b8ede 100644 --- a/test/xml/unit_plot_data_plane.xml +++ b/test/xml/unit_plot_data_plane.xml @@ -257,6 +257,20 @@ + + &MET_BIN;/plot_data_plane + \ + &DATA_DIR_MODEL;/nccf/GloTEC_TEC_2015_03_17.nc \ + &OUTPUT_DIR;/plot_data_plane/plot_data_plane_NCCF_time.ps \ + 'name="TEC"; level="(20150317_000500,*,*)"; file_type=NETCDF_NCCF;' \ + -title "NCCF GloTEC - Total Electron Content" \ + -v 1 + + + &OUTPUT_DIR;/plot_data_plane/plot_data_plane_NCCF_time.ps + + + &MET_BIN;/plot_data_plane \